claude-code - 💡(How to fix) Fix [BUG] Titel: "EEXIST error on every API call on Windows - mkdir .claude fails"

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

API Error: EEXIST: file already exists, mkdir 'C:\Users\wolfi.claude' Remote Control failed to connect: EEXIST: file already exists, mkdir 'C:\Users\wolfi.claude'

Root Cause

The .claude directory already exists and is fully populated. The error occurs because mkdir is called without the { recursive: true } flag before every API call.

Code Example

API Error: EEXIST: file already exists, mkdir 'C:\Users\wolfi\.claude'
Remote Control failed to connect: EEXIST: file already exists, mkdir 'C:\Users\wolfi\.claude'
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Every API call fails with "API Error: EEXIST: file already exists, mkdir 'C:\Users\wolfi.claude'" on Windows. Claude Code is completely unusable - no prompts work, no slash commands work.

Steps to reproduce:

  1. Install Claude Code on Windows 10/11
  2. Open Claude Code in any directory
  3. Type any prompt and press Enter
  4. Result: API Error: EEXIST: file already exists, mkdir 'C:\Users\wolfi.claude'

The .claude directory already exists and is fully populated. The error occurs because mkdir is called without the { recursive: true } flag before every API call.

Also affected: Remote Control fails to connect with same EEXIST error on startup.

Environment:

  • Claude Code v2.1.114
  • Windows 10/11
  • Installation: native .exe at C:\Users\wolfi.local\bin\claude.exe
  • npm installation also present at AppData\Roaming\npm

What Should Happen?

Claude Code should handle an already-existing .claude directory gracefully. The mkdir call should use { recursive: true } so it doesn't throw EEXIST when the directory already exists. All prompts and slash commands should work normally.

Error Messages/Logs

API Error: EEXIST: file already exists, mkdir 'C:\Users\wolfi\.claude'
Remote Control failed to connect: EEXIST: file already exists, mkdir 'C:\Users\wolfi\.claude'

Steps to Reproduce

  1. Install Claude Code on Windows 10/11 (v2.1.114)
  2. Ensure C:\Users<username>.claude directory already exists
  3. Open any terminal and run: claude
  4. Type any prompt (e.g. "hello") and press Enter
  5. Result: API Error: EEXIST: file already exists, mkdir 'C:\Users<username>.claude'

Note: The error occurs on EVERY prompt. Claude Code is completely unusable. The .claude directory exists and is populated - mkdir fails because { recursive: true } is missing.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

No response

Claude Code Version

2.1.114 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Two claude installations exist on this system:

  • C:\Users\wolfi.local\bin\claude.exe (native, 246MB, takes PATH priority)
  • C:\Users\wolfi\AppData\Roaming\npm\claude (npm wrapper)

The .claude directory at C:\Users\wolfi.claude is fully populated with hooks, sessions, skills etc.

Attempted fixes that did NOT work:

  • npm install -g @anthropic-ai/claude-code@latest --force
  • Removing SessionStart hooks from settings.json
  • Renaming the native .exe to force npm version

The bug appears to be in the native binary itself - mkdir is called without { recursive: true } before every API call, causing EEXIST when the directory already exists.

extent analysis

TL;DR

The most likely fix is to modify the mkdir call in the Claude Code native binary to include the { recursive: true } flag to handle existing directories gracefully.

Guidance

  • Verify that the issue is indeed caused by the missing { recursive: true } flag in the mkdir call by checking the native binary's code or debugging logs.
  • Consider downgrading to a previous version of Claude Code that worked correctly, if possible, as a temporary workaround.
  • If the native binary is open-source, attempt to modify the mkdir call to include the { recursive: true } flag and rebuild the binary.
  • If not, contact the developers or maintainers of Claude Code to report the issue and request a fix.

Example

No code snippet is provided as the issue is related to a native binary and not a specific code snippet.

Notes

The issue appears to be specific to the native binary of Claude Code on Windows, and the presence of an existing .claude directory. The fact that the issue is a regression and worked in a previous version suggests that the fix may involve reverting a recent change or modifying the mkdir call.

Recommendation

Apply a workaround by downgrading to a previous version of Claude Code, if possible, until a fixed version is released. This is because the issue is caused by a specific bug in the native binary and downgrading may provide a temporary solution.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [BUG] Titel: "EEXIST error on every API call on Windows - mkdir .claude fails"