[Bug] ~/.claude.json corruption on Windows from concurrent writes causing data loss and trust reset
Bug Description
On Windows, ~/.claude.json keeps getting reset to a near-empty file (84-760 bytes, down from about 54 KB) several times a day. That wipes projects[...].hasTrustDialogAccepted plus oauthAccount, machineID and caches, so scheduled tasks fail with "Routine ... was skipped. The folder is not trusted" or "could not start", and every session asks "Trust this workspace?" again; re-accepting lasts about 20-30 minutes. It also drops hasCompletedOnboarding (true in every saved copy until 10-04 08:30, missing in every copy since 08:45), so the claude CLI shows the welcome and sign-in screens again. Failed saves leave ~/.claude.json.tmp.<pid>.<hash> files: one every ~3 weeks until early September (07-27, 08-16, 09-07), then almost daily from 2026-09-30, the day after bundled Claude Code 2.1.284 installed (now 2.1.286), with 5 on 10-04 alone. The pluginUsage count for context-mode in the same file went 1,887 (09-07) -> 78,879 (09-30) -> 92,866 (10-04) with the plugin unchanged, so the file is rewritten thousands of times a day while about 6 Claude Code processes run (desktop sessions plus a scheduled task every 4-6 minutes). Expected: a failed or overlapping save never resets the file or loses folder trust; usage counters batched or kept out of the file that holds trust. Windows 11 Pro 10.0.22631, Claude desktop app, plugins context-mode 1.0.169 and caveman. Sent from the separate npm CLI (2.1.232); the affected sessions run the desktop app's bundled 2.1.286.
Environment Info
- Platform: win32
- Terminal: null
- Version: 2.1.232
- Feedback ID: 9a8995fa-89c2-4056-92ed-1b214ea7346c
Errors
[]