You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bare 'node' in hooks and commands fails on macOS Claude Code App #18
plugins/opencode/hooks/hooks.json and every commands/*.md file invoke node without an absolute path. When Claude Code is launched from the macOS App (Finder / Spotlight / Dock), the shell environment for !-commands and hooks does not load .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 (Intel), /opt/homebrew/bin (Apple Silicon), ~/.nvm/versions/..., ~/.volta/bin, etc. — none of which are in the minimal PATH.
Affected files:
plugins/opencode/hooks/hooks.json — SessionStart, SessionEnd, Stop hooks all run bare node.
plugins/opencode/commands/setup.md, review.md, adversarial-review.md, rescue.md, status.md, result.md, cancel.md — every command uses bare node and allowed-tools: Bash(node:*).
Suggested fix
In handleSetup, resolve the node binary via process.execPath (Claude Code's own node) or which node under the user's login shell, and persist it to state.config.nodePath.
Hooks and commands read ${OPENCODE_COMPANION_NODE:-node} or equivalent, populated by a setup-time rewrite pass.
Alternatively: make the hook/command a shebanged script (#!/usr/bin/env node) and invoke that directly — but this still requires node to be on PATH somewhere env can find it.
The simplest defensible path: handleSetup writes the absolute node path into a config file, and hooks/commands resolve it at runtime.
Activity
JohnnyVicious commentedon Apr 12, 2026
Consolidated into #28. Bare-node failures are part of the broader portable process invocation work.