Increase cleanupPeriodDays for /resume
Claude Code keeps local session transcripts for 30 days by default, then deletes them in a background sweep. Increasing this makes /resume more useful.
Recommended setting
Section titled “Recommended setting”{ "cleanupPeriodDays": 365}For very long retention:
{ "cleanupPeriodDays": 3650}Do not use 0
Section titled “Do not use 0”0 does not mean “keep forever”. It fails validation (the minimum is 1). Pick a large number instead.
What survives the sweep
Section titled “What survives the sweep”Auto memory is excluded. The projects/<project>/memory/ directory, including MEMORY.md and its topic files, stays until you or Claude edits or deletes it. Only the transcripts and checkpoints go, so you lose the ability to /resume those sessions, not what Claude learned from them.
Why it matters
Section titled “Why it matters”/resume lets you continue previous coding sessions. If old sessions have been cleaned up, they no longer appear in /resume, and /insights has fewer sessions to analyze.
Claude Code becomes more useful when you preserve context.
Related context tools
Section titled “Related context tools”/resume/compact/insightsCLAUDE.md- Status line context display