Skip to content

Warn when retire_after is shorter than a runtime keeps its history - #74

Merged
wu-sheng merged 1 commit into
mainfrom
retention-warning
Oct 17, 2026
Merged

wu-sheng merged 1 commit into
mainfrom
retention-warning

Conversation

@wu-sheng

Copy link
Copy Markdown
Member

A retired session is never collected again, even when its runtime resumes it (#73). So a retire_after shorter than the runtime keeps its own history can retire a session the runtime may still resume. When storage.retention.retire_after is set, asz now says how it compares with each enabled runtime.

What changes

  • Claude Code. asz reads cleanupPeriodDays from the user's settings.json, in the configuration directory the adapter already resolves, and from the managed settings for the whole machine. These are managed-settings.json, then managed-settings.d/*.json in the order Claude Code sorts them. A managed value wins over the user's. A file is read as Claude Code reads it:

    • a regular file only, so a named pipe cannot block startup;
    • a leading byte-order mark stripped, and UTF-16LE after FF FE;
    • empty or whitespace-only settings by JavaScript's trim.

    Only a whole number of days of at least 1 counts. A file asz cannot read or parse, and an invalid value, is named, and nothing is assumed for it.

  • An inspected value, never the effective one. asz always says that Claude Code's effective retention was not determined. Project, command-line, device and server-managed settings can change it. Claude Desktop and Cowork keep sessions at any age by default. Settings Claude Code cannot read pause its cleanup unless managed settings provide the value. It warns in addition when retire_after is shorter than the inspected value, or than the default of 30 days when none is set. With an explicit source_root, it inspects nothing and says so.

  • Kiro keeps a session until it is deleted, so asz warns whenever kiro-local is enabled. LangChain has no source and gets no warning. With retire_after off, nothing is said.

  • Where. At startup, in asz sources, on the list page's status (with the full text in its title), and once in the first pass's log:

    warning  : The inspected user settings "/home/me/.claude/settings.json" set cleanupPeriodDays to 30 days.
    warning  : Claude Code's effective retention was not determined. ...
    warning  : For the inspected value: Claude Code keeps a session for 30 days; storage.retention.retire_after is 7 days. A session resumed after it is retired is not collected.
    
  • Docs. The storage root's Retirement section says what is inspected, how, and its limits, with the Claude Code documentation it follows. The configuration page, the command-line page, the Claude Code and Kiro pages and the changelog are updated.

The facts about Claude Code come from its documentation, read on 2026-10-17: the cleanup and its exemptions, the managed settings paths and merge order, and the default.

Tests

  • internal/adapters/claudecode:
    • the user value, an unset one, a managed value over the user's, and a later managed-settings.d file over an earlier one;
    • hidden and non-.json files ignored, and names ordered by UTF-16 code units;
    • 30.0 counts, while 1.5, 0, -1, "30" and 1e300 are named;
    • an unreadable file or directory, one that does not parse, and a top level that is not an object;
    • a byte-order mark, UTF-16LE and JavaScript whitespace at all three places;
    • named pipes and links to them, on Unix.
  • cmd/asz:
    • 7 days against 30 warns, and 60 days does not, but the inspected and "not determined" lines are always said;
    • the default is used only when nothing is set;
    • the user directory is resolved in Claude Code's order;
    • an explicit source_root, Kiro, and nothing said with retire_after off or for LangChain alone;
    • startup, the status, the first pass once, a first pass that waits, and asz sources.
  • internal/view: the status carries the warning.

No test reads the machine's real settings. Each guard was proven by reverting it. make test, the JSON v1 step (GOEXPERIMENT=nojsonv2), make scenarios, lint, and the Windows build and vet pass.

A retired session is never collected again, even when its runtime
resumes it. When storage.retention.retire_after is set, asz now says how
it compares with how long each enabled runtime keeps a session.

For Claude Code, asz reads cleanupPeriodDays from the user's
settings.json and from the managed settings for the whole machine:
managed-settings.json, then managed-settings.d/*.json in the order
Claude Code sorts them. A managed value wins over the user's. A file is
read as Claude Code reads it: a regular file only, a leading byte-order
mark stripped, UTF-16LE after FF FE, and empty settings by JavaScript's
trim. Only a whole number of days of at least 1 counts. A file asz
cannot read or parse, and an invalid value, is named, and nothing is
assumed for it.

This is an inspected value, never the effective one. asz always says
that Claude Code's effective retention was not determined: other
settings can change it, Claude Desktop and Cowork keep sessions at any
age by default, and settings it cannot read pause its cleanup. It warns
in addition when retire_after is shorter than the inspected value, or
than the default of 30 days when none is set. With an explicit
source_root it inspects nothing and says so. Kiro keeps a session until
it is deleted, so it warns whenever kiro-local is enabled. LangChain has
no source and gets no warning.

The lines are said at startup, in asz sources, on the list page's
status, and once in the first pass's log.
@wu-sheng
wu-sheng merged commit f6e3274 into main Oct 17, 2026
24 checks passed
@wu-sheng
wu-sheng deleted the retention-warning branch October 17, 2026 14:49
@wu-sheng wu-sheng added this to the 0.6.0 milestone Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant