[BUG] Bash tool EINVAL on Windows when project path generates long temp directory name

Status Fixed / completed
Reported on v2.1.53
Maintainer reply None cached
Activity 5 comments · opened Feb 25, 2026 · closed Feb 25, 2026

Bug

Every Bash tool invocation fails with EINVAL: invalid argument, open before the command even executes. The error points to the temp output file path.

Error

EINVAL: invalid argument, open 'C:\Users\Evan-PC\AppData\Local\Temp\claude\C--Users-Evan-PC-Documents-Organize-IT-Notes-The-inner-ravings-of-a-mayniac\tasks\bb8rst1ix.output'

Environment

  • OS: Windows 10 Education 10.0.19045
  • Shell: Git Bash (MINGW64)
  • Claude Code version: 2.1.53 (standard native installer)
  • LongPathsEnabled: 1 (registry confirmed)
  • Project path: C:\Users\Evan-PC\Documents\Organize IT\Notes\The inner ravings of a mayniac

Root Cause

The project directory path is slugified into the temp directory name (C--Users-Evan-PC-Documents-Organize-IT-Notes-The-inner-ravings-of-a-mayniac), creating a deeply nested temp path. The combined path to the .output file exceeds a limit or contains characters Windows rejects, even with LongPathsEnabled=1.

This worked in a prior session the same day — the Bash tool was running pipelines successfully earlier. The issue appeared after an auto-update to 2.1.53.

The MCP memory server also broke in the same update, suggesting a broader regression in the release.

Reproduction

  1. Install Claude Code 2.1.53 on Windows
  2. Open Claude Code in a project with a long directory path (5+ nested folders with spaces)
  3. Run any Bash command (e.g., ls)
  4. Observe EINVAL error — command never executes

Expected Behavior

Bash tool should use shorter temp directory names (e.g., a hash of the project path) instead of the full slugified path.

Workaround

Downgrade with claude update <previous-version> and pin minVersion in settings.

View original on GitHub ↗

5 Comments

github-actions[bot] · 6 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/28378
  2. https://github.com/anthropics/claude-code/issues/28360
  3. https://github.com/anthropics/claude-code/issues/28377

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

dadavidtseng · 6 months ago

I am having the same issue
⎿ Error: EINVAL: invalid argument, open 'C:\Users\tsengyuwei\AppData\Local\Temp\claude\C--Users-tsengyuwei\tasks\bh0i59wbc.output'

hoangulis26 · 6 months ago

I have the same issue, even with a short path.

shawnm-anthropic · 6 months ago

Hi, thanks for reporting. We just released v2.1.55 which should fix this.

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.