[Windows] Hook execution uses 'bash' instead of detected full path, fails when Git\bin not in PATH

Resolved 💬 4 comments Opened Feb 3, 2026 by RicarKS Closed Mar 3, 2026

Bug Description

On Windows, Claude Code correctly detects the full bash path during startup but uses only bash (not the full path) when executing plugin hooks. This causes hook execution to fail for users who installed Git for Windows with the recommended "Git from the command line" option, which only adds Git\cmd to PATH (not Git\bin where bash.exe resides).

Steps to Reproduce

  1. Install Git for Windows with the recommended option "Git from the command line and also from 3rd-party software"
  2. Verify Git\cmd is in PATH but Git\bin is not (this is the default behavior)
  3. Install a plugin with shell hooks (e.g., superpowers)
  4. Start Claude Code

Expected Behavior

Claude Code should use the full bash path it detects during startup (D:\Program Files\Git\bin\bash.exe) when executing hooks.

Actual Behavior

Claude Code detects the correct path but executes hooks with just bash, causing the error:

'bash' is not recognized as an internal or external command

Debug Log Evidence

2026-02-03T08:39:23.658Z [DEBUG] Using bash path: "D:\Program Files\Git\bin\bash.exe"
...
2026-02-03T08:39:28.413Z [DEBUG] Hook SessionStart:startup (SessionStart) error:
'bash' is not recognized as an internal or external command,
operable program or batch file.

Environment

  • Claude Code version: 2.1.29
  • OS: Windows 11 (10.0.26200)
  • Git for Windows: Installed at D:\Program Files\Git
  • PATH contains: D:\Program Files\Git\cmd (default installation)
  • PATH does NOT contain: D:\Program Files\Git\bin

Workaround

Add D:\Program Files\Git\bin to the system PATH manually.

Suggested Fix

When executing hooks on Windows, use the full bash path that was already detected during startup instead of assuming bash is in PATH.

View original on GitHub ↗

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