claude.json repeatedly corrupted when running multiple sessions simultaneously
Description
When running multiple Claude Code sessions simultaneously (e.g., multiple terminal tabs with separate conversations), the user-level config file ~/.claude/claude.json gets repeatedly corrupted. Every tool call triggers a warning like:
⚠ Your config file (~/.claude/claude.json) was corrupted. A backup has been saved and a fresh config created.
This happens across all running sessions and repeats on nearly every tool call.
Steps to Reproduce
- Open 2+ Claude Code sessions in separate terminals
- Use both sessions actively (run tool calls)
- Observe repeated corruption warnings in all sessions
Environment
- Claude Code version: 2.1.62
- OS: Windows 11 Pro 10.0.26220
- Shell: bash (Git Bash)
Observed Behavior
claude.jsongets corrupted repeatedly during normal use with multiple sessions- Claude Code detects corruption, backs up the file, and recreates it — but it gets corrupted again shortly after
- Manually writing
{}to the file fixes it temporarily, but corruption recurs - The backups directory is often empty (file may have been deleted rather than written with invalid JSON)
Expected Behavior
Multiple concurrent Claude Code sessions should safely share the config file without corruption. File writes should use atomic operations (write to temp file + rename) or file locking to prevent concurrent write conflicts.
Notes
The Feb 21, 2026 release fixed a similar concurrency issue: "Fixed MCP OAuth token refresh race condition when running multiple Claude Code instances simultaneously." This appears to be the same class of bug affecting claude.json writes.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗