[BUG] Default cleanupPeriodDays silently deleted 58 of 69 session transcripts; sidebar shows ghost entries with "Session not found on disk"
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Environment
- Claude Code desktop app on macOS (Apple Silicon)
- Max plan, desktop-app-only usage (no CLI installed until today)
- Transcripts:
~/.claude/projects/<project>/<uuid>.jsonl - Sidebar metadata:
~/Library/Application Support/Claude/claude-code-sessions/<uuid>/<uuid>/local_*.json
Summary
The default cleanupPeriodDays: 30 permanently deleted the transcript .jsonl files of 58 of my 69 sessions (spanning 2026-03-28 to 2026-07-05) based on file mtime, with no notification, no opt-in, and no exposure of the setting anywhere in the desktop UI. The sidebar metadata was left behind, so all 58 sessions continued to be listed as available; clicking any of them shows "Session not found on disk" with no explanation or recovery option.
Verification performed
- Enumerated all 69
local_*.jsonsidebar records and cross-checked eachcliSessionIdagainst the.jsonlfiles actually present under~/.claude/projects/: 11 transcripts exist, 58 are gone. ~/.claude/.last-cleanupconfirms the cleanup routine is active (last run 2026-08-14T16:25Z).- The survival pattern matches mtime-based deletion exactly: every surviving transcript was modified within the last ~30 days (sessions I happened to reopen recently survived regardless of creation date; untouched ones were swept regardless of importance).
- Some deleted sessions' sidebar records still carry a
cliSessionIdpointing at a nonexistent file; others are flaggedtranscriptUnavailable— so the ghost-entry state is inconsistent as well.
What Should Happen?
Session transcripts persist unless the user opts into cleanup; or, at minimum: prominent disclosure of the retention window, a warning before deletion, removal of sidebar entries whose transcripts are deleted, and an export/archive affordance.
Error Messages/Logs
Session not found on disk
Send a message to start fresh in this directory.
Steps to Reproduce
- Use the Claude Code desktop app normally for 30+ days without touching older sessions.
- Allow the default
cleanupPeriodDays: 30to remain unset/default. - Click any sidebar session older than ~30 days (by last modification).
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
CLI: 2.1.232 — but issue observed in desktop app version 1.30096.1
Platform
Other
Operating System
macOS
Terminal/Shell
Other
Additional Information
Impact
Months of professional work history permanently lost with no warning (I am a university professor; these sessions covered a full semester of course development). The only reason the damage was contained is that my workflow wrote session outcomes to status files in the repo — the product itself provided no protection.
Requests
- Change the default to no cleanup, or make it opt-in with clear disclosure in the desktop UI.
- When cleanup does run, remove or visibly mark the corresponding sidebar entries instead of leaving ghosts.
- Add a pre-deletion warning and/or an export option.
- Proactively notify desktop users of the current behavior before more data is lost.
Additional context
- Issue observed entirely in the desktop app (entrypoint: claude-desktop); the CLI was only installed today for diagnostics, so Terminal/Shell above is not really applicable.
- Full session ledger available: 69 sidebar records enumerated, 58 with missing transcripts, survival pattern exactly matching mtime-based 30-day cleanup.
- Related issues: #62959, #61608, #63082. This report adds a fully quantified dataset (69 sessions, exact survivor/loss split, .last-cleanup timestamp).
- A support ticket has also been filed via support.claude.com (can cross-reference the ticket number on request).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗