ovm.sh / dev log

Your sessions have a 30-day expiry

Claude Code deletes chat transcripts older than 30 days. It is a default, not a policy you agreed to, and nothing tells you when it runs. The odd part is what stops it: a settings file too broken to read is the most reliable protection your history has.

Published · Last updated · Claude · retention

1The default

Claude Code writes a transcript of every session under ~/.claude/projects/, one directory per working directory, and those transcripts are what /resume reads. They are also the only durable record of a session: what you asked, what ran, what it concluded.

A sweep deletes the old ones. The setting that governs it is cleanupPeriodDays, and the binary documents it plainly:

Number of days to retain chat transcripts before automatic
cleanup (default: 30). Minimum 1. Use a large value for long
retention; use --no-session-persistence to disable transcript
writes entirely.

Thirty days is short for anything you would want to look back on. A month-old debugging session is exactly the kind of thing you go looking for — the one where you worked out why the build broke, which you now need because it broke again.

2Nothing announces it

The deletion is silent. There is no prompt, no summary, no line in the session telling you that fifty transcripts just went. You discover it the way everyone discovers it: by going to look for something and finding the list starts more recently than you expected.

This is the failure shape this dev log keeps returning to. An absence renders identically whether nothing was ever there, or something was removed on a schedule you did not know about. Deleted data does not leave an error behind, which is precisely what makes it worth writing down before you need it.

3The inversion

Reading the strings in a 2.1.233 build turns up the sweep's own refusals, and they are more interesting than the setting:

Skipping cleanup: a settings file could not be read or parsed,
so cleanupPeriodDays may be set to a value that cannot be seen.
Fix the settings file (see /doctor) to re-enable cleanup.

Skipping cleanup: settings have validation errors but
cleanupPeriodDays was explicitly set. Fix settings errors to
enable cleanup.

Transcript retention cleanup is paused until the settings errors
above are fixed (cleanupPeriodDays cannot be determined reliably).

Read that the other way around and it says something uncomfortable: a healthy configuration is what deletes your history, and a broken one is what preserves it. Anyone who has been carrying a settings error for months has been protected by it without knowing. Fix the error — a good idea for every other reason — and the sweep resumes on your next run, against a retention value you may never have chosen.

The caution itself is right. Refusing to delete on an unreadable setting is the correct call: the alternative is falling back to a default and destroying data the user may have explicitly asked to keep. It is fail-safe behaviour. It just means the state of your history has been decided by the state of your JSON.

4What to set

One line in ~/.claude/settings.json:

{
  "cleanupPeriodDays": 3650
}

There is no documented "never" value — the minimum is 1 and the guidance is to use a large number — so pick a horizon longer than you expect to care about and treat it as off. The opposite end is --no-session-persistence, which stops transcripts being written at all; that is the right choice for a shared or sensitive machine, and it costs you /resume.

Whichever you choose, choose it. The point is not that 30 days is the wrong number. It is that almost nobody running Claude Code has decided what their number should be, and the default is quietly making that call every day.

5Why this sits on an OVM page

OVM exists because versions of these tools behave differently from one another, and the evidence for that lives in what happened when you ran them. We keep every managed version on disk precisely so a question about an old build stays answerable months later. A default that deletes your side of that record after 30 days undercuts it: the binary is still there, and the session where it misbehaved is not.

OVM will not edit your Claude settings — a version manager reaching into another tool's configuration is exactly the kind of thing that should never happen silently. Surfacing the number, and the fact that it is a number, is the right level to help at.

6References