Claude Code users are discovering that their conversation transcripts have been silently deleted, and the culprit is a default setting buried in the tool's configuration that wipes chat history after 30 days—with no warning to developers who assumed their work was safely stored on disk.
The Silent Cleanup Mechanism
The issue stems from cleanupPeriodDays, which defaults to 30 and executes every time Claude Code starts up. Any .jsonl transcript file older than the threshold gets deleted automatically, permanently. Multiple open GitHub issues document users discovering this the hard way, with their debugging context, design discussions, and reasoning trails vanishing without notice or recourse.
Anthropic's Defense
Anthropic confirmed to The Register that the 30-day erasure policy has existed since Claude Code's launch as a documented security measure. 'Keeping plain text transcripts of coding sessions on disk indefinitely creates real security and privacy risks, since they can contain source code, credentials, and other sensitive material,' the company stated. 'The 30-day default balances the ability to resume recent work against not holding that data on disk longer than needed.'
Users Push Back on Disclosure
Developers aren't buying it. GitHub user FTSBrand wrote in an issue that's become a reference point for the complaints: 'Cleanup runs out of the box with no install-time disclosure or first-run dialog. Users who treat their conversation history as durable working knowledge are silently mistaken about the persistence model.' Another user, joekhochstetter, noted that while code and git history survived for their project, 'the reasoning trail - design discussions, debugging context, analysis - is gone. For research work that context is the artifact.'
The mtime Bug Makes Things Worse
Here's where it gets technical—and more frustrating. Several users report that simply increasing cleanupPeriodDays to a higher value doesn't actually prevent deletion. GitHub user ojura's root cause analysis explains why: deletion is keyed to file modification time (mtime) rather than the transcript's actual last activity timestamp. 'Because mtime is externally mutable, anything that touches it flips the outcome: a restore, a sync client, or a script that sets mtimes to a session's true last-activity date makes a present session look old, and it is silently deleted on the next sweep,' ojura detailed.
No Recovery Path Exists
There's no soft-deletion, grace period, or rollback mechanism. Users report there's not even a log of what gets wiped—once it's gone, it's gone. The only workaround community members have converged on is backing up Claude Code transcripts manually, with several implementations circulating in the issue threads.
Key Takeaways
- Default 30-day transcript cleanup runs automatically at startup with zero user notification
- Increasing
cleanupPeriodDaysdoesn't work reliably due to an mtime-based deletion bug - No recovery mechanism exists—deletion is permanent and unlogged
- Anthropic frames this as intentional security design, not a defect
The Bottom Line
Anthropic chose a security rationale that conveniently absolves them of accountability for data loss—but shipping silent destructive behavior without disclosure isn't a security feature, it's a trap. Developers building workflows around AI-assisted coding need reliable persistence, and until Claude Code treats transcript durability as a first-class concern rather than an afterthought, the trust gap will keep growing.