claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG] Desktop Code tab: imported CLI sessions vanish after an account switch, and Import won't re-import them under the new account

Open ThatDragonOverThere opened this issue 1 month ago • 3 comments

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

  1. Signed in as account A, use the Code tab's Import to bring in CLI sessions started with claude in a terminal. The log shows [CCD-SessionRecovery] Recovered CLI session <id> as local_<id> once per session. Each lands in claude-code-sessions\<accountA>\<orgA>\local_<cliSessionId>.json with adoptedFromOtherSurface: true.
  2. Work in one of the imported threads in the app.
  3. 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.

ThatDragonOverThere avatar Oct 16 '26 18:10 ThatDragonOverThere

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.

SnlperStripes avatar Oct 20 '26 10:10 SnlperStripes

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.

ramonmazinga avatar Nov 12 '26 08:11 ramonmazinga

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.

radelqui avatar Nov 30 '26 17:11 radelqui