[BUG] .claude.json and backup files disappearing without user action — twice in 48 hours
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?
On two occasions within 48 hours (April 23–24, 2026), the file C:\Users\teres\.claude\.claude.json disappeared, causing complete loss of session context.
No user action caused the deletions.
Additionally, a specific backup file (C:\Users\teres\.claude\backups\.claude.json.backup.1777050649898, timestamped April 23) was visible in the backups
folder, was not deleted by the user, and disappeared within minutes of being identified — before it could be used to restore the session.
The pruning explanation doesn't hold: older backup files (dating to April 7) remain untouched while a recent file was deleted. This is inconsistent with
any age-based pruning logic.
Environment:
- Windows 11 Pro 10.0.26200
- Claude Code version: 2.1.119
- No antivirus, sync tools (OneDrive/Dropbox), or backup software active on the affected directory
Impact: Each deletion requires manual context reconstruction from CLAUDE.md, causing significant disruption to active research work.
Request: Investigate what process is deleting these files and add protection against unintended deletion of .claude.json and its backups.
What Should Happen?
.claude.json should not disappear and, if it does, the backup file should not suddenly disappear. See "Impact" above.
Error Messages/Logs
Steps to Reproduce
- work with Claude code.
- finish for the day, type /exit
- type claude --continue
- no session history! Look for .claude.json but non-existent
- find history file, try to copy to .claude.json, history file disappears.
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Claude Sonnet 4.6 has been behaving oddly for about 5 days.
Claude Code Version
Claude code v2.1.120
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
<img width="1614" height="173" alt="Image" src="https://github.com/user-attachments/assets/23a3ebbe-849d-4702-89e3-3b3c6d2fb6cc" />
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗