[Bug] ${CLAUDE_PLUGIN_ROOT} path expansion breaks on Windows
Resolved 💬 3 comments Opened Jan 27, 2026 by tommar21 Closed Jan 31, 2026
Description
When running hooks that use ${CLAUDE_PLUGIN_ROOT} on Windows, the path expansion strips all backslashes, resulting in an invalid path.
Environment
- OS: Windows 11
- Claude Code version: Latest
- Plugin: ralph-loop (from claude-plugins-official)
Steps to Reproduce
- Install the
ralph-loopplugin from claude-plugins-official - The plugin registers a Stop hook in
hooks/hooks.json:
``json``
{
"hooks": {
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "${CLAUDE_PLUGIN_ROOT}/hooks/stop-hook.sh"
}
]
}
]
}
}
- Trigger the Stop hook (end a conversation)
Expected Behavior
The path should expand to a valid Windows path:
C:\Users\username\.claude\plugins\cache\claude-plugins-official\ralph-loop\e30768372b41\hooks\stop-hook.sh
Actual Behavior
The path loses all separators:
/bin/bash: C:Usersusername.claudepluginscacheclaude-plugins-officialralph-loope30768372b41/hooks/stop-hook.sh: No such file or directory
Error Message
Stop hook error: Failed with non-blocking status code: /bin/bash:
C:Usersusername.claudepluginscacheclaude-plugins-officialralph-loope30768372b41/hooks/stop-hook.sh: No such file or directory
Additional Context
There are two issues here:
- Path expansion bug:
${CLAUDE_PLUGIN_ROOT}removes backslashes on Windows - Cross-platform compatibility: The ralph-loop plugin uses a bash script (
.sh) with Unix tools (sed,awk,grep,perl,jq) that aren't available natively on Windows
The path expansion issue affects any plugin using ${CLAUDE_PLUGIN_ROOT} in hooks on Windows.
Workaround
Currently disabled the ralph-loop plugin to avoid the error.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗