[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.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗