anthropics / anthropics/claude-code
Code tab: session history sidebar is partitioned by login method (SSO vs. gateway) even for the same account/org
- Vorherrschende Sprache
- Python
- Sterne
- 145k
- Forks
- 23.1k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
## Description
When switching the Claude desktop app's login method between SSO and gateway-based login (same Anthropic account, same organization), the Code tab's session history sidebar shows a completely different, non-overlapping set of sessions depending on which login method is active — even though both methods authenticate to the same `accountUuid` and `organizationUuid`.
Sessions created while logged in via one method become invisible in the sidebar when switched to the other method, and reappear when switched back. This looks exactly like data loss from the user's perspective, even though the underlying session files are not deleted.
## Environment
- Claude desktop app (Code tab)
- macOS (Darwin 24.6.0)
- Same Anthropic account/org throughout: `accountUuid` and `organizationUuid` identical in `~/Library/Application Support/Claude/.claude.json`'s `oauthAccount` regardless of login method used.
## Steps to reproduce
1. Log into the Claude desktop app via SSO for an organization/account that has existing Code tab session history for a given project directory.
2. Note the sessions listed in the sidebar for that project (in our case, ~300+ sessions for one project, spanning months, all with `isArchived: false`).
3. Switch the app's login method to a gateway-based login, authenticating as the *same* account/org.
4. Observe: the sidebar for the same project now shows a different, much smaller set of sessions (in our case, only sessions created since switching to gateway login) — the previously visible SSO-era sessions are gone.
5. Switch back to SSO login.
6. Observe: the original ~300+ sessions reappear, and the sessions created under gateway login are no longer shown.
7. Repeatable on demand by toggling login method back and forth, no app restart required to reproduce (though we did try restarting — it does not resolve the discrepancy).
## Evidence gathered
- `~/Library/Application Support/Claude/claude-code-sessions///` contains one `local_.json` file per session. This directory path is identical across both login methods (same accountUuid/organizationUuid).
- Using the app's own session-management surface (`get_session self`, `list_sessions`) while logged in via gateway auth returns only 2 sessions for the project in question, neither of which has a corresponding `local_*.json` file yet written to disk at query time — suggesting the sidebar list is backed by an internal index that is separate from (and not simply reconciled with) the on-disk `local_*.json` files.
- The ~300+ pre-existing `local_*.json` files on disk (all matching the same accountUuid/organizationUuid) are not visible in the sidebar while gateway login is active, but do become visible again when switching back to SSO — confirming the partition is keyed by something narrower than the Anthropic account/org identity (likely an internal profile/token identifier specific to the auth flow used).
## Expected behavior
Session history in the Code tab sidebar should be scoped to the Anthropic account + organization (and project directory), not to the specific authentication method/flow used to establish the current app session. Switching login methods for the same account should not hide or "lose" session history.
## Impact
Switching login methods (e.g. an org migrating users from SSO to a gateway-based login, or a user needing to use both depending on network/device) makes all prior session history for a project appear to vanish, which is confusing and looks like data loss even though the files remain on disk.
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Bewertung
Dieses Issue wurde noch nicht bewertet.