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

[BUG] Session history silently wiped after app update — no server-side backup, no export, no warning

Open mani-lyric opened this issue 6 months ago • 2 comments

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?

Summary Months of Claude Code session history were permanently lost after a desktop app update. Sessions are stored only in Electron's IndexedDB — which can be cleared during app updates — with no server-side sync, no automatic export, and no user warning.

What happened App updated, all session history prior to ~March 2026 was gone No warning shown before or after the update Sessions are not recoverable — Anthropic has no server-side copy Investigation findings Session metadata stored in Electron IndexedDB: ~/Library/Application Support/Claude/IndexedDB/ Transcripts stored locally as .jsonl files in ~/.claude/projects/ After update: only 5 transcript files remained, 15 session titles in UI, all older sessions gone completely App version: 2.1.156 Why this matters Claude Code is a paid product marketed as a long-term coding partner. Losing months of work silently due to an Electron IndexedDB purge is serious data loss, not a minor UX issue.

Requests Server-side session sync (parity with claude.ai) Automatic local export before updates Clear warning that sessions are local-only Session export feature (JSON/Markdown)

What Should Happen?

Requests Server-side session sync (parity with claude.ai) Automatic local export before updates Clear warning that sessions are local-only Session export feature (JSON/Markdown)

Error Messages/Logs

The conversations and code data is lost

Steps to Reproduce

Don't know but after upgrades the data is lost

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

1.9659.2

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

No response

mani-lyric avatar Jun 01 '26 05:06 mani-lyric

This happened to me too, it sucks.

I built a toolkit to try help you fix it. Running diagnose.py from claude-code-session-recovery on those two directories tells you exactly which sessions are in which state. It splits them into: transcript present + metadata present (healthy); transcript present + metadata missing (recoverable via synth); metadata present + transcript missing (transcript needs backup first); both missing (depends on backup).

Before running any repairs, one clarification on the storage layers that might shape what's recoverable: the Desktop's session list renders from two separate places. The ~/Library/Application Support/Claude/IndexedDB/ directory is the cloud/bridge cache — it holds titles and cloud sync state. The file layer the toolkit works with is:

  • Metadata files (what surfaces sessions in the local session list): ~/Library/Application Support/Claude/claude-code-sessions/<acct>/<org>/local_<uuid>.json
  • Transcript files (conversation history): ~/.claude/projects/<project-slug>/*.jsonl

The cleanup pass that's typically behind mass transcript deletion targets the .jsonl files — it usually leaves the metadata JSON files alone. So the "15 session titles in UI" most likely means 15 metadata entries still exist, each pointing at a transcript file that's now gone. The 5 surviving transcripts may or may not have matching metadata entries.

For the deleted transcripts: Time Machine is the first thing worth checking before concluding they're gone. The ~/.claude/projects/ directory is hidden and sometimes falls outside default backup scope, but it's often covered. Check whether you have a snapshot predating the update via the Time Machine UI or tmutil listbackups. If a snapshot exists, find_missing_jsonls_in_backup.py in the toolkit can scan it for the deleted .jsonl files.

Toolkit is Windows-tested but the file formats are identical on macOS — paths above are the macOS equivalents. Full write-up at #56172.

BasedGPT avatar Jun 01 '26 08:06 BasedGPT

I have the same issue on Pro plan with Claude Code desktop app on Windows 11.

HarkataAI avatar Jun 03 '26 19:06 HarkataAI

For anyone who wants a proactive backup layer before the next update: I built Clean My Agent to scan and back up Claude Code session files to a safe local location on demand.

blain3white avatar Jun 09 '26 03:06 blain3white