Critical: Claude Code silently deletes conversation history without user consent
Open 💬 9 comments Opened Apr 11, 2026 by vstoyanov
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
.jsonlconversation files are completely gone from disk - In newer versions, a
sessions-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 - 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.jsonentries and on-disk.jsonlfiles 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.,
sessionRetentionDaysinsettings.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 exportcommand 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
This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗