Claude Code silently deletes conversation transcripts after 30 days
Claude Code defaults to deleting project history after one month. Update your configuration immediately to prevent permanent data loss.
Impact: High
Why it matters
Prevents the accidental loss of long-term debugging context and design reasoning logs.
TL;DR
- 01Check your Claude Code settings immediately
- 02Set cleanupPeriodDays to at least 3650
- 03Back up your ~/.claude/projects/ directory
Key facts
- Default cleanup
- 30 days
The Deletion Mechanism
Claude Code deletes files in ~/.claude/projects/ that exceed the 30-day threshold. This happens silently on startup, with no first-run disclosure or warning.
How to Protect Your Data
To stop the auto-deletion, update your settings.json file. Set the cleanupPeriodDays to a much higher value, such as 3650 (10 years), effectively disabling the cleanup:
{
"cleanupPeriodDays": 3650
}Current Limitations
Users have noted that this setting might not be respected in all scenarios. Currently, the most reliable method is to treat your ~/.claude/ directory as temporary or implement a manual backup strategy for these JSONL logs, as there is currently no soft-delete or trash folder implementation.
Try it in 2 minutes
{
"cleanupPeriodDays": 3650
}json
✓ When to use
- When maintaining long-running AI agent sessions
- When needing to reference past debugging steps
What to do today
- Locate settings.json
- Add "cleanupPeriodDays": 3650
- Verify your JSON syntax
What the community says
“There's nothing in claude code onboarding that tells you about this config setting. So most people don't discover it until it's bitten them.”
Sources