On Windows the lifecycle hooks run via PowerShell, which does not expand cmd.exe-style %CLAUDE_PLUGIN_ROOT%. The path was passed literally, so the hook launcher could not find the script and both SessionStart and UserPromptSubmit failed with exit code 1 (issue #19). Switch the two commandWindows entries to $env:CLAUDE_PLUGIN_ROOT, keeping the working node + .js invocation. Add a regression test that rejects cmd.exe %VAR% syntax in commandWindows and asserts every hook command points at a script that actually ships in hooks/. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
864 B
JSON
32 lines
864 B
JSON
{
|
|
"hooks": {
|
|
"SessionStart": [
|
|
{
|
|
"matcher": "startup|resume|clear|compact",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-activate.js\"",
|
|
"commandWindows": "node \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\ponytail-activate.js\"",
|
|
"timeout": 5,
|
|
"statusMessage": "Loading ponytail mode..."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"UserPromptSubmit": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-mode-tracker.js\"",
|
|
"commandWindows": "node \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\ponytail-mode-tracker.js\"",
|
|
"timeout": 5,
|
|
"statusMessage": "Tracking ponytail mode..."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|