Default cleanupPeriodDays=30 silently and permanently deleted months of irreplaceable conversations, twice
What happened
Claude Code purges conversation transcripts older than cleanupPeriodDays (default: 30 days) at startup — silently, permanently, with no warning, no trash, no backup requirement, and no recovery path.
On my machines this destroyed, in two separate incidents: a tax-filing conversation, then (discovered 2026-08-30) the transcripts of ~20 projects across two Macs — including months of health-tracking work for myself and my father (May–July sessions, purged ~Aug 9 while I was still actively using the tool daily in other projects). I only learned the setting existed after the first loss; I raised it to 3650 on Aug 26 — 17 days too late for the second.
Why the default is wrong
- Deletion is silent: no prompt, no notice at purge time, no log the user sees.
- It is permanent: files are unlinked, not moved to a trash/archive.
- It is inconsistent:
history.jsonl(user prompts) is kept forever, while the actual transcripts — the valuable half — are the part deleted. - The tool's own features (memory,
--resume, long-running projects) invite users to treat sessions as durable records. The default treats them as cache.
Ask
- Change the default to no deletion (or years, not days).
- If cleanup runs, require explicit opt-in and warn before the first purge, listing what will be deleted.
- Archive instead of unlink (move to
~/.claude/trash/with its own retention). - Surface the setting in onboarding/docs prominently as a data-loss risk.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗