Plugin hooks cannot execute scripts on Windows - /bin/bash cannot resolve file paths

Resolved 💬 6 comments Opened Jan 16, 2026 by 9thLevelSoftware Closed Feb 28, 2026

Description

Plugin hooks that reference script files fail on Windows because Claude Code's /bin/bash cannot resolve Windows file paths in any format.

Environment

  • OS: Windows 11
  • Claude Code version: Latest
  • Shell: PowerShell (terminal), but hooks use /bin/bash

Steps to Reproduce

  1. Install a plugin that uses hook scripts (e.g., codex-peer-review from the marketplace)
  2. The plugin's hooks.json references a script file:

``json
{
"hooks": {
"Stop": [{
"matcher": "*",
"hooks": [{
"type": "command",
"command": "bash \"C:\Users\username\.claude\plugins\cache\plugin-name\1.0.0\hooks\script.sh\""
}]
}]
}
}
``

  1. Start a Claude Code session and trigger the hook

Expected Behavior

The hook script should execute successfully.

Actual Behavior

The hook fails with an error like:

Stop hook error: Failed with non-blocking status code: /bin/bash: C:Usersusername.claudeplugins...: No such file or directory

Path Formats Tested (All Failed)

| Format | Result |
|--------|--------|
| C:\Users\... | Backslashes stripped: C:Users... |
| "C:\Users\..." (quoted) | Mixed separators: C:\...\1.0.0/hooks/... |
| C:/Users/... | /bin/bash: C:/Users/...: No such file or directory |
| /c/Users/... (MSYS style) | /bin/bash: /c/Users/...: No such file or directory |
| cygpath -u | cygpath: command not found (not in PATH) |

Workaround

Replace script references with inline echo commands. This makes hooks succeed but removes their functionality.

Analysis

Claude Code appears to use a /bin/bash that:

  1. Is not Git Bash or MSYS bash (no cygpath available)
  2. Cannot resolve Windows absolute paths in any format
  3. Strips backslashes from unquoted paths
  4. Cannot find files at forward-slash Windows paths

This makes it impossible for plugins to use hook scripts on Windows - only inline commands work.

Suggested Fix

Either:

  1. Use a bash that can resolve Windows paths (Git Bash, MSYS2)
  2. Automatically convert Windows paths to a resolvable format before passing to bash
  3. Allow cmd.exe or PowerShell as an alternative hook executor on Windows
  4. Document the limitation and recommend inline commands for cross-platform plugins

View original on GitHub ↗

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