Severity: Critical — silent, irreversible data loss
Description
Claude Code automatically prunes (deletes) old .jsonl conversation files from ~/.claude/projects/*/ without any user consent, notification, or configuration option. Users discover their conversation history is gone only when they try to --resume an old session.
Evidence
On an Arch Linux system running Claude Code installed via AUR, upgraded through versions 2.1.85 → 2.1.101 over March–April 2026:
- 10 conversation sessions spanning 2025-11-22 to 2026-02-07 for a single project were silently deleted
- The
.jsonl conversation files are completely gone from disk
- In newer versions, a
sessions-index.json is written to preserve metadata about deleted sessions — but for projects where pruning happened before that feature was introduced, even the metadata is lost
- The only surviving record is prompt text in
~/.claude/history.jsonl (no assistant responses preserved)
- Cross-checking all projects on the system confirms the pattern:
sessions-index.json entries and on-disk .jsonl files are always disjoint sets, proving systematic pruning
Observed behavior across multiple projects
HAS index | entries=1 | jsonls=4 | backoffice
HAS index | entries=0 | jsonls=3 | collector
NO index | jsonls=2 | rq-backtest <-- no index, all old sessions gone
HAS index | entries=4 | jsonls=6 | fluxcd
HAS index | entries=1 | jsonls=3 | trade-track-pilot
In every project, index entries reference session IDs with NO corresponding .jsonl file, and .jsonl files on disk are NOT in the index — confirming the index is a tombstone for already-deleted conversations.
Expected behavior
- Never delete user data without explicit consent. Conversation history is the user's data.
- At minimum, provide a configurable retention policy (e.g.,
sessionRetentionDays in settings.json) with a default of unlimited.
- If pruning is deemed necessary, warn the user before deletion and offer an archive/export option.
- Provide a
claude sessions list / claude sessions export command for users to manage their own data.
Environment
- OS: Arch Linux (kernel 6.19.11-zen1-1-zen)
- Claude Code: 2.1.101 (installed via AUR)
- Upgrade path: 2.1.85 → 2.1.86 → 2.1.88 → 2.1.92 → 2.1.97 → 2.1.98 → 2.1.101
Severity: Critical — silent, irreversible data loss
Description
Claude Code automatically prunes (deletes) old
.jsonlconversation files from~/.claude/projects/*/without any user consent, notification, or configuration option. Users discover their conversation history is gone only when they try to--resumean old session.Evidence
On an Arch Linux system running Claude Code installed via AUR, upgraded through versions 2.1.85 → 2.1.101 over March–April 2026:
.jsonlconversation files are completely gone from disksessions-index.jsonis written to preserve metadata about deleted sessions — but for projects where pruning happened before that feature was introduced, even the metadata is lost~/.claude/history.jsonl(no assistant responses preserved)sessions-index.jsonentries and on-disk.jsonlfiles are always disjoint sets, proving systematic pruningObserved behavior across multiple projects
In every project, index entries reference session IDs with NO corresponding
.jsonlfile, and.jsonlfiles on disk are NOT in the index — confirming the index is a tombstone for already-deleted conversations.Expected behavior
sessionRetentionDaysinsettings.json) with a default of unlimited.claude sessions list/claude sessions exportcommand for users to manage their own data.Environment