[BUG] [Windows] Bash tool EINVAL error due to 8.3 short path in temp directory

Resolved 💬 3 comments Opened Feb 25, 2026 by liuaibin001 Closed Feb 25, 2026

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 Write tool 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 to C:\Users\ADMINI~1 by 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

  1. Use a Windows machine where the username is long enough to generate an 8.3 short

path (e.g., AdministratorADMINI~1)

  1. Launch Claude Code CLI from C:\Users\Administrator
  2. Run any Bash command, e.g., echo ok
  3. 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_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗