[BUG] API Error: EEXIST: file already exists, mkdir — regression in native builds > 2.1.87 (Windows + Google Drive)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report
- [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:\GDRIVE\CODEFILES\.claude'
Skills load fine on startup (17 skills). The error only occurs on the first API request after startup, not during initialization.
The .claude directory exists and is fully populated — sessions, plugins, cache, hooks, credentials, skills, settings, history, etc.
Environment
- Claude Code v2.1.98 (native auto-update, Windows)
- Windows with Google Drive for Desktop
CLAUDE_CONFIG_DIRon a Google Drive-synced path via NTFS junction point- Node.js 18+
To Reproduce
- Install Claude Code via native auto-update (version 2.1.98 or similar post-2.1.87 build)
- Set
CLAUDE_CONFIG_DIRto a path on a Google Drive for Desktop volume (e.g., via an NTFS junction point) - Launch Claude Code from any working directory
- Send any prompt — API call fails with EEXIST
Workaround
Downgrading to 2.1.87 via npm install -g @anthropic-ai/claude-code@2.1.87 resolves the issue immediately. Same config, same paths, same machine, same Google Drive setup — works perfectly on 2.1.87. Breaks on 2.1.98.
Note: this setup worked flawlessly for two weeks before the auto-update to 2.1.98.
Likely Cause
A mkdir call introduced or changed between 2.1.87 and 2.1.98 that doesn't handle Google Drive for Desktop's virtual filesystem driver correctly. Google Drive for Desktop on Windows uses a user-mode filesystem (not standard NTFS), and fs.mkdirSync with {recursive: true} may not behave identically on this driver.
The error path is always the CLAUDE_CONFIG_DIR root (.claude), not a subdirectory.
Related: /heapdump had a similar EEXIST fix on Windows in a prior release.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗