Desktop session transcripts are kept forever after the session is gone from the app
Hi team,
The retention sweep never deletes transcripts written by Claude Desktop, even after the app no longer has a record of the session. Those transcripts are invisible in the app, and nothing will ever clean them up.
What I see
~/.claude/projects/holds 3,101 transcripts last written Aug 10 to 13, 2026, over 60 days ago.cleanupPeriodDaysis unset, so the default 30 applies.- Every one of them has
"entrypoint": "claude-desktop". - I checked 200 of them against the app's records in
~/Library/Application Support/Claude/claude-code-sessions/. None has a record. The app holds 76 records in total. - The sweep is running (
~/.claude/.last-cleanupis from today) and does clear CLI transcripts older than 30 days.
So the exemption is keyed on the transcript's entrypoint, not on whether the session still exists in the app. This also answers the question in #91464: the 2.1.248 changelog says Desktop sessions are kept "while they are in the app", but they're kept after they leave it too.
Why it matters
Once a session is gone from the app, its transcript has no owner. I can't see it in Desktop and it never ages out. Here it's 3,101 files and 157 MB, and it only grows.
Suggested fix
Apply the Desktop exemption only while the app still holds a record for the session. Once the record is gone, the transcript goes back to the normal cleanupPeriodDays sweep. desktopSessionCleanupPeriodDays works as a manual cap, but nobody knows to set it until they go digging in ~/.claude like I did :)
Environment
Claude Code 2.1.300, Claude Desktop (Code tab), macOS 27.0.1
Thanks!