EBUSY: resource busy or locked when running multiple Claude instances concurrently

Resolved 💬 3 comments Opened Jan 22, 2026 by Git-Faisal Closed Jan 26, 2026

Description

Running multiple Claude Code instances concurrently causes crashes due to file lock conflicts on the shared .claude.json config file.

Error Message

ERROR  EBUSY: resource busy or locked, open 'C:\Users\<user>\.claude.json'

    at writeFileSync (unknown)
    at XC (B:/~BUN/root/claude.exe:4537:1226)
    at _mI (B:/~BUN/root/claude.exe:4537:4213)
    at fA (B:/~BUN/root/claude.exe:4537:2868)

This error originated either by throwing inside of an async function without a catch block, 
or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: EBUSY: resource busy or locked, open 'C:\Users\<user>\.claude.json'

Environment

  • OS: Windows 11
  • Claude Code version: Latest (as of Jan 2025)
  • User folder location: OneDrive synced directory

Steps to Reproduce

  1. Open 4 separate terminal windows
  2. Run claude --dangerously-skip-permissions in each
  3. Give each agent a task that runs continuously
  4. Within 5-15 minutes, 1-2 agents crash with EBUSY error

Expected Behavior

Multiple Claude instances should be able to run concurrently without crashing due to config file access.

Possible Causes

  1. Multiple instances attempting writeFileSync to .claude.json simultaneously
  2. OneDrive sync adding additional file locks
  3. No file locking/retry mechanism for concurrent access

Suggested Fixes

  1. Use atomic file writes with temp file + rename
  2. Add retry logic with exponential backoff for EBUSY errors
  3. Use per-instance config files or instance-specific locks
  4. Consider using a lock file mechanism before writes

Workarounds

  • Limit to 2 concurrent agents (reduces collision frequency)
  • Move project to non-OneDrive directory
  • Manually restart crashed agents and reset orphaned state

View original on GitHub ↗

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