claude-code - 💡(How to fix) Fix [BUG] Claude Code deletes 160 session JSONL files (60,702 messages) — auto-memory saves nothing about months of work [3 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#48782Fetched 2026-04-16 06:51:07
View on GitHub
Comments
3
Participants
3
Timeline
7
Reactions
0
Author
Timeline (top)
cross-referenced ×4commented ×3

Root Cause

The only reason this session was recoverable is because the user built their own archive system (Rootz Desktop V6 with SQLite + blockchain archival). Without that, months of collaborative thinking would be permanently lost.

Code Example

sessions-index.json: 160 entries (Jan 27Mar 14, 2026)
JSONL files on disk: 0 of 160 remain
Today's sessions: 5 new files (Apr 15 only), ~32MB
Gap: Mar 15Apr 14 (one month) — never indexed, files also gone
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues — this is related to #48334, #46621, #41591, #41874, #39667, #41458 but adds forensic evidence and a new dimension (memory system failure)
  • This is a single bug report
  • I am using the latest version of Claude Code (VS Code extension, Windows 11)

What's Wrong?

Two compounding failures that together cause catastrophic knowledge loss:

Failure 1: Silent session file deletion

160 session JSONL files (60,702 messages, ~1GB) were deleted from disk. The sessions-index.json still exists with all 160 entries pointing to files that no longer exist.

Forensic evidence collected in-session:

sessions-index.json: 160 entries (Jan 27 – Mar 14, 2026)
JSONL files on disk: 0 of 160 remain
Today's sessions: 5 new files (Apr 15 only), ~32MB
Gap: Mar 15 – Apr 14 (one month) — never indexed, files also gone

The .claude/ directory is NOT under OneDrive sync — it's a plain local directory. The files were deleted by Claude Code itself (likely during an upgrade).

Failure 2: Auto-memory system retains nothing meaningful

Even if session files are treated as ephemeral, the auto-memory system (MEMORY.md + topic files) should preserve key decisions and relationships. It does not.

Experiment: We attempted to recover a significant session about "MATRIX" (MAITRIX/MemFlow integration — a multi-model AI hub partnership active since Feb 2026). Results:

SourceFound?Notes
Claude auto-memory (37 files)NOZero mentions
sessions-index.json (160 entries)NONot in any firstPrompt
JSONL files on diskNOAll 160 deleted
External archive (Rootz SQLite, 3GB)YESFull session, 37 observations, design doc

The only reason this session was recoverable is because the user built their own archive system (Rootz Desktop V6 with SQLite + blockchain archival). Without that, months of collaborative thinking would be permanently lost.

The compounding effect

Claude creates an illusion of continuity — the user experiences a persistent collaborator ("I've been working with Claude for months") while Claude experiences each session as day one. When session files disappear AND the memory system saves nothing, the user discovers too late that the AI retained zero trace of their shared work.

What Should Happen?

  1. Session JSONL files must never be silently deleted — especially not during upgrades. If cleanup is needed, archive first or require explicit user consent.
  2. sessions-index.json should not be orphaned — if files are deleted, the index should reflect reality.
  3. Auto-memory should be far more aggressive — key decisions, relationships, project names, partner names, and architectural choices should be saved automatically, not left to Claude's discretion.
  4. Users should be warned when session data is about to be or has been deleted.
  5. MCP servers should be able to provide memory backends — see #48465, #47023

Steps to Reproduce

  1. Use Claude Code VS Code extension on Windows for 2+ months
  2. Accumulate 160+ sessions with significant collaborative work
  3. Allow Claude Code to auto-update
  4. Check ~/.claude/projects/{slug}/ — JSONL files are gone
  5. Check sessions-index.json — still references 160 entries to missing files
  6. Ask Claude "what do you know about [topic from a deleted session]" — answer: nothing

Environment

  • Platform: Windows 11 Pro 10.0.26200
  • Claude Code: VS Code extension (latest)
  • Model: Claude Opus 4.6
  • Session count (indexed): 160
  • Session count (surviving): 0
  • Messages lost: 60,702
  • Date range of lost sessions: Jan 27 – ~Apr 14, 2026
  • Memory files: 37 (none reference the lost MATRIX session)

Related Issues

  • #48334 — Desktop app update deletes session history
  • #46621 — Critical: silently deletes conversation history
  • #41591 — Auto-update deletes session .jsonl files
  • #41458 — cleanupPeriodDays ignored, 490 sessions deleted
  • #40877 — Active sessions missing + memory persistence unreliable
  • #48465 — Allow MCP servers to replace auto memory backend
  • #47023 — Expose compact/session lifecycle hooks for external memory
  • #46283 — Claude Code ignored MEMORY.md warning

Additional Context

This is being documented as part of a research paper on AI memory loss: "The Illusion of Continuity in AI Agent Relationships." The forensic evidence, experiment methodology, and recovery attempts are recorded in docs/RESEARCH-ai-memory-loss.md.

The user quote that captures the problem: "I can not believe how flippant Claude is with memory. There is months of work, organized thinking, and poof — the assumption is you remember, which you don't."

extent analysis

TL;DR

To prevent catastrophic knowledge loss, ensure that session JSONL files are not silently deleted, especially during upgrades, and improve the auto-memory system to retain key decisions and relationships.

Guidance

  • Verify that the sessions-index.json file is updated to reflect the reality of deleted session files to avoid orphaned entries.
  • Implement a more aggressive auto-memory system that saves key decisions, relationships, and project names automatically.
  • Warn users when session data is about to be or has been deleted to prevent unexpected loss.
  • Consider using an external archive system, like the user's Rootz Desktop V6 with SQLite + blockchain archival, to ensure session data preservation.
  • Review related issues (#48334, #46621, #41591, #41458, #40877, #48465, #47023, #46283) for potential solutions and workarounds.

Example

No code snippet is provided as the issue is more related to the functionality and behavior of the Claude Code extension rather than a specific code problem.

Notes

The provided information suggests that the issue is related to the Claude Code extension's behavior during upgrades and its auto-memory system. However, without access to the extension's code or more detailed documentation, it's challenging to provide a definitive fix. The suggestions provided are based on the information given and may need to be adapted to the specific implementation of the Claude Code extension.

Recommendation

Apply a workaround by using an external archive system to ensure session data preservation until a more robust auto-memory system is implemented in the Claude Code extension. This approach allows for the preservation of critical session data while the underlying issues with the extension are addressed.

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

claude-code - 💡(How to fix) Fix [BUG] Claude Code deletes 160 session JSONL files (60,702 messages) — auto-memory saves nothing about months of work [3 comments, 3 participants]