Claude Code hooks silently fail on Windows when Bash is missing from system PATH
A developer discovered that Claude Code's SessionStart hooks fail silently on Windows machines due to a PATH resolution issue, with no error or warning logged anywhere. The problem stems from Git for Windows placing only Git\cmd on the system PATH by default, meaning bash.exe is installed but not accessible to the hook runner. Claude Code's hook executor relies on the OS shell and system PATH to resolve commands, which differs from how the in-session Bash tool finds its own Git Bash installation. This discrepancy means any plugin hook that calls bash silently exits with a non-zero code and is dropped, affecting potentially all Windows users running the default Git installation. Workarounds include manually adding Git\bin to the system PATH or hardcoding the absolute path to bash.exe in hook commands, though neither is a seamless fix for end users.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in