Bash tool fails with EINVAL on Windows when working directory path contains hyphens in temp file path

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

Environment

  • OS: Windows 11 (Build 26200, MSYS_NT-10.0-26200 via Git Bash/MSYS2)
  • Claude Code version with bug: 2.1.53
  • Claude Code version after downgrade (working): 2.1.52
  • Shell: bash
  • Working directory: C:\Users\ko\Desktop

Description

Every Bash tool invocation fails with EINVAL when running Claude Code 2.1.53 on Windows 11. Even the simplest commands like echo test or ls fail immediately with:

EINVAL: invalid argument, open 'C:\Users\ko\AppData\Local\Temp\claude\C--Users-ko-Desktop\tasks\b735kgys5.output'

The temp path C--Users-ko-Desktop is derived from the working directory C:\Users\ko\Desktop. It seems the file creation under this path causes EINVAL on Windows.

Steps to Reproduce

  1. Install Claude Code 2.1.53 on Windows 11
  2. Open Claude Code from C:\Users\ko\Desktop (Git Bash / MSYS2)
  3. Run any Bash command, e.g. echo hello
  4. Observe the EINVAL error — every command fails the same way

What I Tried (None of These Fixed It)

  1. Restarted Claude Code multiple times
  2. Rebooted the PC entirely
  3. Manually created the temp directory via PowerShell:

``powershell
New-Item -ItemType Directory -Force -Path "C:\Users\ko\AppData\Local\Temp\claude\C--Users-ko-Desktop\tasks"
``

  1. Granted full permissions to the temp directory:

``powershell
icacls "C:\Users\ko\AppData\Local\Temp\claude" /grant "ko:(OI)(CI)F" /T
``

The directory existed with full permissions, but the open() call still returned EINVAL.

What Fixed It

Downgrading from 2.1.53 to 2.1.52 resolved the issue immediately. No other changes were needed — same machine, same directory, same permissions. Bash commands started working right away after the downgrade.

This is a regression introduced in 2.1.53.

Impact

This is a complete blocker. With Bash non-functional, I could not run any git commands, SSH into servers, execute tests, or do anything that requires shell access. I had to manually copy-paste commands into PowerShell to get work done, which made the tool essentially unusable.

Possibly Related Issues

  • #15832 (EINVAL error with temporary settings file)
  • #4672 (Git Bash path parsing issues on Windows)
  • #25293 (Windows sandbox EINVAL with specific folder paths)

---

(Korean / 한국어 요약)

Windows 11에서 Claude Code 2.1.53 사용 시, 작업 디렉토리가 C:\Users\ko\Desktop일 때 Bash 도구의 모든 명령이 임시 파일 경로(C--Users-ko-Desktop\tasks\*.output) 생성 단계에서 EINVAL 에러로 실패합니다. PC 재시작, 폴더 수동 생성, 권한 부여 모두 효과 없었고, 2.1.52로 다운그레이드하면 즉시 정상 동작합니다. 2.1.53에서 도입된 regression입니다.

View original on GitHub ↗

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