bug(vscode): Skill tool crashes with EEXIST when home dir is used as working directory on Windows
Bug Report
Summary
When invoking any slash command (skill) from the Claude Code VSCode extension on Windows, the process immediately crashes with exit code 1 before any skill content is executed.
Steps to Reproduce
- Open VSCode with the Claude Code extension on Windows
- Set working directory to a path that already exists (e.g. user home directory
C:\Users\<username>) - Type any slash command in the chat (e.g.
/commit-flash,/commit,/uat)
Error
Error: Claude Code process exited with code 1
EEXIST: file already exists, mkdir 'C:\Users\<username>'
Debug logs:
[DEBUG] Hooks: Parsed initial response: {}
[DEBUG] Hooks: Initial response is not async, continuing normal processing
[DEBUG] Successfully parsed and validated hook JSON output
[DEBUG] "Hook PreToolUse:Glob (PreToolUse) success:\n{}\r\n"
Root Cause (hypothesis)
The Skill tool runner appears to call fs.mkdirSync(workingDir) without the { recursive: true } option (or equivalent mkdir -p), which throws EEXIST when the target directory already exists. The crash happens before any skill content is read or executed.
Expected Behavior
Skill executes normally, following the instructions in the command markdown file.
Actual Behavior
Process exits with code 1 immediately. No skill content is ever reached.
Environment
- OS: Windows 11
- Shell: bash (Git Bash)
- Interface: VSCode extension (not CLI)
- Working directory: user home directory (pre-existing path)
Workaround
Reading the skill file manually with the Read tool and executing steps inline via Bash tool bypasses the issue, but requires the user to not use slash command syntax.
Impact
All slash commands / skills are broken in VSCode on Windows when the working directory is a pre-existing path (which is always the case for home directories).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗