Prompt :

I switched Claude accounts on the same machine and my old chats vanished from the Claude Desktop sidebar (Code tab). I want them back. Please investigate and fix.

Background on how this works — the transcripts are NOT gone. Claude Desktop scopes its sidebar index by account UUID:

Windows: %APPDATA%\Claude\claude-code-sessions\<accountUuid>\<orgUuid>\local_<sessionId>.json macOS: ~/Library/Application Support/Claude/claude-code-sessions/<accountUuid>/<orgUuid>/local_<sessionId>.json Linux: ~/.config/Claude/claude-code-sessions/<accountUuid>/<orgUuid>/local_<sessionId>.json

Each local_.json is a small sidebar record (sessionId, cwd, title, model, lastActivityAt, ...). The actual conversation transcripts live separately in ~/.claude/projects/<escaped-cwd>/.jsonl and are never touched by an account switch. Logging into a new account just creates a NEW <accountUuid> folder, so the sidebar looks empty while the old records sit in the old folder.

Please do this:

  1. Back up first: cp -r ~/.claude/projects ~/.claude/projects.bak
  2. List the <accountUuid> directories under claude-code-sessions and count the local_*.json files in each (find the nested <orgUuid> level too). The one with many files = my old account. The one with few/none = my new account.
  3. Confirm which UUID is the CURRENT account before writing anything. Read "oauthAccount" in ~/.claude.json, or grep for accountUuid in <ClaudeAppData>/Local Storage/leveldb/*.ldb *.log Do not guess — the directory names are opaque UUIDs and copying into the wrong one does nothing.
  4. Back up the new account's session folder (cp -r it to a .bak sibling).
  5. Copy ONLY the local_.json files from old -> new, with cp -n so nothing existing is overwritten. Do NOT copy backlog/tasks.json, scheduled-tasks.json, or the deleted_ tombstones.
  6. Print the before/after file counts so I can verify.
  7. Tell me to fully quit and restart Claude Desktop — the sidebar index only loads at startup.
  8. Give me the exact one-line undo command (restore the .bak folder) in case the sidebar looks wrong afterwards.

Do not touch my credentials, do not copy ~/.claude.json wholesale (it contains the oauthAccount for the old login and would clobber my new one), and do not delete anything.