The three shared `command` fields in claude-codex-hooks.json used `exec node "..."`. `exec` is a bash/zsh builtin with no PowerShell equivalent. Some hosts run the `command` field through PowerShell on Windows regardless of the PowerShell-native `commandWindows` field: VS Code Copilot always does (it never reads `commandWindows`), and native Claude Code launched from Git Bash was reported doing the same (#569). PowerShell then fails on the first token with CommandNotFoundException, so every SessionStart / SubagentStart / UserPromptSubmit hook errors out on Windows. Plain `node "..."` runs natively in both bash and PowerShell. Dropping `exec` only gives up the POSIX optimization of replacing the wrapper shell with node; the wrapper-process pileup that #461 added `exec` to avoid is already handled by each hook's stdin self-exit guard (#443/#477), so there is no regression on Codex/zsh. Updated the hooks-windows regression test to assert the shell-agnostic form instead of requiring `exec`. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
45 lines
1.4 KiB
JSON
45 lines
1.4 KiB
JSON
{
|
|
"hooks": {
|
|
"SessionStart": [
|
|
{
|
|
"matcher": "startup|resume|clear|compact",
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-activate.js\"",
|
|
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { node \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\ponytail-activate.js\" }",
|
|
"timeout": 5,
|
|
"statusMessage": "Loading ponytail mode..."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"SubagentStart": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-subagent.js\"",
|
|
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { node \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\ponytail-subagent.js\" }",
|
|
"timeout": 5,
|
|
"statusMessage": "Loading ponytail mode..."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"UserPromptSubmit": [
|
|
{
|
|
"hooks": [
|
|
{
|
|
"type": "command",
|
|
"command": "node \"${CLAUDE_PLUGIN_ROOT}/hooks/ponytail-mode-tracker.js\"",
|
|
"commandWindows": "if (Get-Command node -ErrorAction SilentlyContinue) { node \"$env:CLAUDE_PLUGIN_ROOT\\hooks\\ponytail-mode-tracker.js\" }",
|
|
"timeout": 5,
|
|
"statusMessage": "Tracking ponytail mode..."
|
|
}
|
|
]
|
|
}
|
|
]
|
|
}
|
|
}
|