Repository navigation
fix: hooks degrade gracefully when node is not on PATH - #57
Merged
Merged
Conversation
Claude Code runs hooks via a non-interactive /bin/sh. On setups where node isn't on that shell's PATH (Nix/nix-darwin, nvm, fnm), every prompt errored with "/bin/sh: node: command not found". Guard each hook command so it runs node only when present and exits 0 otherwise, no more per-prompt noise. The slash-command skills are unaffected; only the always-on activation needs node. Document the requirement in the README install section. Closes #51. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Confirmed fixed on my end — pulled |
2 tasks
DevZonayed
pushed a commit
to DevZonayed/ponytail
that referenced
this pull request
Aug 17, 2026
…t#57) Claude Code runs hooks via a non-interactive /bin/sh. On setups where node isn't on that shell's PATH (Nix/nix-darwin, nvm, fnm), every prompt errored with "/bin/sh: node: command not found". Guard each hook command so it runs node only when present and exits 0 otherwise, no more per-prompt noise. The slash-command skills are unaffected; only the always-on activation needs node. Document the requirement in the README install section. Closes DietrichGebert#51. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Afristrat
pushed a commit
to Afristrat/ponytail
that referenced
this pull request
Sep 29, 2026
…t#57) Claude Code runs hooks via a non-interactive /bin/sh. On setups where node isn't on that shell's PATH (Nix/nix-darwin, nvm, fnm), every prompt errored with "/bin/sh: node: command not found". Guard each hook command so it runs node only when present and exits 0 otherwise, no more per-prompt noise. The slash-command skills are unaffected; only the always-on activation needs node. Document the requirement in the README install section. Closes DietrichGebert#51.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51.
Claude Code runs hooks through a non-interactive
/bin/sh. On setups wherenodeisn't on that shell's PATH (Nix/nix-darwin, nvm, fnm), theSessionStartandUserPromptSubmithooks failed with/bin/sh: node: command not found, on every prompt.command -v node >/dev/null 2>&1 && node "..." || exit 0(and aGet-Command nodeguard for the PowerShellcommandWindows). Node-absent now exits 0 silently instead of erroring every prompt.skills/directly); only the always-on activation + mode tracking need node.Verified: hooks.json parses, the guard runs node when present and exits 0 silently when absent, full suite 33/33, rule check green. @githappens offered to test on a node-less PATH.
🤖 Generated with Claude Code