[BUG] Session list shows sessions whose transcript file no longer exists on disk → "session not found" on click
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?
Confirming this is still happening (Claude Code on Windows 11 Pro, July 2026). Same symptom: session shows in the sidebar with valid metadata (id, title, model, dates, not archived), but the transcript .jsonl in ~/.claude/projects/<project>/ is gone, and clicking it gives "session not found." Restarting the app doesn't fix it.
Confirmed this isn't a local disk/filesystem problem before assuming it was the 30-day cleanup: both physical disks report HealthStatus: Healthy, the volume is Healthy with plenty of free space, no I/O errors in the Windows System event log, and the file isn't relocated elsewhere on disk. Every session older than ~6 weeks has the same issue — only recent ones still have a matching file.
Would really appreciate this getting reopened — losing chat history silently with no warning (and a UI that still implies the session is openable) is a rough failure mode, even if the underlying retention behavior is by design.
What Should Happen?
If a session's transcript is removed by the retention policy, the sidebar/session index should be updated in the same pass — either the entry is removed entirely, or it's kept but clearly marked as expired/unavailable (e.g. greyed out with an "expired" label) instead of looking identical to an openable session. Clicking it should never end in a generic "session not found" for something the UI itself listed as valid.
Ideally, before the 30-day cleanup deletes a transcript, the user gets some warning or has been told about cleanupPeriodDays and can opt to extend/disable it — silent, permanent deletion of chat history with zero indication beforehand is the core issue, not just the stale sidebar entry.
Error Messages/Logs
Steps to Reproduce
Steps to reproduce:
- Use Claude Code Desktop normally over a period of 6+ weeks, accumulating multiple sessions in a project directory.
- Let a session sit untouched past the default
cleanupPeriodDays(30 days) retention window. - Open the app and look at the session list for that project — the old session is still listed with valid-looking metadata (title, model, created/last-activity dates), not marked archived or expired.
- Click on that session to resume/reopen it.
- Observe: app reports "session not found," even immediately after a fresh restart.
(Verified the transcript file itself — ~/.claude/projects/<project>/<session-id>.jsonl — is genuinely missing from disk, not just failing to load; ruled out local disk/filesystem issues, see below.)
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude 1.22209.0 (77c938) 2026-07-16T05:39:45.000Z
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗