[BUG] Bash tool EINVAL on Windows persists in v2.1.53 — stdio fd regression from v2.1.45 not fully fixed
Bug Description
Bash tool fails with EINVAL: invalid argument on every command in Claude Code v2.1.53 on Windows with Git Bash (Scoop install). This appears to be a continuation/variant of the stdio fd regression introduced in v2.1.45 (#26413, #26462, #26545).
Those issues were closed as completed, but the problem persists on v2.1.53 with a different error signature: EINVAL instead of Bad file descriptor.
Error
EINVAL: invalid argument, open 'C:\Users\94049\AppData\Local\Temp\claude\C--Users-94049-Documents-Projects-Topo\tasks\b8miv62u5.output'
Every Bash tool call fails immediately with this error. The failure is in Node.js fs.open() on the task output file, before bash is even spawned.
Environment
- Claude Code: 2.1.53 (native install)
- OS: Windows 11 (MSYS_NT-10.0-26200 3.6.6)
- Git: 2.53.0 (installed via Scoop)
- Bash path:
C:\Users\94049\scoop\apps\git\current\usr\bin\bash.exe - CLAUDE_CODE_GIT_BASH_PATH: set and valid
Verified
| Check | Result |
|-------|--------|
| bash -c "echo hello" from PowerShell | Works |
| Bash writes to the same temp directory from PowerShell | Works |
| Claude Code Write tool creates files in the same directory | Works |
| Claude Code Read/Glob/Grep tools | All work |
| dangerouslyDisableSandbox: true on Bash tool | Still EINVAL |
| Environment variables (GIT_INSTALL_ROOT, MSYS2_PATH_TYPE, TEMP) | All correct |
| After full computer restart + temp directory cleanup | Still EINVAL |
Root Cause (likely)
The v2.1.45 change from pipe-based stdio to file-descriptor-based stdio (fs.openSync(path, 'a')) for shell output capture is incompatible with MSYS2/Git Bash on Windows. The fix applied after #26413 appears incomplete — the openSync() call itself now fails with EINVAL rather than succeeding but producing an invalid fd for bash.
Related Issues
- #26413 — Original report: Bad file descriptor on stdout pipe
- #26462 — Bash broken on Windows in v2.1.45
- #26545 — Bash tool returns exit code 1 with no output since v2.1.45
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗