Skip to content

[BUG] EOF error, corrupted json file. #26717

Closed

Description

@fritz99-lang

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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

Activity

  1. github-actions commented on Feb 18, 2026

    @github-actions

    Found 2 possible duplicate issues:

    1. [BUG] Claude Code Configuration File Corruption #2810
    2. claude code corrupts ~/.claude.json on mac while running 5 concurrent sessions #3117

    This issue will be automatically closed as a duplicate in 3 days.

    • If your issue is a duplicate, please close it and 👍 the existing issue instead
    • To prevent auto-closure, add a comment or 👎 this comment

    🤖 Generated with Claude Code

  2. fritz99-lang commented on Feb 18, 2026

    @fritz99-lang
    Author

    Those both deal with corrupt files in claude, but neither of them is exactly what I am experiencing in my opinion.

  3. github-actions commented on Mar 7, 2026

    @github-actions

    This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.

  4. locked as resolved and limited conversation to collaborators on Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions