[BUG] VSCode Extension crashes on Windows: EEXIST error trying to mkdir user home directory
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?
When I invoke any skill (e.g. /update-docs) in the Claude Code VSCode extension on Windows,
the Claude process crashes immediately with exit code 1.
The logs show repeated errors trying to mkdir the user's home directory, which already exists:
Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
Stack trace:
Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
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)
This also cascades into OTEL metrics failure:
PeriodicExportingMetricReader: metrics export failed
(error Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes')
The process then exits with code 1:
Error from Claude: Error: Claude Code process exited with code 1
Environment:
- OS: Windows 11 Pro 10.0.26200
- Claude Code version: 2.1.69 (Claude Code)
- VSCode version: 1.110.0 (user setup)
Steps to Reproduce:
- Open VSCode on Windows with Claude Code extension installed
- Start a conversation
- Invoke any skill (e.g.
/update-docs) - Claude process crashes
Expected: The skill should execute normally. mkdirSync should use { recursive: true }
to avoid failing on existing directories.
What Should Happen?
The skill should execute normally without crashing. The mkdirSync call should handle
the case where the directory already exists, either by using { recursive: true } or
by catching the EEXIST error gracefully.
Error Messages/Logs
2026-03-05 13:55:54.228 [info] Received message from webview: {"type":"request","requestId":"no3wrp38n1","request":{"type":"rename_tab","title":"/update-docs","hasPendingPermissions":false,"hasUnseenCompletion":false}}
2026-03-05 13:55:54.370 [info] Received message from webview: {"type":"io_message","channelId":"i7wm919z6rs","message":{"type":"user","uuid":"9972f84f-9d5b-4995-b8e4-35b4f2a1c68c","session_id":"","parent_tool_use_id":null,"message":{"role":"user","content":[{"type":"text","text":"/update-docs"}]}},"done":false}
2026-03-05 13:55:54.484 [info] From claude: 2026-03-05T16:55:54.484Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
2026-03-05T16:55:54.486Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
2026-03-05T16:55:54.488Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
2026-03-05 13:55:54.586 [info] From claude: 2026-03-05T16:55:54.495Z [DEBUG] LSP server manager shut down successfully
2026-03-05 13:55:54.715 [info] From claude: 2026-03-05T16:55:54.713Z [DEBUG] Metrics opt-out API response: enabled=true, vcsLinking=false
2026-03-05T16:55:54.713Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
2026-03-05T16:55:54.714Z [DEBUG] BigQuery metrics export failed: EEXIST: file already exists, mkdir 'C:\Users\raphael.nunes'
2026-03-05T16:55:54.714Z [ERROR] "Error: Error: EEXIST: file already exists, mkdir 'C:\\Users\\raphael.nunes'\n at mkdirSync (unknown)\n at mkdirSync (B:/~BUN/root/src/entrypoints/cli.js:12:3048)\n at d38 (B:/~BUN/root/src/entrypoints/cli.js:6483:5856)\n at IA (B:/~BUN/root/src/entrypoints/cli.js:6483:4432)\n at EbD (B:/~BUN/root/src/entrypoints/cli.js:2420:26565)\n at processTicksAndRejections (native:7:39)"
2026-03-05T16:55:54.715Z [ERROR] "Error: Error: {\"message\":\"PeriodicExportingMetricReader: metrics export failed (error Error: EEXIST: file already exists, mkdir 'C:\\\\Users\\\\raphael.nunes')\",\"originalLine\":\"2380\",\"originalColumn\":\"57807\",\"line\":\"2380\",\"column\":\"57807\",\"sourceURL\":\"B:/~BUN/root/src/entrypoints/cli.js\",\"stack\":\"Error: PeriodicExportingMetricReader: metrics export failed (error Error: EEXIST: file already exists, mkdir 'C:\\\\Users\\\\raphael.nunes')\\n at _doRun (B:/~BUN/root/src/entrypoints/cli.js:2380:57807)\\n at processTicksAndRejections (native:7:39)\",\"name\":\"Error\"}\n at error (B:/~BUN/root/src/entrypoints/cli.js:2420:25030)\n at <anonymous> (B:/~BUN/root/src/entrypoints/cli.js:118:79642)\n at bj1 (B:/~BUN/root/src/entrypoints/cli.js:118:80186)\n at _runOnce (B:/~BUN/root/src/entrypoints/cli.js:2380:57272)\n at async onForceFlush (B:/~BUN/root/src/entrypoints/cli.js:2380:58069)\n at async onShutdown (B:/~BUN/root/src/entrypoints/cli.js:2380:58196)\n at async shutdown (B:/~BUN/root/src/entrypoints/cli.js:2380:55645)\n at async shutdown (B:/~BUN/root/src/entrypoints/cli.js:2392:8645)\n at async shutdown (B:/~BUN/root/src/entrypoints/cli.js:2392:12921)\n at processTicksAndRejections (native:7:39)"
2026-03-05T16:55:54.715Z [ERROR] [3P telemetry] OTEL diag error: {"message":"PeriodicExportingMetricReader: metrics export failed (error Error: EEXIST: file already exists, mkdir 'C:\\Users\\raphael.nunes')","originalLine":"2380","originalColumn":"57807","line":"2380","column":"57807","sourceURL":"B:/~BUN/root/src/entrypoints/cli.js","stack":"Error: PeriodicExportingMetricReader: metrics export failed (error Error: EEXIST: file already exists, mkdir 'C:\\Users\\raphael.nunes')\n at _doRun (B:/~BUN/root/src/entrypoints/cli.js:2380:57807)\n at processTicksAndRejections (native:7:39)","name":"Error"}
2026-03-05T16:55:54.715Z [DEBUG] BigQuery metrics exporter flush complete
2026-03-05T16:55:54.715Z [DEBUG] BigQuery metrics exporter flush complete
2026-03-05T16:55:54.715Z [DEBUG] BigQuery metrics exporter shutdown complete
2026-03-05T16:55:54.715Z [DEBUG] detectFileEncoding failed for expected reason: ENOENT
2026-03-05T16:55:54.715Z [DEBUG] Broken symlink or missing file encountered for settings.json at path: C:\ProgramData\ClaudeCode\managed-settings.json
2026-03-05T16:55:54.715Z [DEBUG] detectFileEncoding failed for expected reason: ENOENT
2026-03-05T16:55:54.715Z [DEBUG] Broken symlink or missing file encountered for settings.json at path: C:\ProgramData\ClaudeCode\managed-settings.json
2026-03-05T16:55:54.715Z [DEBUG] Getting matching hook commands for SessionEnd with query: other
2026-03-05T16:55:54.715Z [DEBUG] Found 0 hook matchers in settings
2026-03-05T16:55:54.715Z [DEBUG] Matched 0 unique hooks for query "other" (0 before deduplication)
2026-03-05 13:55:55.294 [info] Closing Claude on channel: i7wm919z6rs
2026-03-05 13:55:55.294 [error] Error from Claude (on channel i7wm919z6rs): Error: Claude Code process exited with code 1
Steps to Reproduce
- Install Claude Code VSCode extension on Windows 11
- Open any project in VSCode
- Start a Claude Code conversation
- Type
/update-docs(or any other skill command) - Claude process crashes with exit code 1
- Check the output log (Anthropic.claude-code.Claude VSCode) — repeated EEXIST errors appear
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.69 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗