Plugin bash hooks fail on Windows due to mixed path separators in CLAUDE_PLUGIN_ROOT

Resolved 💬 3 comments Opened Jan 16, 2026 by eward4580 Closed Jan 19, 2026

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

  1. Plugin hooks.json defines:

``json
"command": "bash -c \"\\\"${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh\\\"\""
``

  1. Claude Code sets CLAUDE_PLUGIN_ROOT to Windows path:

``
C:\Program Files\ClaudeCode\plugins\cache\claude-plugins-official\ralph-loop\96276205880a
``

  1. When expanded, bash receives:

``
bash -c "C:\Program Files\ClaudeCode\...\hooks/stop-hook.sh"
``

  1. 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:

  1. Convert CLAUDE_PLUGIN_ROOT from C:\path\to\plugin to /c/path/to/plugin
  2. Or provide a separate CLAUDE_PLUGIN_ROOT_UNIX variable for bash hooks

View original on GitHub ↗

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