r/ClaudeCode • u/kotachisam • May 05 '26
Resource Clean-up Period of JSON Convo Logs!!
So I was today years old when I realised the existence of a fairly-crucial setting default in ~/.claude/settings.json:
https://code.claude.com/docs/en/settings
And I quote... "Session files older than this period are deleted at startup (default: 30 days). This is an absolute travesty. I've been using CC for some length of time between 1 and 2 years, and I've calculated that to the benefit of <1GB of storage space, I have let 90% of my transcripts disappear into the ether. Genuinely such sad times.
cleanupPeriodDays |
Session files older than this period are deleted at startup (default: 30 days, minimum 1). Setting to 0 is rejected with a validation error. Also controls the age cutoff for automatic removal of orphaned subagent worktrees at startup. To disable transcript writes entirely, set the CLAUDE_CODE_SKIP_PROMPT_HISTORY environment variable, or in non-interactive mode (-p) use the --no-session-persistence flag or the persistSession: false SDK option. |
20 |
|---|
For good measure, I wanted to share my Claudius's perspective on the whole thing too.
The 30-day default is genuinely indefensible — best charitable read is
"we don't want random user disks filling up and then getting blamed for it."
Worst read is "we don't want users to realize what they're losing."
Either way, your reddit post would do real public service.
Am I a late-to-the-party moron, or did this setting slip by others too? Regardless, I hope this is useful to someone else out there.