claude-code - 💡(How to fix) Fix Desktop app: session history lost when switching accounts [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#48511Fetched 2026-04-16 06:58:09
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×4

Error Message

  • Option C: At minimum, warn users before switching that sessions will not carry over

Root Cause

The CLI version does not have this problem, because CLI stores session data locally in ~/.claude/, independent of account.

RAW_BUFFERClick to expand / collapse

Problem

When switching between Claude accounts in the Desktop app (e.g., after one account's quota is exhausted), all session history disappears. The new account has no access to previous sessions.

This happens in both Cowork mode AND Code mode (local </> mode). Even though Code mode runs locally on the machine, session history is still lost when switching accounts. This is unexpected — if Code mode executes everything locally, sessions should persist locally too, like CLI does.

The CLI version does not have this problem, because CLI stores session data locally in ~/.claude/, independent of account.

Steps to Reproduce

  1. Use Claude Code Desktop app with Account A (either Cowork or Code </> mode)
  2. Create several sessions with conversation history
  3. Account A quota runs out
  4. Switch to Account B
  5. All previous sessions are gone — even in Code (local) mode

Expected Behavior

Session history should persist across account switches, especially in Code mode which runs locally. Sessions should be stored locally (like CLI does), not tied to a specific cloud account.

Current Behavior

Sessions are bound to the cloud account in ALL Desktop modes, including the local Code mode. Switching accounts = losing all session context.

Impact

Users who rotate between multiple accounts (common when quota is exhausted) lose all working context — conversation history, in-progress tasks, debugging sessions. This makes Desktop significantly less usable than CLI for multi-account workflows.

The fact that even Code mode (which is supposed to be local) loses sessions makes this feel like a bug rather than a design choice.

Suggested Solution

  • Option A: Store session history locally (like CLI does) regardless of which account is active, at least for Code mode
  • Option B: Allow importing/linking sessions across accounts
  • Option C: At minimum, warn users before switching that sessions will not carry over

Environment

  • Claude Code Desktop on macOS (Apple M4 Pro)
  • Multiple Claude accounts with subscription
  • Affects both Cowork and Code (</>) modes

extent analysis

TL;DR

Store session history locally, similar to the CLI version, to persist sessions across account switches in the Desktop app.

Guidance

  • Investigate the current session storage mechanism in the Desktop app to understand why it's tied to the cloud account, and consider modifying it to store sessions locally, at least for Code mode.
  • Compare the session storage implementation between the CLI and Desktop app to identify key differences and potential solutions.
  • Evaluate the suggested solutions (Option A, B, or C) and assess their feasibility, considering factors like data consistency, security, and user experience.
  • Consider adding a warning or notification to users before switching accounts, informing them that sessions will not be preserved, as a temporary mitigation.

Example

No code snippet is provided, as the issue lacks specific technical details about the session storage implementation.

Notes

The solution may require significant changes to the Desktop app's architecture, and careful consideration of security and data consistency implications. The fact that Code mode, which runs locally, still loses sessions suggests a potential design or implementation flaw.

Recommendation

Apply a workaround, such as storing session history locally (Option A), as it seems to be the most straightforward solution to address the issue, and aligns with the expected behavior described in the issue.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING