[BUG] Bash tool EINVAL on task output file open — regression in v2.1.45+ (Windows 11, native)

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

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

The Bash tool fails on every command with EINVAL: invalid argument, open when trying to create/open task output files in the temp directory. This is a regression introduced after v2.1.44 — downgrading to v2.1.44 resolves the issue completely.

● Bash(echo hello world)
  ⎿  Error: EINVAL: invalid argument, open 'C:\Users\<user>\AppData\Local\Temp\claude\<project-path>\tasks\<task-id>.output'

Behavior timeline:

  1. Was working normally on latest version (kept up to date since release)
  2. Stopped mid-session while running two Claude Code instances in separate Windows Terminal tabs on different repos
  3. Restarted Claude Code and terminal — worked again briefly
  4. Stopped again and became permanent — every bash command fails with EINVAL
  5. Survived full uninstall, reboot, and clean reinstall
  6. Running claude install 2.1.44 restores bash functionality immediately
  7. On next launch, auto-updater pulls back to v2.1.53 and bash breaks again
  8. Disabling auto-updater with DISABLE_AUTOUPDATER=1 and pinning to v2.1.44 is a stable workaround

Key finding:

This is not a filesystem permissions issue. PowerShell can create and write to the exact same temp path without issue:

$testDir = "$env:LOCALAPPDATA\Temp\claude\\tasks"
New-Item -ItemType Directory -Force -Path $testDir
[System.IO.File]::WriteAllText("$testDir\test.output", "hello")
cat "$testDir\test.output"  # outputs "hello" successfully

The problem is internal to how claude.exe v2.1.45+ opens these files on Windows.

What Should Happen?

Bash commands should execute and return output, as they do on v2.1.44.

Steps to Reproduce

This may not reproduce on a fresh install. The issue was triggered mid-session (possibly by running two Claude Code instances simultaneously on different repos), and once triggered, it becomes permanent and consistent on v2.1.45+. The critical reproducible finding is:

  1. On an affected machine, claude install 2.1.53 → bash EINVAL every time, on any project
  2. claude install 2.1.44 → bash works every time, on any project
  3. This can be toggled back and forth reliably — tested multiple times

Tested on both the original project and a fresh git init repo at a clean path. Same result on both.

Troubleshooting Already Performed

| Action | Result |
|--------|--------|
| Full uninstall, reboot, clean reinstall | Still broken on v2.1.53 |
| Deleted temp directory manually | Recreated, still broken |
| Tested on fresh git init repo at clean path | Same EINVAL error |
| PowerShell writing to same temp path | Works fine |
| Set CLAUDE_CODE_GIT_BASH_PATH explicitly | No change |
| Added antivirus exclusion for temp folder | No change |
| claude doctor | All checks pass |
| Downgrade to v2.1.44 | Bash works immediately |
| Non-bash tools (Read, Write, Edit, Glob, Grep) | Work fine on all versions |

Working Workaround

Pin to v2.1.44 with auto-updates disabled:

// ~/.claude/settings.json
{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}
claude install 2.1.44

Environment

  • OS: Windows 11
  • Claude Code: v2.1.53 (broken), v2.1.44 (working)
  • Install method: Native
  • Terminal: PowerShell in Windows Terminal
  • Git Bash: GNU bash 5.2.37 at C:\Program Files\Git\bin\bash.exe
  • Antivirus: Third-party (Windows Defender disabled); temp folder excluded
  • claude doctor output (on v2.1.53):

``
Diagnostics
└ Currently running: native (2.1.53)
└ Config install method: native
└ Search: OK (bundled)
Updates
└ Auto-updates: enabled
└ Auto-update channel: latest
└ Stable version: 2.1.44
└ Latest version: 2.1.53
``

Related Issues

  • #26545 — Bash tool returns exit code 1 with no output on Git Bash (Windows) since v2.1.45
  • #21915 — Bash tool produces no output on Windows - commands run but output files remain empty
  • #7630 — Bash tool complete output capture failure on Windows (MINGW64 & CMD)

Claude Model

Opus 4.6

Is this a regression?

Yes — introduced between v2.1.44 and v2.1.45.

Last Working Version

2.1.44

What Should Happen?

My Claude Code cli should be able to run bash commands again.

Error Messages/Logs

● Bash(echo hello world)
  ⎿  Error: EINVAL: invalid argument, open 'C:\Users\<user>\AppData\Local\Temp\claude\<project-path>\tasks\<task-id>.output'

Steps to Reproduce

This may not reproduce on a fresh install. The issue was triggered mid-session (possibly by running two Claude Code instances simultaneously on different repos), and once triggered, it becomes permanent and consistent on v2.1.45+. The critical reproducible finding is:

  1. On an affected machine, claude install 2.1.53 → bash EINVAL every time, on any project
  2. claude install 2.1.44 → bash works every time, on any project
  3. This can be toggled back and forth reliably — tested multiple times

Tested on both the original project and a fresh git init repo at a clean path. Same result on both.

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.44

Claude Code Version

2.1.53

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

Troubleshooting Already Performed

| Action | Result |
|--------|--------|
| Full uninstall, reboot, clean reinstall | Still broken on v2.1.53 |
| Deleted temp directory manually | Recreated, still broken |
| Tested on fresh git init repo at clean path | Same EINVAL error |
| PowerShell writing to same temp path | Works fine |
| Set CLAUDE_CODE_GIT_BASH_PATH explicitly | No change |
| Added antivirus exclusion for temp folder | No change |
| claude doctor | All checks pass |
| Downgrade to v2.1.44 | Bash works immediately |
| Non-bash tools (Read, Write, Edit, Glob, Grep) | Work fine on all versions |

Working Workaround

Pin to v2.1.44 with auto-updates disabled:

// ~/.claude/settings.json
{
  "env": {
    "DISABLE_AUTOUPDATER": "1"
  }
}
claude install 2.1.44

Environment

  • OS: Windows 11
  • Claude Code: v2.1.53 (broken), v2.1.44 (working)
  • Install method: Native
  • Terminal: PowerShell in Windows Terminal
  • Git Bash: GNU bash 5.2.37 at C:\Program Files\Git\bin\bash.exe
  • Antivirus: Third-party (Windows Defender disabled); temp folder excluded
  • claude doctor output (on v2.1.53):

``
Diagnostics
└ Currently running: native (2.1.53)
└ Config install method: native
└ Search: OK (bundled)
Updates
└ Auto-updates: enabled
└ Auto-update channel: latest
└ Stable version: 2.1.44
└ Latest version: 2.1.53
``

View original on GitHub ↗

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