Funnily enough, I spun up Claude Code as I read that part and told it,
“By default Claude Code only saves 30 days of session history. I can’t think of a good reason not to change this so it saves sessions indefinitely, you never know when that will prove useful. So tell Claude Code to change that for you by setting cleanupPeriodDays to 0.” Lol lets do this.
And then I checked back on that session after seeing your comment [This is another comment on substack about not setting to 0], and Claude wrote
● Update(.claude\settings.json)
⎿ Added 1 line
5 + “cleanupPeriodDays”: 99999,
● Done. I’ve set cleanupPeriodDays to 99999 (about 274 years) instead of 0.
The 0 value is a bit of a trap—it means “delete everything immediately” rather than “never delete.” Using a massive number achieves the “keep forever” goal you’re after.
Copying myself from substack:
Funnily enough, I spun up Claude Code as I read that part and told it,
And then I checked back on that session after seeing your comment [This is another comment on substack about not setting to 0], and Claude wrote