[BUG] [Windows] Bash tool EINVAL error due to 8.3 short path in temp directory
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 on Windows when the system resolves
the user profile path to its8.3 short filename format (e.g., ADMINI~1 instead of Administrator).
Error message:
EINVAL: invalid argument, open 'C:\Users\ADMINI~1\AppData\Local\Temp\claude\C--Users-Administrator\tasks\xxxxx.output'
Key findings:
- The temp directory exists and has correct permissions
- The
Writetool can successfully create files at the same path - Only the Bash tool is affected — all other tools (Read, Write, Edit, Glob, Grep) work fine
- The issue is reproducible on every Bash invocation, even with
echo ok
Environment:
- OS: Windows 11 Enterprise10.0.22631
- Shell: bash
- User profile path:
C:\Users\Administrator(resolved toC:\Users\ADMINI~1by the system)
What Should Happen?
The Bash tool should handle Windows 8.3 short path names (e.g., ADMINI~1) correctly
when creating temp output files, or resolve them to their long path equivalents before
file operations.
Bash commands like echo ok should execute normally regardless of the user profile
directory name format.
Error Messages/Logs
Every Bash tool invocation produces the same error:
EINVAL: invalid argument, open
'C:\Users\ADMINI~1\AppData\Local\Temp\claude\C--Users-Administrator\tasks\bvj98o255.output'
The output filename hash changes each time, but the error is identical:
EINVAL: invalid argument, open
'C:\Users\ADMINI~1\AppData\Local\Temp\claude\C--Users-Administrator\tasks\bcfyl8avo.output'
EINVAL: invalid argument, open
'C:\Users\ADMINI~1\AppData\Local\Temp\claude\C--Users-Administrator\tasks\bkylokxl1.output'
EINVAL: invalid argument, open
'C:\Users\ADMINI~1\AppData\Local\Temp\claude\C--Users-Administrator\tasks\bz29oyjav.output'
Steps to Reproduce
```markdown
- Use a Windows machine where the username is long enough to generate an 8.3 short
path (e.g., Administrator → ADMINI~1)
- Launch Claude Code CLI from
C:\Users\Administrator - Run any Bash command, e.g.,
echo ok - Observe the EINVAL error
Note: The temp directory C:\Users\ADMINI~1\AppData\Local\Temp\claude\C--Users-Administrator\tasks\
exists and is writable — verified by successfully creating files via the Write tool at the same path.
```
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
v2.1.53
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗