[BUG] Titel: "EEXIST error on every API call on Windows - mkdir .claude fails"
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?
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:
- Install Claude Code on Windows 10/11
- Open Claude Code in any directory
- Type any prompt and press Enter
- 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
- Install Claude Code on Windows 10/11 (v2.1.114)
- Ensure C:\Users\<username>\.claude directory already exists
- Open any terminal and run: claude
- Type any prompt (e.g. "hello") and press Enter
- 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.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗