[BUG] Personal/Work account switch breaks Claude Code VS Code extension — reload doesn't reliably fix it
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment: Claude Code VS Code extension, Windows/WSL2 (Ubuntu 24.04), personal + work accounts configured.
What Should Happen?
Repro steps:
Session sits idle for ~15 minutes.
Switch account context to "Personal" in the extension.
Extension shows a login error — falls back to the standard 3-bar hamburger menu with a "Log in to Claude" prompt instead of the normal chat UI.
Click the account/workspace toggle — it visibly flips state (label updates).
Type a message and send it anyway.
Message does not send / does not reach the model, even though the UI now shows the switched labels as if the toggle succeeded.
Run "Developer: Reload Window."
First occurrence: reload fixed it, extension came back and worked.
Second occurrence (same repro): reload did not fix it — same broken state persisted after reload.
Only a full re-authentication (triggered a new Claude login prompt, completed OAuth in the external browser) actually recovered the session.
Error Messages/Logs
Steps to Reproduce
Repro steps:
Session sits idle for ~15 minutes.
Switch account context to "Personal" in the extension.
Extension shows a login error — falls back to the standard 3-bar hamburger menu with a "Log in to Claude" prompt instead of the normal chat UI.
Click the account/workspace toggle — it visibly flips state (label updates).
Type a message and send it anyway.
Message does not send / does not reach the model, even though the UI now shows the switched labels as if the toggle succeeded.
Run "Developer: Reload Window."
First occurrence: reload fixed it, extension came back and worked.
Second occurrence (same repro): reload did not fix it — same broken state persisted after reload.
Only a full re-authentication (triggered a new Claude login prompt, completed OAuth in the external browser) actually recovered the session.
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.220 (Claude Code) 1.130.0 1b6a188127eeaf9194f945eb6eb89a657e93c54c
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Impact: Non-deterministic recovery. Sometimes a window reload is enough, sometimes it isn't, and there's no clear signal to the user for which case they're in — leads to repeated reload attempts before falling back to full re-auth. Cost ~6 hours of a work session.
Expected behavior: Switching accounts/workspaces should either complete cleanly or fail with a clear "please re-authenticate" prompt immediately — not leave the UI in a state where labels updated but the underlying session/auth token didn't, and not require trial-and-error between reload and full logout/login to recover.
Suggested fix direction: When an account/workspace switch is initiated, invalidate and re-fetch the session token atomically with the UI state change, so the UI never shows a "switched" label while the backend connection is still on the old/broken session. Reload Window should be a reliable recovery path for this class of failure, or the extension should detect the broken state itself and prompt re-auth automatically instead of silently swallowing sent messages.
3 Comments
Update: this is worse than a UI toggle glitch — it's orphaning chat session history, and it's 100% reproducible (4/4 old chats checked, all broken).
After recovering via full re-auth (see original report), I checked four unrelated old conversations from before the account switch, spanning different dates and topics. All four fail to load with the same error shape:
Error: Claude Code returned an error result: No conversation found with session ID: dc844b40-df12-4c8f-ba8d-ede7679a9660
Error: Claude Code returned an error result: No conversation found with session ID: 0d7243eb-9508-4d41-966c-72fcc1293d43
Error: Claude Code returned an error result: No conversation found with session ID: 43a3ec40-f0f9-48ea-93e0-247055a2774b
Error: Claude Code returned an error result: No conversation found with session ID: 2f8eff08-94ab-46e7-ab54-61abb4910694
Several of these were /compact-continued sessions with substantial prior context (one had a multi-step summary covering feature work across several days) — that history is now unreachable through the panel.
This isn't the toggle silently dropping one in-flight message (original report). The account-switch failure (~/.claude-work ↔ ~/.claude-personal via the claude-code-profile-switcher extension) appears to corrupt or repoint whatever local index maps session IDs to stored transcripts — losing/orphaning it for every prior chat, not just the one open at switch time.
Severity: prior work/chat history becomes unrecoverable via the UI, apparently unconditionally once this triggers, not just for the actively-open chat. Flagging in case transcripts are still recoverable on disk even though the panel can't find them — happy to provide local paths/session IDs if useful for debugging.
This is the smoking gun: the profile switcher swaps which .claude.json/config dir is active, but session history is scoped per-profile. When you're on Personal, Work's session IDs simply aren't in Personal's index — even though the actual .jsonl transcript files sit untouched on disk under Work's directory. It's not corruption, it's cross-profile lookup: the UI is asking the wrong profile's registry about the other profile's sessions.
Key detail: I found .claude.json in ~/.claude-personal (34 KB, updated 00:32) but there's no .claude.json in ~/.claude-work — only in personal. That top-level .claude.json is very likely the session registry/index the panel reads to know which session IDs exist and map them to transcripts. If the profile switcher extension swaps CLAUDE_CONFIG_DIR (or equivalent) between ~/.claude-work and ~/.claude-personal but the panel's lookup logic ends up reading (or caching) the other profile's .claude.json index — or work's index is missing/stale — the transcript files exist on disk but the panel can't resolve session-ID → file because it's consulting the wrong or absent index.
That's the real bug: an index/registry desync between profiles, not data loss.
This is worth adding to the GitHub comment — it makes the report much more actionable for maintainers (points them straight at .claude.json session registry handling during profile switch), and it also means your history is very likely recoverable, not gone.
I think I hit the same root cause from a different angle — not the
idle-timeout UI desync described above, but a silent account swap
between two separate profiles.
Setup: two separate editors on the same macOS user account — VS Code
using the default config (no override, work account), and Cursor
(VS Code fork) with
claudeCode.environmentVariablessettingCLAUDE_CONFIG_DIRto a custom directory for a personal account.At some point, with no manual re-authentication in either app
(confirmed via shell history — no
claudeCLI invocation in therelevant window), the work account's VS Code session got silently
replaced by the personal account. Confirmed by checking
oauthAccount.emailAddressin~/.claude.json(personal email) andby VS Code's own account UI (also showing the personal account).
My working theory:
CLAUDE_CONFIG_DIRseparates the session/projectstorage, but does NOT separate the secure-storage/keychain-backed
credential — that appears to need
CLAUDE_SECURESTORAGE_CONFIG_DIRset explicitly and separately. Since only
CLAUDE_CONFIG_DIRwas setfor the personal profile, logging in there ended up overwriting the
shared keychain credential that the default (work) profile was
relying on.
Workaround: explicitly setting
CLAUDE_SECURESTORAGE_CONFIG_DIRalongside
CLAUDE_CONFIG_DIRfor the non-default profile. Would begood if this were documented — or better, if
CLAUDE_CONFIG_DIRimplied an isolated secure-storage scope by default unless
overridden, so this isn't a silent trap for anyone running multiple
accounts across editors on one machine.