[BUG] v2.1.45 Windows: Bash tool fails silently (exit code 1) when WSL bash is on PATH alongside Git Bash

Resolved 💬 9 comments Opened Feb 18, 2026 by AshExplained Closed Feb 19, 2026

Describe the bug

After updating to v2.1.45, all Bash tool invocations fail with Exit code 1 and produce zero output. This includes trivial commands like echo hello and pwd. This worked correctly before today's update.

To reproduce

  1. Windows 11 with both Git Bash and WSL installed
  2. PATH contains multiple bash executables (Git Bash, WSL bash, WindowsApps bash)
  3. Update Claude Code to v2.1.45
  4. Run any Bash tool command — all return Exit code 1 with no output

Observed behavior

| Command | Result |
|---------|--------|
| echo hello | Exit code 1, no output |
| pwd | Exit code 1, no output |
| ls -la | Exit code 2, no output |
| git --version | Works (native .exe) |
| claude --version | Works (native .exe) |
| where bash | Works — returns 3 paths |

Native Windows executables work. Bash builtins and Unix-style commands fail. This suggests the shell layer is not spawning bash correctly and falling back to a limited execution mode.

Bash executables on PATH (where bash)

C:\Program Files\Git\usr\bin\bash.exe    (Git Bash)
C:\Windows\System32\bash.exe             (WSL launcher)
C:\Users\user\AppData\Local\Microsoft\WindowsApps\bash.exe  (WSL alias)

bash --version from PowerShell returns: GNU bash, version 5.2.21(1)-release (x86_64-pc-linux-gnu) — confirming WSL bash is being resolved instead of Git Bash.

Expected behavior

Bash tool should use Git Bash (C:\Program Files\Git\bin\bash.exe) and execute commands normally, as it did in previous versions.

Environment

  • Claude Code version: 2.1.45
  • OS: Windows 11 Pro 10.0.26100
  • Shell: bash (WSL resolving over Git Bash)
  • Git Bash: installed at C:\Program Files\Git\
  • WSL: installed (Ubuntu)

Likely cause

Shell resolution in v2.1.45 appears to pick up C:\Windows\System32\bash.exe (WSL launcher) which fails silently when invoked programmatically, instead of using Git Bash. Previous versions handled this correctly.

Workaround

Setting CLAUDE_CODE_GIT_BASH_PATH or preferredShell config to the Git Bash path should resolve it.

Related issues

  • #19653 — WSL binary executes Bash commands through Windows
  • #12115 — Bash commands fail with exit code 1 and no output
  • #15471 — Windows Shell Compatibility Issue
  • #25593 — Windows requires git-bash after install

View original on GitHub ↗

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