[BUG] EOF error, corrupted json file.

Resolved 💬 3 comments Opened Feb 18, 2026 by fritz99-lang Closed Feb 26, 2026

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?

  • Windows 11
  • "Unexpected EOF" corruption on .claude.json
  • Backup timestamps show writes ~45ms apart (race condition)
  • Happens across all sessions if more than one open at a time. Can make reading messages difficult.

What Should Happen?

Expected behavior: Writing to .claude.json should be atomic — the file should never be left in a partially-written/truncated state. The config file should be written to a temporary file first, then renamed
into place (atomic rename), so that even if the process crashes or multiple writes overlap, the file is always valid JSON. The current behavior corrupts the file with a truncated write, requiring
auto-recovery from a backup on every subsequent startup.

Error Messages/Logs

Claude configuration file at C:\Users\tritl\.claude.json is corrupted: JSON Parse error: Unexpected EOF
  The corrupted file has been backed up to: C:\Users\tritl\.claude.json.corrupted.1771454062458
  A  ackup file exists at: C:\Users\tritl\.claude.json.backup.1771454062407
  You can manually restore it by running: cp "C:\Users\tritl\.claude.json.backup.1771454062407" "C:\Users\tritl\.claude.json"

Steps to Reproduce

Steps to reproduce:

  1. Use Claude Code on Windows 11 over multiple sessions
  2. The corruption occurs intermittently — not on every launch, but repeatedly over time
  3. The error appears at session startup: Claude configuration file at C:\Users\<user>\.claude.json is corrupted: JSON Parse error: Unexpected EOF
  4. Backup file timestamps are consistently ~45ms apart, suggesting a race condition with near-simultaneous writes

Note: I have not been able to identify a reliable trigger. It happens across different project directories and doesn't correlate with any specific action. It may be more likely when closing/opening sessions
in quick succession.

Claude Model

Opus

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.47

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Additional context:

  • OS: Windows 11 Home 10.0.26200
  • Install method: Native
  • Claude Code version: 2.1.47 (also occurred on prior versions)
  • Shell: Git Bash
  • .claude.json is located in the home directory (C:\Users\<user>), not synced by OneDrive
  • The file is ~16KB with 12 project entries — not unusually large
  • Auto-recovery works correctly every time — no data is permanently lost
  • The issue has persisted across multiple Claude Code versions and updates
  • No corrupted backup files remain after recovery, only timestamped .backup files

View original on GitHub ↗

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