[BUG] Interrupted sign-in with a different email orphans the desktop app's entire Code session store; sessions appear permanently deleted while transcripts remain intact on disk

Status Open
Reported on v2.1.238
Maintainer reply None cached
Activity 0 comments · opened Aug 21, 2026

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?

Desktop app (Cowork) · Code sessions · auth/account switching

Environment
macOS (Apple Silicon)
Claude desktop app 1.34493.1 (Electron 42.9.2, Node 24.18.1)
Claude Code CLI 2.1.238 (installed at ~/.local/bin/claude)
Account: Claude Max (20x), single user, stripe_subscription
Summary
After an unexpected logout, I accidentally began signing in with the wrong email. I never completed that sign-in — the flow demanded a new subscription, so I bailed and signed in with my correct account. That interrupted attempt was enough to:

Create a phantom account/org locally and repoint the app at it (lastKnownAccountUuid in config.json).
Leave the real account's Code session store empty after switching back — all ~33 session records gone from the sidebar, appearing permanently deleted.
Independently, the CLI's hasCompletedOnboarding flag was false (last onboarding version 2.1.50 vs installed 2.1.238), so every claude launch looped into first-run onboarding, which made claude --resume <id> appear broken too.

At no point was any transcript actually lost — all .jsonl files in ~/.claude/projects/ were intact throughout. But from the user's perspective, months of work vanished from both the app and (apparently) the CLI simultaneously. Recovery required manually copying the app's per-session metadata files back from a backup.
Timeline (all times ET, 2026-08-21)
~09:00 — App logs the user out unexpectedly. User begins sign-in with the wrong email; a new account (ac60583f-…) and org (41ca21ac-…) are created locally at 09:03. config.json lastKnownAccountUuid is rewritten to the phantom account (mtime 09:03:21, one second after phantom-org allowlist creation). User abandons the flow at the "start a new subscription" screen — sign-in was never completed.
~09:06 — User makes a manual copy of ~/Library/Application Support/Claude (this backup later enabled recovery).
User signs into the correct account. Desktop app's Code page remains empty. Signing out and back in again does not help.
~14:15–14:48 — Every claude CLI launch shows first-run onboarding (theme picker). ~/.claude.json shows hasCompletedOnboarding: false, lastOnboardingVersion: "2.1.50", while oauthAccount is the correct account with an active Max subscription. Completing onboarding once fixes the CLI permanently; claude --resume then works from the appropriate project directory.
App-side symptoms persist after CLI is healthy:
Existing Code session cards show "Your computer needs to sign in again — Session initialization failed (worker_auth_expired)".
Sessions resumed via terminal appear in the Code page as live mirrors, then vanish when the terminal closes (expected), but the app's own persistent list never repopulates.
The app's "Resume a session" picker lists only 4 sessions — none of them among the ~33 the store previously held. Searching by title ("scraps") or by session UUID finds nothing. /resume <uuid> in the composer just reopens the same picker.
Diagnosis: the live store directory ~/Library/Application Support/Claude/claude-code-sessions/<accountUuid>/<orgUuid>/ for the real account contained 1 file (vs 33+ local_*.json session records in the 09:06 backup). The phantom account's directory also existed, empty.
Fix: quit app → cp -n the 33 local_*.json records from the backup into the live store → relaunch. Full sidebar restored; everything works.
What I believe went wrong
Account switch on an incomplete sign-in. Merely starting a sign-in with a different email — never authenticating, never subscribing — was enough to mint a local account/org and repoint lastKnownAccountUuid. Bailing out did not restore the previous pointer.
Session store not restored on switch-back. After signing into the original account, the app did not repopulate claude-code-sessions/<real-account>/<real-org>/ — the records were gone from the live directory (present in the 09:06 backup). Whether they were deleted, moved, or the directory was recreated empty, the net effect is that a completed sign-in back to the original account leaves the session list permanently empty with no error surfaced.
Resume picker hides what the store "owns." The picker appears to exclude sessions it believes belong to the app's store, so when the store is corrupted/empty the affected sessions are unreachable from the app by any path — not listed in the sidebar, not searchable in the picker, not resumable by UUID. The only recovery path was manual file surgery.
(Separate, compounding) hasCompletedOnboarding was reset (or invalidated by the 2.1.50 → 2.1.238 jump), so the CLI simultaneously looped into onboarding. Two unrelated failures presenting at once made this look like total data loss.
Steps to reproduce (presumed)
On a machine with an active account and existing Code sessions, sign out.
Begin sign-in with a different email that has no subscription; abandon at the subscription screen.
Sign in with the original account.
Observe: Code page is empty; previous sessions are absent from the resume picker; per-session cards (if reachable) show worker_auth_expired.
Inspect ~/Library/Application Support/Claude/claude-code-sessions/<original-account>/<org>/ — session records missing.
Expected behavior
An abandoned sign-in should not repoint the app's account state, or at minimum switching back should fully restore it.
Account switching should never empty another account's session store — and if records are missing at startup, the app could rebuild them from ~/.claude/projects/ transcripts, which remained intact the whole time.
The resume picker should be able to find any session that exists on disk (or at least by explicit UUID), so store corruption isn't unrecoverable from the UI.
A version-jump onboarding reset shouldn't block --resume; ideally claude --resume <id> would run onboarding and then still honor the resume request.
Impact
To a user this presents as total loss of all Claude Code history — sidebar empty, picker empty, CLI apparently reset — when in fact nothing was lost. Without a coincidental manual backup of Application Support/Claude taken minutes before, the app-side session list would have been unrecoverable by any supported means (transcripts would still be resumable via CLI, but nothing in the product communicates that).
Artifacts I can provide on request
The 09:06 backup of the store (33 local_*.json records) vs the post-incident live directory (1 file)
config.json mtimes showing the pointer rewrite at 09:03:21
~/.claude.json with correct oauthAccount alongside hasCompletedOnboarding: false
Timestamps for the phantom account/org directory creation

What Should Happen?

When at the apps first screen first comes up after using the wrong email - (personal or team) prior to choosing a subscription level, there is no way to back out and change the email address. A simple not email1@address.com? link (a la google) and the ability to enter an email again. Even stopping before choosing a team or subscription had already wiped out my sessions.

Error Messages/Logs

Steps to Reproduce

Log out of desktop app. Type non-subscription email into login box. Get emailed login link. At this point there is already no visible way to back.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.238 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

_No response_

View original on GitHub ↗