[BUG] Desktop Code tab: imported CLI sessions vanish after an account switch, and Import won't re-import them under the new account
Environment
- Claude desktop 2.42304.0 (Windows 11, MSIX)
- Claude Code 2.1.299
- Two claude.ai accounts on one machine, switched with the app's sign-out / sign-in. Same project folder throughout.
Steps
- Signed in as account A, use the Code tab's Import to bring in CLI sessions started with
claudein a terminal. The log shows[CCD-SessionRecovery] Recovered CLI session <id> as local_<id>once per session. Each lands inclaude-code-sessions\<accountA>\<orgA>\local_<cliSessionId>.jsonwithadoptedFromOtherSurface: true. - Work in one of the imported threads in the app.
- Sign out, then sign in as account B.
Actual
Every imported thread disappears from the sidebar, and Import under B finds nothing:
Scanning for recoverable CLI transcripts (75 known session ids …)
Scan complete: 0 recoverable … "scannedTranscripts":115 … "skippedFiltered":115
Probe: 0 importable CLI transcript(s)
while LocalSessionManager for B reports existingSessions=0.
The "known session ids" used to filter Import include threads held only in another account's list, but the sidebar shows only the current account's list. The sessions are reachable through neither.
Before any Import had run, the same switch worked: the scan under the new account reported 67–69 recoverable sessions, with 2–4 known ids. So running Import once under one account is what makes these terminal-started sessions unimportable under every other account.
Expected
A local CLI session's thread should follow the machine across account switches, or Import should treat sessions held only by another account's list as importable.
Workaround
Copy the local_*.json files from the old account's claude-code-sessions\<account>\<org>\ folder into the new account's folder, then restart the app.
Related
- #74662: the sidebar list is per account (feature request). Its recent comments report Import skipping sessions that were created in Desktop under the other account. This report is the terminal-started case: such sessions do import the first time, but once imported under one account they are filtered out of Import under any other account.
- #94507: the same account/org-scoped record layout, for an organization switch on one account.
Your workaround is what https://github.com/SnlperStripes/claude-account-switcher does on every switch (unofficial, I wrote it). Before Claude starts, it copies the local_*.json entries of your other accounts into the one you switch to, so imported threads stay in the sidebar under both. It also keeps both sign-ins, so a switch skips sign-out and the email code. It's tested on Windows with the MSIX app.
The manual copy in your workaround is what https://github.com/ramonmazinga/claude-code-multi-account-bridge does on every run, in both directions and without touching a sign-in.
It keeps every claude-code-sessions/<account>/<org>/ folder merged, imported threads included, and archive or delete on one account carries to the others, so a thread you deleted does not come back from the other account. It backs up each file before overwriting or deleting it. One Python file, standard library only. On Windows the sync runs by hand or from Task Scheduler (python bridge.py sync --execute); if your install keeps its data somewhere other than %APPDATA%\Claude, pass that folder with --user-data. I use it daily on macOS, so Windows feedback is welcome.
One more switch-state casualty, same root pattern. The workaround that avoids the whole class on Windows: one Desktop instance per account, each with its own user-data folder (Multi Instance Pro, disclosure: my app, paid, Microsoft Store). There is no switch for the Code tab to survive — each account's imported CLI sessions stay attached to their own instance, and "switching" is opening another window.
https://apps.microsoft.com/detail/9N3X1FSCLMWK?cid=gh-102826
Unofficial, not affiliated with Anthropic.