[BUG] VSCode Extension crashes on Windows: EEXIST error trying to mkdir user home directory

Status Fixed / completed
Reported on v2.1.69
Maintainer reply None cached
Activity 8 comments · opened Mar 5, 2026 · closed Mar 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?

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:

  1. Open VSCode on Windows with Claude Code extension installed
  2. Start a conversation
  3. Invoke any skill (e.g. /update-docs)
  4. 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

  1. Install Claude Code VSCode extension on Windows 11
  2. Open any project in VSCode
  3. Start a Claude Code conversation
  4. Type /update-docs (or any other skill command)
  5. Claude process crashes with exit code 1
  6. 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_

View original on GitHub ↗

8 Comments

jacoblapenna · 5 months ago

Yeah, mine doesn't crash but does require creating massive bash commands to call python to make edits via string replacement in files.

Title: Edit tool fails with EEXIST: file already exists, mkdir when file's parent directory exists

Extension version: anthropic.claude-code@2.1.69

VS Code version: 1.109.5 (x64)

OS: Windows 11 Pro 10.0.26100

Description:

The Edit tool fails with an EEXIST error when attempting to edit an existing file whose parent directory path contains spaces and special characters (commas, apostrophes). The tool appears to be attempting to mkdir the parent directory even though it already exists, rather than simply performing the string replacement.

Steps to reproduce:

Open a project whose path contains spaces or special characters
Read an existing file via the Read tool
Attempt to edit that file via the Edit tool with valid old_string/new_string
Error:

EEXIST: file already exists, mkdir 'REDACTED'
Expected behavior: The file is edited in place with no directory creation attempted.

Actual behavior: The tool attempts to create the parent directory and throws EEXIST because it already exists. The edit is not applied.

Workaround: Fall back to Bash with a Python script to perform the string replacement manually.

Regression: This worked correctly prior to updating to 2.1.69 today (2026-03-05).

ErkanShakir3E · 5 months ago

Problem: Claude Code shows blank screen on Windows.

Root Cause: The standalone claude.exe binary (installed at ~\.local\bin\claude.exe) has a TUI rendering
bug on Windows — the Bun-compiled binary fails with EEXIST: file already exists, mkdir 'C:\Users\...'
errors and can't enter interactive mode. Debug logs show it starts up, connects MCP servers, then
immediately triggers SessionEnd

Fix:

  1. Install via npm instead: npm install -g @anthropic-ai/claude-code
  2. Delete the standalone binary: del "$env:USERPROFILE\.local\bin\claude.exe"
  3. The standalone auto-updater may re-download it — delete again if needed

Additional notes:

  • claude -p "prompt" (print mode) works fine with both versions — only the interactive TUI is broken
  • In Git Bash, use claude.cmd instead of claude (MSYS2 path mangling breaks the npm shell script)
  • PowerShell in Windows Terminal is the most reliable way to run it on Windows
  • WSL works perfectly with the standalone binary — this is Windows-native only
github-actions[bot] · 5 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/31074
  2. https://github.com/anthropics/claude-code/issues/30932
  3. https://github.com/anthropics/claude-code/issues/31144

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

raphaelm22 · 5 months ago

It seems to work, but there is just a mistype in the 2nd step to fix
$env:USERPROFILE\.local\bin\claude.exe

ErkanShakir3E · 5 months ago
It seems to work, but there is just a mistype in the 2nd step to fix $env:USERPROFILE\.local\bin\claude.exe

true :) but you got the point ( c:\Users\[username]\.local\bin\

That said, this is only a workaround. The root issue in the native app still needs to be properly fixed, so I'd recommend reopening this ticket rather than closing it.

ErkanShakir3E · 5 months ago

seems released version v2.1.70 fixed the issue, at least for me
can you check on your end?

raphaelm22 · 5 months ago

After reinstalling using irm https://claude.ai/install.ps1 | iex and clicked Restart Extensions in VS Code, it worked fine again. Thanks for the help

github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.