[BUG] Entire ~/.claude deleted while client idle (2.1.207, Windows)

Resolved 💬 2 comments Opened Jul 12, 2026 by clarity-m Closed Jul 15, 2026

[BUG] Entire ~/.claude deleted while client idle (2.1.207, Windows) — experienced as spontaneous logout

Environment

  • Claude Code 2.1.207, native install at ~/.local/bin/claude (auto-updated on the latest channel at 00:09 local, same day)
  • Windows 11, Git Bash (MINGW64) as the session shell
  • All timestamps below are local (UTC−4), 2026-07-11

Summary

While all Claude Code sessions were idle, the entire ~/.claude directory was deleted: .credentials.json, settings.json (including hooks), global CLAUDE.md, all projects/ transcripts, and file-history/. The sibling file ~/.claude.json was untouched, so the deletion was surgical to the directory itself. The first user-visible symptom was being logged out; the actual event was the config directory disappearing out from under a running client.

Timeline (second precision where available)

| Time | Event |
|---|---|
| 00:09 | Auto-update to 2.1.207 (latest channel) — binary mtime |
| 17:37:10 | Last positive proof ~/.claude intact (git commit + push executed from a repo under ~/.claude/memory by an interactive session) |
| 17:38–17:52 | All sessions idle; no user shell activity touching the path (verified via PSReadLine, Git Bash, and WSL histories) |
| 17:44:53 | Only recorded app activity in the window: an idle client process rewrote ~/.claude.jsoncachedGrowthBookFeaturesAt = 1783806293636. Recovered from ~/.claude/backups/.claude.json.backup.1783807166857, which preserves the pre-relogin file (mtime 17:45) |
| 17:51:59 | NTFS birth time of the current ~/.claude and ~/.claude/ide: a fresh claude launch in another project recreated an empty skeleton and presented a login prompt (that session lasted 14 s with 0 tokens per .claude.json per-project stats) |
| 17:59:26 | /login run inside a long-lived session that had survived in memory; .credentials.json recreated |

Evidence excluding external causes

  • No Recycle Bin entries for the deleted tree (deletion was programmatic, not Explorer)
  • No Windows Defender detections
  • Binary unchanged since 00:09 — no reinstall at wipe time
  • PowerShell, Git Bash, and WSL histories contain no command touching ~/.claude
  • Every Claude session overlapping the window shows 0 tokens / 0 cost in surviving .claude.json stats
  • ~/.claude.json, directly beside the deleted directory, survived intact

Possibly relevant

  • The only app activity inside the deletion window was a GrowthBook feature-flag cache refresh by an idle process (17:44:53)
  • After re-login, new flags appeared in .claude.json: unpinFable5LaunchEffort, unpinOpus48LaunchEffort — i.e., heavy flag churn on latest-channel clients during model-launch week
  • Same user-visible signature as #9581 (all ~/.claude session data lost around a logout/login); precedent for state-directory deletion during native-binary first-run migration in #51234 (~/.claude/skills wiped)

Impact

Credentials, settings (including SessionStart/SessionEnd hooks), global CLAUDE.md, and all session transcripts were lost. Data was recoverable in this case only because the affected user happened to git-sync ~/.claude/memory off-machine minutes before the event.

Reproduction

Unknown — occurred while idle with no user interaction. Suspect an auth-refresh or flag-gated cleanup/migration path in 2.1.207. Redacted copies of the pre- and post-event .claude.json snapshots are available on request.

🤖 Generated with Claude Code

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗