claude.json repeatedly corrupted when running multiple sessions simultaneously

Resolved 💬 3 comments Opened Feb 27, 2026 by shanik1986 Closed Mar 3, 2026

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

  1. Open 2+ Claude Code sessions in separate terminals
  2. Use both sessions actively (run tool calls)
  3. 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.json gets 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.

View original on GitHub ↗

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