[BUG] Claude Code's config-save lock mechanism uses mkdirSync without the {recursive: true} flag on Windows.

Resolved 💬 4 comments Opened Mar 11, 2026 by damienchan Closed Apr 9, 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?

Root Cause: Claude Code's config-save lock mechanism uses mkdirSync without the {recursive: true} flag on Windows.

When you press Enter on the trust prompt, Claude Code tries to save your trust decision by:

Computing a lock path based on your home directory (C:\Users\DChan)
Calling mkdirSync('C:\Users\DChan') to ensure the directory exists before writing
On Windows, mkdirSync on a path that already exists throws EEXIST. On macOS/Linux this would also throw, but the Bun runtime (used in the compiled Claude binary) appears to handle this differently across platforms.

The result is an infinite retry loop:

[ERROR] Failed to save config with lock: EEXIST: file already exists, mkdir 'C:\Users\DChan'
[ERROR] Failed to save config with lock: EEXIST: file already exists, mkdir 'C:\Users\DChan'
[ERROR] Failed to save config with lock: EEXIST: file already exists, mkdir 'C:\Users\DChan'
... (forever)
This retry loop starves the UI event loop, so the trust dialog freezes — it shows the checkmark but never advances.

Why it worked before (March 4–5): A remote service called "Grove" was responding and pre-loading your trust/config state, which skipped the dialog entirely. Grove is no longer responding for your session, so the broken dialog code path is always hit now.

The fix (in Claude Code's source) is one character: mkdirSync(path, { recursive: true }) — but that requires Anthropic to patch it. This should be reported at github.com/anthropics/claude-code/issues.

What Should Happen?

The fix (in Claude Code's source) is one character: mkdirSync(path, { recursive: true }) — but that requires Anthropic to patch it. This should be reported at github.com/anthropics/claude-code/issues.

Error Messages/Logs

Steps to Reproduce

  1. Type Claude
  2. This question is shown

Quick safety check: Is this a project you created or one you trust? (Like your own code, a well-known open source
project, or work from your team). If not, take a moment to review what's in this folder first.
Claude Code'll be able to read, edit, and execute files here.
Security guide
> 1. Yes, I trust this folder √

  1. No, exit

Enter to confirm · Esc to cancel

  1. Select Option 1 and Press Enter.

Result: Nothing Happens

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.70+

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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