Skip to content

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.

{
"cleanupPeriodDays": 365
}

For very long retention:

{
"cleanupPeriodDays": 3650
}

0 does not mean “keep forever”. It fails validation (the minimum is 1). Pick a large number instead.

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.

/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.

  • /resume
  • /compact
  • /insights
  • CLAUDE.md
  • Status line context display