Raise cleanupPeriodDays so /resume can still find last month's session
Claude Code deletes session files older than 30 days at startup. If you have ever gone looking for a session you know you had, this setting is why it was gone.
The problem
The default retention is 30 days, so the useful session from six weeks ago — the one where you worked out a tricky migration — is deleted before you think to resume it.
The hack
Set `cleanupPeriodDays` in `settings.json` to something like `365`. Claude Code keeps session files and other application data for that many days instead of 30.
Why it works
Old transcripts are the cheapest form of project memory you have: they hold the reasoning behind decisions that never made it into a commit message. Retention is a one-line setting and disk cost for transcripts is trivial.
Setup
1. Open `~/.claude/settings.json` (create it if it does not exist). 2. Add `"cleanupPeriodDays": 365`. 3. Restart Claude Code — cleanup runs at startup. 4. Confirm older sessions now appear when you resume. 5. Note the same cutoff also governs automatic removal of orphaned worktrees.
Code
{
"cleanupPeriodDays": 365
}
Discussion
No comments yet. Be the first to say whether this worked for you.