Bug
The hook commands in hooks/hooks.json fail on Windows when the user profile path contains spaces (e.g., C:\Users\Asif Husain\).
Error
Stop hook error: Failed with non-blocking status code: File "C:\Users\Asif", line 1
/c/AMP
^
SyntaxError: invalid syntax
Cause
The ${CLAUDE_PLUGIN_ROOT} variable expands to a path with spaces, but the commands in hooks.json don't quote it:
"command": "python3 ${CLAUDE_PLUGIN_ROOT}/scripts/trigger.py || python ${CLAUDE_PLUGIN_ROOT}/scripts/trigger.py"
The shell splits the path at the space, so Python receives C:\Users\Asif as the script path instead of the full path.
Fix
Quote the expanded variable in all commands:
"command": "python3 \"${CLAUDE_PLUGIN_ROOT}/scripts/trigger.py\" || python \"${CLAUDE_PLUGIN_ROOT}/scripts/trigger.py\""
This affects all four hook entries: PreToolUse, PostToolUse, Stop, and SubagentStop.
Environment
- Windows 11 Pro
- Plugin version: 0.8.2
- Shell: bash (Git Bash)
Bug
The hook commands in
hooks/hooks.jsonfail on Windows when the user profile path contains spaces (e.g.,C:\Users\Asif Husain\).Error
Cause
The
${CLAUDE_PLUGIN_ROOT}variable expands to a path with spaces, but the commands inhooks.jsondon't quote it:The shell splits the path at the space, so Python receives
C:\Users\Asifas the script path instead of the full path.Fix
Quote the expanded variable in all commands:
This affects all four hook entries:
PreToolUse,PostToolUse,Stop, andSubagentStop.Environment