[BUG] Bash tool returns EINVAL on all commands for specific project directory (Windows)
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Bash tool fails with EINVAL: invalid argument, open '...' on every command in a specific project directory. The error occurs at the temp output file creation level — before any shell command executes. All other
tools (Read, Write, Glob, Grep, Edit) work normally in the same session. Other project directories on the same machine have working Bash in concurrent sessions.
What Should Happen?
Bash commands should execute normally, same as they do in other project directories on the same machine.
Error Messages/Logs
EINVAL: invalid argument, open 'C:\Users\XXXXXX\AppData\Local\Temp\claude\C--Users-XXXXXX-XXXXX-XXXXXX-XXX-XXXX-XXXXXX\tasks\b3qks72ta.output'
Steps to Reproduce
- Open Claude Code in a project directory on Windows
(repro path: C:\Users\adams\dev\templates\expert-witness-template)
- Run any Bash command, e.g.
echo "test" - Every call fails with EINVAL on the temp .output file
Investigated and ruled out:
- Restarting the session (persists across restarts)
- Deleting the temp directory and retrying
- dangerouslyDisableSandbox: true
- Using cmd //c instead of bash
- Pre-creating the tasks directory via Write tool
(Write tool succeeds at the exact same path, proving
directory and permissions are valid)
- No stale locks or project-specific settings causing it
Other projects with similar path structure and length
work fine simultaneously on the same machine.
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.53
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗