-
Notifications
You must be signed in to change notification settings - Fork 481
Codex plugin commands fail with command not found: node on Mac App #105
Description
When using the Codex plugin in Claude Code on macOS, all !-pattern commands (/codex:status, /codex:result, /codex:cancel) and lifecycle hooks fail with:
(eval):1: command not found: node
Root cause: The plugin's !-pattern commands and hooks invoke node without an absolute path. The shell environment used for !-commands and hooks does not load shell init files (.zshenv, .zshrc), so only the minimal system PATH (/usr/bin:/bin:/usr/sbin:/sbin) is available. On macOS, Node.js is typically installed in /usr/local/bin or /opt/homebrew/bin, neither of which is in that minimal PATH.
Affected files:
commands/status.md, commands/result.md, commands/cancel.md — !-commands use bare node
hooks/hooks.json — all three hooks (SessionStart, SessionEnd, Stop) use bare node
Workaround: Replace node with /usr/local/bin/node in all affected files and update allowed-tools: Bash(node:) to Bash(/usr/local/bin/node:). This fix is lost on plugin updates since the files live in the plugin cache.
Suggested fix: Use an absolute path, #!/usr/bin/env node, or resolve the node binary path at plugin install time. Alternatively, ensure the !-command shell inherits a reasonable PATH (e.g. by sourcing ~/.zshenv).