[BUG] EINVAL: invalid argument when running Bash tool on Windows — task output file cannot be opened

Resolved 💬 4 comments Opened Feb 25, 2026 by dadavidtseng 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?

Any Bash tool call fails with EINVAL on Windows. Claude Code attempts to open a .output file in the tasks directory but fails, even though the directory exists and is writable.

What Should Happen?

The Bash tool should execute successfully and write its output to the .output file.

Error Messages/Logs

Error: EINVAL: invalid argument, open 'C:\Users\tsengyuwei\AppData\Local\Temp\claude\C--Users-tsengyuwei\tasks\bh0i59wbc.output'

Steps to Reproduce

  1. Install Claude Code on Windows
  2. Launch Claude Code in PowerShell
  3. Run any Bash tool command, e.g. echo "Hello from bash!"
  4. Observe EINVAL error

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.50

Claude Code Version

2.1.53

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Troubleshooting already attempted:

  • Confirmed the tasks directory exists and is writable
  • Enabled Win32 long paths via registry (LongPathsEnabled = 1)
  • Set TEMP=C:\Temp to simplify the path and manually created the subdirectory
  • Tested on both Node.js v24.11.1 and v22
  • All attempts produce the same EINVAL error

The directory exists and manual file writes to that path succeed in PowerShell, suggesting the issue is in how Claude Code opens the file (e.g. invalid open flags on Windows) rather than the path or permissions.

View original on GitHub ↗

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