diff --git a/hooks/claude-codex-hooks.json b/hooks/claude-codex-hooks.json index b685fd53..0cd2fbaf 100644 --- a/hooks/claude-codex-hooks.json +++ b/hooks/claude-codex-hooks.json @@ -7,7 +7,6 @@ { "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..." } @@ -20,7 +19,6 @@ { "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..." } @@ -33,7 +31,6 @@ { "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..." } diff --git a/tests/hooks-windows.test.js b/tests/hooks-windows.test.js index 0ec878e1..1c67f416 100644 --- a/tests/hooks-windows.test.js +++ b/tests/hooks-windows.test.js @@ -1,9 +1,11 @@ #!/usr/bin/env node -// Regression test for issue #19: on Windows the lifecycle hooks run via -// PowerShell, which does NOT expand cmd.exe-style %VAR% — it needs $env:VAR. +// Regression test for issues #19 and #593: on Windows the lifecycle hooks run +// via PowerShell, so the shared `command` field must be cross-platform (plain +// `node`, no bash-only syntax). commandWindows is not part of the supported +// hooks schema on the Claude.ai plugin marketplace validator, so it is omitted +// — ${CLAUDE_PLUGIN_ROOT} expansion and `node` work everywhere. +// // The hook also has to point at a script that actually ships in hooks/. -// This guards both failure modes: the original %CLAUDE_PLUGIN_ROOT% bug, and -// the "switch to a .ps1 that doesn't exist" mistake. const test = require('node:test'); const assert = require('node:assert/strict'); @@ -17,8 +19,6 @@ const HOST_PLUGIN_MANIFESTS = [ '.claude-plugin/plugin.json', '.codex-plugin/plugin.json', ]; -// cmd.exe variable syntax (%FOO%); PowerShell leaves it literal, breaking the path. -const CMD_VAR_SYNTAX = /%[A-Za-z_][A-Za-z0-9_]*%/; // PowerShell 5.1 rejects these POSIX shell guards when a host runs `command`. const POSIX_GUARD_SYNTAX = /\bcommand\s+-v\b|&&|\|\||>\/dev\/null|2>&1/; // Pull the hooks/