Windows: .claude.json falsely detected as corrupted on exit, wiping onboarding state
Description
On Windows 11, .claude.json is consistently flagged as "corrupted" during exit/relaunch cycles, even though the file contains perfectly valid JSON. Claude Code replaces the full config with a near-empty skeleton, wiping onboarding flags and causing the full CLI onboarding to display on every launch.
Version
Claude Code 2.1.59, Windows 11 Pro (10.0.26200), native install
Reproduction
- Launch Claude Code on Windows
- Complete onboarding
- Exit (
/exitor close terminal) - Relaunch immediately
Result: Full onboarding wizard shows again every time.
Root cause evidence
The ~/.claude/backups/ directory shows the cycle clearly:
"Corrupted" file (31 keys, valid JSON):
{
"numStartups": 103,
"hasCompletedOnboarding": true,
"tipsHistory": { "new-user-warmup": 5 },
"firstStartTime": "2026-02-26T16:39:47.160Z",
"userID": "35ef776baa3a...",
...
}
"Backup" replacement (10 keys, skeleton):
{
"tipsHistory": { "new-user-warmup": 0 },
"userID": "9ac64b98bf60...",
...
}
numStartups→ gonehasCompletedOnboarding→ gonenew-user-warmup→ reset to 0firstStartTime→ gone
The userID hash changes between sessions, which may be triggering the false corruption detection.
Key observations
- The "corrupted" files are valid, parseable JSON — confirmed with
JSON.parse() - The
userIDchanges on every startup, suggesting it's regenerated and the mismatch triggers corruption logic - Multiple corrupted backups accumulate rapidly in
~/.claude/backups/(20+ in a single session) - Setting
numStartups,hasCompletedOnboarding, etc. manually does not survive the next exit/relaunch cycle - This appears to be Windows-specific (possibly a file locking or write timing issue)
Expected behavior
Valid .claude.json should not be flagged as corrupted. Onboarding state should persist across sessions.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗