Windows: .claude.json falsely detected as corrupted on exit, wiping onboarding state

Resolved 💬 8 comments Opened Feb 26, 2026 by michaelhills23 Closed Mar 31, 2026

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

  1. Launch Claude Code on Windows
  2. Complete onboarding
  3. Exit (/exit or close terminal)
  4. 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 → gone
  • hasCompletedOnboarding → gone
  • new-user-warmup → reset to 0
  • firstStartTime → 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 userID changes 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.

View original on GitHub ↗

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