Bug Description
Plugin bash hooks fail on Windows because CLAUDE_PLUGIN_ROOT is set to a Windows-style path (with backslashes), but the hook command passes this path to bash which cannot resolve the mixed path format.
Error Message
Stop hook error: Failed with non-blocking status code: /bin/bash: line 1: C:\Program Files\ClaudeCode\plugins\cache\claude-plugins-official\ralph-loop\96276205880a/hooks/stop-hook.sh: No such file or directory
Root Cause Analysis
-
Plugin hooks.json defines:
"command": "bash -c \"\\\"${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh\\\"\""
-
Claude Code sets CLAUDE_PLUGIN_ROOT to Windows path:
C:\Program Files\ClaudeCode\plugins\cache\claude-plugins-official\ralph-loop\96276205880a
-
When expanded, bash receives:
bash -c "C:\Program Files\ClaudeCode\...\hooks/stop-hook.sh"
-
Bash (Git Bash/MSYS2) cannot resolve this mixed-separator path
Expected Behavior
Claude Code should convert Windows paths to Unix-style paths (e.g., /c/Program Files/...) when:
- The hook command uses bash
- Running on Windows with Git Bash/MSYS2
Environment
- OS: Windows 11 Pro for Workstations (Build 26200)
- Claude Code: Latest version
- Shell: Git Bash (MSYS2)
- Affected Plugin:
ralph-loop@claude-plugins-official (and likely any plugin using bash hooks)
Workaround
The MCP-based ralph_loop tool works correctly. Only the plugin-based bash hooks are affected.
Suggested Fix
In the plugin hook executor, when running on Windows and the command starts with bash:
- Convert
CLAUDE_PLUGIN_ROOT from C:\path\to\plugin to /c/path/to/plugin
- Or provide a separate
CLAUDE_PLUGIN_ROOT_UNIX variable for bash hooks
Bug Description
Plugin bash hooks fail on Windows because
CLAUDE_PLUGIN_ROOTis set to a Windows-style path (with backslashes), but the hook command passes this path to bash which cannot resolve the mixed path format.Error Message
Root Cause Analysis
Plugin
hooks.jsondefines:Claude Code sets
CLAUDE_PLUGIN_ROOTto Windows path:When expanded, bash receives:
Bash (Git Bash/MSYS2) cannot resolve this mixed-separator path
Expected Behavior
Claude Code should convert Windows paths to Unix-style paths (e.g.,
/c/Program Files/...) when:Environment
ralph-loop@claude-plugins-official(and likely any plugin using bash hooks)Workaround
The MCP-based
ralph_looptool works correctly. Only the plugin-based bash hooks are affected.Suggested Fix
In the plugin hook executor, when running on Windows and the command starts with
bash:CLAUDE_PLUGIN_ROOTfromC:\path\to\pluginto/c/path/to/pluginCLAUDE_PLUGIN_ROOT_UNIXvariable for bash hooks