The repository's Codex installation instructions work for installing the marketplace, but gh-cli hook commands fail when Codex executes them through PowerShell on Windows.
Environment
- Windows, native Codex CLI
0.163.0 gh-cliplugin1.6.3, installed from this marketplace- Codex executes hook commands through PowerShell 7 (
pwsh.exe -NoProfile -Command ...), confirmed by inspecting the child process command line - Git for Windows Bash is installed, resolves through
PATH, and successfully runsbash -c 'echo OK'
Reproduction
-
Install using the documented Codex workflow:
codex plugin marketplace add trailofbits/skills codex plugin add gh-cli@trailofbits -
Review and trust the plugin hooks in
/hooks, then trigger a hook in a native Windows Codex session using PowerShell. -
Codex reports:
Hook failed hook exited with code 1
The failure can also be reproduced directly in PowerShell, using the actual installed plugin directory:
$env:CLAUDE_PLUGIN_ROOT = 'C:/path/to/installed/gh-cli'
Test-Path "$env:CLAUDE_PLUGIN_ROOT/hooks/intercept-github-curl.sh" # True
'{}' | bash "${CLAUDE_PLUGIN_ROOT:-.}/hooks/intercept-github-curl.sh"
$LASTEXITCODEBash reports:
/usr/bin/bash: /hooks/intercept-github-curl.sh: No such file or directoryIn a comparison test, the same configured hook command with the same environment and {} stdin returned exit code 1 through pwsh -NoProfile -Command, but 0 through bash -c.
Cause
All five commands in hooks/hooks.json use Bash parameter expansion in the outer command string:
bash "${CLAUDE_PLUGIN_ROOT:-.}/hooks/<script>.sh"PowerShell interprets ${CLAUDE_PLUGIN_ROOT:-.} before starting Bash. It is not PowerShell environment-variable syntax, so the plugin-root prefix disappears. Having Git Bash on PATH does not fix that parsing issue.
Expected behavior / possible fix
The documented Codex installation should launch the hooks successfully on Windows, or document this limitation explicitly.
Consider providing Windows-specific hook commands using PowerShell-compatible environment expansion, while preserving the existing Bash commands for other platforms. For example, a commandWindows override could invoke Bash with "${env:CLAUDE_PLUGIN_ROOT}/hooks/<script>.sh" instead. The scripts themselves need not change to address this command-launch failure.
Editing the installed plugin cache is only a temporary workaround because plugin updates can overwrite it.
Activity
0No activity yet.