[BUG] Windows: Trust dialog stuck — Enter key does nothing due to mkdirSync EEXIST error

Resolved 💬 8 comments Opened Mar 5, 2026 by peregori Closed Apr 6, 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?

Bug Description

On Windows 11, the workspace trust dialog appears but pressing Enter does nothing. The dialog gets stuck indefinitely, preventing th launch of interactive sessions in any new project directory.

Root Cause

The config save function in cli.js calls mkdirSync(dirname(configPath)) without {recursive: true}. The config file is ~/.claude.json, so dirname resolves to C:\Users\<username> — which already exists. mkdirSync throws EEXIST, the trust dialog answer can't be saved, and the dialog loops.

From the debug log:

Stack trace:

at mkdirSync (unknown)
at mkdirSync (B:/~BUN/root/src/entrypoints/cli.js:12:3048)
at d38 (B:/~BUN/root/src/entrypoints/cli.js:6483:5856)
at IA (B:/~BUN/root/src/entrypoints/cli.js:6483:4432)

Both d38() and B38() in cli.js call mkdirSync on the config parent directory without EEXIST handling (unlike the backup directory code which does catch it).

What Should Happen?

Change mkdirSync(L) to mkdirSync(L, { recursive: true }) in both d38 and B38 functions, or wrap with try/catch for EEXIST like the backup code already does.

Workaround

Manually add trust entries to ~/.claude.json under projects.<path>.hasTrustDialogAccepted: true for each project directory, using both forward-slash and backslash path variants.

Environment

  • Windows 11 Enterprise 10.0.22631
  • Claude Code v2.1.51 (native install, org-managed)
  • Terminal: Windows Terminal (cmd)
  • Bun runtime (standalone binary)

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Install Claude Code on Windows 11 (native install via org-managed deployment)
  2. Open Windows Terminal (cmd or PowerShell)
  3. Navigate to any project directory that has NOT been previously trusted:

cd C:\Users<username>\Documents<any-new-project>

  1. Run claude (interactive mode)
  2. The workspace trust dialog appears:

Accessing workspace:
C:\Users<username>\Documents<project>
❯ 1. Yes, I trust this folder ✔

  1. No, exit

Enter to confirm · Esc to cancel

  1. Press Enter — nothing happens. The dialog stays. Cannot proceed.

Expected Behavior

Pressing Enter should accept the trust selection, save the config, and launch the interactive session.

Actual Behavior

Enter does nothing. Debug log (~/.claude/debug/*.txt) shows repeated errors:

[ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users<username>'

The trust dialog answer cannot be persisted, so the dialog loops forever.

Additional Context

  • The -p (print) flag skips the trust dialog successfully, confirming it's specific to the interactive trust prompt save path
  • Directories that already have hasTrustDialogAccepted: true in ~/.claude.json work fine
  • The workaround is manually adding trust entries to ~/.claude.json
  • The bug is in the d38() and B38() functions in cli.js which call mkdirSync(dirname(configPath)) without { recursive: true } — when configPath is ~/.claude.json, dirname is the home directory which already exists

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

v2.1.51 (native install, org-managed)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

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