[BUG] `EINVAL: invalid argument` on Bash tool - output file creation fails on Windows (non-C: drive)

Status Fixed / completed
Reported on v2.1.51
Maintainer reply None cached
Activity 4 comments · opened Feb 25, 2026 · 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 every time it tries to create an .output file for task execution. This makes the Bash tool completely unusable.

What Should Happen?

The Bash tool should execute commands and capture output successfully.

Error Messages/Logs

EINVAL: invalid argument, open 'X:\tmp\claude\X--Project-Name\tasks\b<randomID>.output'

Steps to Reproduce

  1. Install Claude Code v2.1.53+ via standalone Windows installer
  2. Open a project on a non-C: drive (e.g. X:\Projects\MyProject)
  3. Ask Claude to run any Bash command (e.g. echo "test")
  4. Error occurs immediately — every Bash tool call fails

Notes:

  • The Write tool can create files in the same directory successfully
  • PowerShell FileMode::CreateNew works on the same path on running outside Claude Code
  • The tasks directory exists and has full permissions (verified with icacls)

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.51

Claude Code Version

2.1.53

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

Downgrading to v2.1.51 resolves the issue immediately.
The project drive is a physical non-C: drive (not network or virtual).
The bug appears to have been introduced in v2.1.53.

View original on GitHub ↗

4 Comments

KK-DMKI · 6 months ago

Having this same issue now! Claude Code updated automatically and it ruined everything. Thanks, Anthropic!

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/28343
  2. https://github.com/anthropics/claude-code/issues/28342
  3. https://github.com/anthropics/claude-code/issues/28333

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

paq · 6 months ago
github-actions[bot] · 5 months ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.