Windows: EEXIST crash on startup - mkdir fails on existing parent directory

Resolved 💬 3 comments Opened Mar 5, 2026 by christianfontaine Closed Mar 5, 2026

Bug Description

Claude Code crashes immediately on startup in VSCode extension (v2.1.69) on Windows 11 with repeated EEXIST errors when trying to save config with lock.

Error

Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
Grove: Failed to fetch and store config: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'

This error appears 8+ times in rapid succession during startup, then the process exits with code 1.

Environment

  • OS: Windows 11 Pro 10.0.26200
  • Extension: Claude Code VSCode v2.1.69 (win32-x64)
  • Shell: bash (Git Bash)
  • Auth: OAuth tokens present in secure storage

Full Log (relevant section)

2026-03-05T18:15:34.131Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.132Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.133Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.133Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.133Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.156Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.156Z [DEBUG] Grove: Failed to fetch and store config: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.387Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.387Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'
2026-03-05T18:15:34.389Z [ERROR] Failed to save config with lock: Error: EEXIST: file already exists, mkdir 'C:\Users\chrfo'

Root Cause Analysis

The config lock mechanism appears to use fs.mkdir (non-recursive) to create part of the directory path as a lock. On Windows, when C:\Users\<username> already exists (which it always does), the mkdir call throws EEXIST instead of succeeding silently.

This suggests the lock implementation may need:

  • { recursive: true } flag on the mkdir call, OR
  • A check for EEXIST in the error handler to treat it as non-fatal

The error cascades because multiple concurrent config save operations are triggered during startup, all failing on the same mkdir.

Additional Context

Other errors during the same startup (likely secondary):

  • MCP server "claude-vscode" Failed to fetch tools: MCP error -32601: Method not found
  • rg: .claude\plugins\cache: IO error (directory did not exist)
  • Missing C:\ProgramData\ClaudeCode\managed-settings.json (ENOENT)

Workaround

Manually creating ~/.claude/plugins/cache/ and cleaning stale .lock files in ~/.claude/ide/ and ~/.claude/tasks/ may help in some cases, but the core mkdir EEXIST issue is in the internal config lock mechanism and cannot be fixed client-side.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗