You'll noticeTier: how much it should matter to you
2Useful: my rating, 1 to 5
2Signal: worth watching, 1 to 5
SessionsArea: what it touches
ImprovementsKind: in v2.1.304,
ImprovementsSection of the release
What
Claude Code periodically cleans up old files in the background, such as past conversation transcripts. Retention cleanup is the part that deletes old ones. It now checks whether server-managed settings (settings an organization pushes from Anthropic's servers) can be known first:
When the session reads no stored server-managed settings and holds none of its own, retention cleanup stops and returns remote_settings_unknowable. The log reads "Skipping retention cleanup: this session reads no stored server-managed settings". Before, cleanup only looked at user settings and policy settings.
Background housekeeping waits for that result. When it is remote_settings_unknowable, it does not write the .last-cleanup marker and skips a later cleanup step. Before, it always wrote .last-cleanup.
Cleanup gains a helper that waits for settings.read hooks before the sweep starts.
A new check, read by the finding as a test for a session with no disk, makes several disk writes give up: saving remote settings, peer file transfer, file attachments, reading an update result, and writing an inbound attachment.
Why
If a setting that controls how long files are kept could only come from the server and is not available, Claude Code no longer goes ahead and deletes files under rules it can't see.
The entry above is what we published on the day. These lines were added later, as Anthropic's own pages caught up, and they sit beside the original rather than replacing it.
Confirmed sinceAnthropic's documentation has since written up cleanupPeriodDays, on Hooks reference.There is no timeout or retry limit. The session remains on disk until you resume it, subject to the [`cleanupPeriodDays`](/docs/en/settings-reference#cleanupperioddays) retention sweep, which deletes session files after 30 days by default,…hookssee the edit
How sure we are
Two sources agreeTwo things we can check say the same as this entry.
Anthropic's documentation agreesAnthropic's documentation has since written up cleanupPeriodDays, on Hooks reference.
Anthropic's release notes agreeChanged mods' settings.read hooks to receive each settings layer and rewrite the merged settings, so a managed mod can make an…