[BUG] Bash tool EINVAL on Windows when project path generates long temp directory name
Bug
Every Bash tool invocation fails with EINVAL: invalid argument, open before the command even executes. The error points to the temp output file path.
Error
EINVAL: invalid argument, open 'C:\Users\Evan-PC\AppData\Local\Temp\claude\C--Users-Evan-PC-Documents-Organize-IT-Notes-The-inner-ravings-of-a-mayniac\tasks\bb8rst1ix.output'
Environment
- OS: Windows 10 Education 10.0.19045
- Shell: Git Bash (MINGW64)
- Claude Code version: 2.1.53 (standard native installer)
- LongPathsEnabled: 1 (registry confirmed)
- Project path:
C:\Users\Evan-PC\Documents\Organize IT\Notes\The inner ravings of a mayniac
Root Cause
The project directory path is slugified into the temp directory name (C--Users-Evan-PC-Documents-Organize-IT-Notes-The-inner-ravings-of-a-mayniac), creating a deeply nested temp path. The combined path to the .output file exceeds a limit or contains characters Windows rejects, even with LongPathsEnabled=1.
This worked in a prior session the same day — the Bash tool was running pipelines successfully earlier. The issue appeared after an auto-update to 2.1.53.
The MCP memory server also broke in the same update, suggesting a broader regression in the release.
Reproduction
- Install Claude Code 2.1.53 on Windows
- Open Claude Code in a project with a long directory path (5+ nested folders with spaces)
- Run any Bash command (e.g.,
ls) - Observe EINVAL error — command never executes
Expected Behavior
Bash tool should use shorter temp directory names (e.g., a hash of the project path) instead of the full slugified path.
Workaround
Downgrade with claude update <previous-version> and pin minVersion in settings.
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I am having the same issue
⎿ Error: EINVAL: invalid argument, open 'C:\Users\tsengyuwei\AppData\Local\Temp\claude\C--Users-tsengyuwei\tasks\bh0i59wbc.output'
I have the same issue, even with a short path.
Hi, thanks for reporting. We just released v2.1.55 which should fix this.
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.