[BUG] historical sessions deleted without any notification or alert.

Resolved 💬 1 comment Opened May 23, 2026 by pjpkgit Closed Jun 23, 2026

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?

historical sessions deleted without any notification or alert. This has resulted with me losing all the history on the specific sessions, which had a lot of conversational and working history, all being lost.

What Should Happen?

Need option for configurable session retention policy on claude-code, with the actual backup/retention of the session path configurable and not hard coded into existing ~/.claude/ folder

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce: Historical session transcripts appear empty
Environment:

Claude Code v2.1.146
Claude Desktop (entrypoint: claude-desktop)
Windows 11 Pro 10.0.26100
Working directory: XXX\XXX\claude
Steps:

Open Claude Desktop and start multiple Claude Code sessions over several days, having substantive conversations in each
Close the sessions normally (don't need to do anything special)
Wait for the automatic cleanup to run (observed cleanup timestamp: 2026-05-23T06:46:58Z, stored in ~/.claude/.last-cleanup)
Reopen Claude Desktop and navigate to the session history list
Click on any historical session
Expected behavior:

Historical sessions should display their full conversation transcript when opened
Actual behavior:

Session list shows the sessions exist (they appear in the sidebar/history)
Clicking into a historical session shows an empty thread — no messages
~/.claude/sessions/ contains only small metadata JSON files (PID, sessionId, cwd, timestamps) with no transcript content
Only 3 session files remain on disk despite many more sessions in history
Affected sessions span multiple working directories (e.g., XYZ, XXX\XXX\claude)
Diagnostic data:

Session files found: 3 (724 bytes total)
Each file is ~215-261 bytes containing only metadata, e.g.:
{"pid":14812,"sessionId":"ee3a950b-...","cwd":"...","startedAt":1779518213108,"version":"2.1.146","kind":"interactive","entrypoint":"claude-desktop"}
No transcript data in ~/.claude/backups/, ~/.claude/cache/, or ~/.claude/projects/
.last-cleanup shows cleanup ran the same morning the issue was noticed
Impact:

Unable to reference prior conversation context, decisions, or code changes discussed in past sessions
No way to restore purged transcripts

Claude Model

Sonnet (default)

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

v2.1.146

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

_No response_

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗