You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Doesn't fix the underlying deletion bug, but if your chats are already gone and you have a Time Machine drive with snapshots from before the loss, you can get them back. Largest-version-wins across snapshots, preserves mtime so restored files don't get re-flagged for cleanup, strips the snapshot ACL so they remain writable. macOS only. (See this issue's comment thread for the Windows side).
What's Wrong?
Local Claude Code chat transcripts (JSONL files under ~/.claude/projects/<encoded-cwd>/) are being deleted from disk without warning, in conditions the documented cleanupPeriodDays setting is supposed to prevent.
I have cleanupPeriodDays: 36500 (~100 years) set in ~/.claude/settings.json. The deletions still happen. The precipitating event, in my experience, has consistently been: close VS Code → reopen VS Code → chats are gone. Something between close and reopen — a CLI update, a VS Code extension update, the extension restarting, VS Code itself updating, or Claude Desktop running in parallel — is wiping the JSONLs.
I am not the only person reporting this. The same pattern shows up across:
These are filed as separate issues but appear to share a root cause: some code path is deleting local chat data without checking, or while ignoring, cleanupPeriodDays.
This has cost me months of chat history on a personal project. I built a recovery tool (macOS + Time Machine): https://github.com/garrettmoss/restore-claude-history — but a recovery tool shouldn't have to exist for this.
What Should Happen?
At minimum, one of:
Honor cleanupPeriodDays. Whatever code path is currently bypassing it should check it.
Warn before deletion. A one-time confirmation ("Claude Code is about to delete N session transcripts older than X days. Continue?") would have prevented every loss in the linked issues.
Surface cleanupPeriodDays in the UI. The setting exists but is undiscoverable. Users hitting this for the first time have no idea the knob is there.
Any one of these would meaningfully reduce data loss. All three would close the gap entirely.
Steps to Reproduce
I cannot reliably reproduce on demand — that's part of the problem. The pattern I and others observe:
Use Claude Code in VS Code over multiple sessions; accumulate .jsonl files under ~/.claude/projects/<encoded-cwd>/.
Set cleanupPeriodDays to a high value in ~/.claude/settings.json (e.g. 36500).
Close VS Code.
Reopen VS Code some time later — minutes to days. (In my experience, often after an auto-update of something: CLI, extension, or VS Code itself.)
Observe: JSONLs are gone from ~/.claude/projects/<encoded-cwd>/. The "Past Conversations" picker is empty or sparse.
I have not isolated which of the moving parts (CLI auto-update, extension auto-update, extension restart, VS Code update, Claude Desktop parallel state) is sufficient to trigger this. The linked issues above suggest it's not unique to my setup.
Is this a regression?
I don't know.
Claude Code Version
2.1.91 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
Worth noting on the regression question: variants of this bug have existed across many Claude Code versions, including before cleanupPeriodDays was introduced. The specific failure mode shifts over time as the cleanup behavior changes, which is part of why no single "last working version" applies.
Important
Recovery tool (macOS + Time Machine): I've published a script that recovers deleted chat JSONLs from macOS Time Machine snapshots — https://github.com/garrettmoss/restore-claude-history
Doesn't fix the underlying deletion bug, but if your chats are already gone and you have a Time Machine drive with snapshots from before the loss, you can get them back. Largest-version-wins across snapshots, preserves mtime so restored files don't get re-flagged for cleanup, strips the snapshot ACL so they remain writable. macOS only. (See this issue's comment thread for the Windows side).
What's Wrong?
Local Claude Code chat transcripts (JSONL files under
~/.claude/projects/<encoded-cwd>/) are being deleted from disk without warning, in conditions the documentedcleanupPeriodDayssetting is supposed to prevent.I have
cleanupPeriodDays: 36500(~100 years) set in~/.claude/settings.json. The deletions still happen. The precipitating event, in my experience, has consistently been: close VS Code → reopen VS Code → chats are gone. Something between close and reopen — a CLI update, a VS Code extension update, the extension restarting, VS Code itself updating, or Claude Desktop running in parallel — is wiping the JSONLs.I am not the only person reporting this. The same pattern shows up across:
cleanupPeriodDays: 99999set, 490 sessions deleted anyway.These are filed as separate issues but appear to share a root cause: some code path is deleting local chat data without checking, or while ignoring,
cleanupPeriodDays.This has cost me months of chat history on a personal project. I built a recovery tool (macOS + Time Machine): https://github.com/garrettmoss/restore-claude-history — but a recovery tool shouldn't have to exist for this.
What Should Happen?
At minimum, one of:
cleanupPeriodDays. Whatever code path is currently bypassing it should check it.cleanupPeriodDaysin the UI. The setting exists but is undiscoverable. Users hitting this for the first time have no idea the knob is there.Any one of these would meaningfully reduce data loss. All three would close the gap entirely.
Steps to Reproduce
I cannot reliably reproduce on demand — that's part of the problem. The pattern I and others observe:
.jsonlfiles under~/.claude/projects/<encoded-cwd>/.cleanupPeriodDaysto a high value in~/.claude/settings.json(e.g.36500).~/.claude/projects/<encoded-cwd>/. The "Past Conversations" picker is empty or sparse.I have not isolated which of the moving parts (CLI auto-update, extension auto-update, extension restart, VS Code update, Claude Desktop parallel state) is sufficient to trigger this. The linked issues above suggest it's not unique to my setup.
Is this a regression?
I don't know.
Claude Code Version
2.1.91 (Claude Code)Platform
Anthropic API
Operating System
macOS
Terminal/Shell
VS Code integrated terminal
Additional Information
cleanupPeriodDayswas introduced. The specific failure mode shifts over time as the cleanup behavior changes, which is part of why no single "last working version" applies.