claude-code - 💡(How to fix) Fix Desktop app update deletes session history (sessions-index.json + .jsonl files) [2 comments, 3 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#48334Fetched 2026-04-16 07:02:43
View on GitHub
Comments
2
Participants
3
Timeline
11
Reactions
2
Timeline (top)
labeled ×4cross-referenced ×3commented ×2subscribed ×2
RAW_BUFFERClick to expand / collapse

Bug description

After updating the Claude Code desktop app (from versions 2.1.34/2.1.63/2.1.92 → 2.1.101), session history was partially or fully deleted across multiple projects.

What was lost

Projectsessions-index.json.jsonl session filesStatus
Project A (150+ hours of work)DeletedAll deletedComplete data loss
Project BDeletedAll deletedComplete data loss
Project CDeleted10 files survivedIndex lost, data intact
Project DDeleted3 files survivedIndex lost, data intact
Project ESurvived (old entry points to deleted .jsonl)1 old session deleted, current survivedPartial loss

Impact

  • Two projects lost all session history permanently — no .jsonl files remain, no sessions-index.json
  • Two projects lost their sessions-index.json but the .jsonl data files survived — sessions disappeared from the sidebar but could be reconstructed by rebuilding the index
  • One project had an old session .jsonl deleted but the index file survived (with a stale reference)

The inconsistency (some projects lost only the index, others lost everything) suggests the cleanup/migration logic during the update is not working correctly.

Steps to reproduce

  1. Have multiple projects with session history across different directories
  2. Update the Claude Code desktop app to 2.1.101
  3. Open the app — session history is gone from the sidebar
  4. Check ~/.claude/projects/ — sessions-index.json files are missing, and for some projects the .jsonl files are also deleted

Expected behavior

App updates should preserve all session history. If a migration is needed, it should be non-destructive.

Environment

  • macOS 26.5
  • Claude Code desktop app, updated to 2.1.101
  • Previous versions: 2.1.34, 2.1.63, 2.1.92

Additional context

  • No git repo tracked the ~/.claude/ directory, so there is no backup of session files
  • No Time Machine backups were available
  • The .claude/ directory is in .gitignore for all projects, so session data was never committed
  • Session data is stored locally only and does not sync to claude.ai, making this data loss permanent
  • The sessions-index.json files could be reconstructed from surviving .jsonl files (by parsing sessionId, timestamps, and first prompt from the JSONL entries), but for projects where .jsonl files were also deleted, recovery is impossible

extent analysis

TL;DR

Reconstructing the sessions-index.json files from surviving .jsonl files may help recover some lost session history for projects where only the index was deleted.

Guidance

  • For projects where only the sessions-index.json file was deleted but .jsonl files survived, attempt to rebuild the index by parsing the sessionId, timestamps, and first prompt from the JSONL entries.
  • Investigate the update process of the Claude Code desktop app to version 2.1.101 to identify why the cleanup/migration logic failed to preserve session history.
  • Consider adding the ~/.claude/ directory to a backup system or version control to prevent future data loss, despite it being in .gitignore.
  • Review the app's documentation for any guidance on session history migration or backup procedures that might have been overlooked.

Example

No specific code example can be provided without more details on the JSONL file format and the expected structure of the sessions-index.json file. However, a general approach to reconstructing the index could involve reading each .jsonl file, extracting the necessary information (sessionId, timestamps, first prompt), and writing this data into a new sessions-index.json file in the appropriate format.

Notes

The provided information does not specify the exact format of the .jsonl files or the sessions-index.json files, which would be necessary for a precise reconstruction method. Additionally, for projects where both the sessions-index.json and .jsonl files were deleted, recovery of session history may not be possible without external backups.

Recommendation

Apply a workaround by attempting to rebuild the sessions-index.json files from surviving .jsonl files for projects where possible, as there is no clear indication of a fixed version of the app that addresses this 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…

FAQ

Expected behavior

App updates should preserve all session history. If a migration is needed, it should be non-destructive.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING