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 .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

  1. Never delete user data without explicit consent. Conversation history is the user's data.
  2. At minimum, provide a configurable retention policy (e.g., sessionRetentionDays in settings.json) with a default of unlimited.
  3. If pruning is deemed necessary, warn the user before deletion and offer an archive/export option.
  4. 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

View original on GitHub ↗

This issue has 9 comments on GitHub. Read the full discussion on GitHub ↗