[FEATURE] Separate retention for archived sessions (keep active sessions, clean up archived ones)
Problem
cleanupPeriodDays deletes every session that has been inactive longer than the set period (30 days by default), whether it's archived or not. There's no way to keep the sessions I'm still using and let the ones I've archived expire.
Since the VS Code extension now archives inactive sessions automatically ("Archive inactive sessions", default 14 days), archiving is a natural sign that a session is done. But with the defaults, an active session I just haven't opened in a month gets deleted along with the ones I deliberately archived.
The only workaround is to set cleanupPeriodDays very high and delete archived sessions by hand. A script can't easily do that because the archived state isn't exposed in a documented way.
Proposed solution
Add a separate retention setting for archived sessions, for example:
{
"cleanupPeriodDays": 36500,
"archivedCleanupPeriodDays": 30
}
archivedCleanupPeriodDaysapplies only to archived sessions.cleanupPeriodDayskeeps working as it does now.- If
archivedCleanupPeriodDaysisn't set, behavior is unchanged.
Another option is an "onlyArchived"-style flag that limits cleanupPeriodDays to archived sessions.
Why it's useful
- You can keep long-running or reference sessions indefinitely without your disk filling up with old ones.
- It fits with the auto-archive feature: archiving becomes "mark for cleanup," and active work is safe.
Related
#62476, #59248 and #82084 cover the 30-day deletion in general. This asks specifically for archived and active sessions to be retained differently.
Environment
- Claude Code VS Code extension 2.1.300 (latest at time of writing)
- Windows 11