bokuwalily/claude-code-skills/macos-hook-path-timeout
Claude Code and agent skill by bokuwalily/claude-code-skills
- community
Checking that the SKILL.md file is still in the repository.
macOSでClaude Codeのhookやlaunchdジョブが `node: command not found` / `timeout: not found` で失敗する時に使う。GUI起動アプリの最小PATH問題と、macOSにGNU coreutils(timeout)が無い問題の、検証済み回避策。
Install
npx vskill@latest install bokuwalily/claude-code-skills/macos-hook-path-timeoutSKILL.md
The same SKILL.md was published earlier as bokuwalily/claude-code-skills/macos-hook-path-timeout.
Procedure
症状1: hook が /bin/sh: node: command not found(また brew/その他CLIも)
GUIから起動したClaude Code(.app)が spawn する hook の /bin/sh -c は、ログインシェルの プロファイル(.zshrc)を読まず 最小PATH(`/usr/bin:/bin:/usr/sbin:/sbin`) しか持たない。 nvm/homebrew にある node 等が見えず、プラグイン定義の node "...mjs" 系hookが毎回失敗する。
修正: ~/.claude/settings.json のトップレベルに env.PATH を足し、hook子プロセスに継承させる。
Bashツール側はプロファイルを再読込するので pyenv/nvm の順序は壊れない(env.PATHは hook など プロファイル非読込の子にだけ効く)。nvm versioned path が将来stale化しても /opt/homebrew/bin/node が fallback するので壊れない。
症状2: スクリプトの timeout 60 ... が効かない(timeout: command not found)
macOSは GNU coreutils の timeout を標準搭載しない。ECCのhooks.md等が前提にしていても不発。
修正: brew install coreutils で gtimeout が入る。スクリプトは command -v gtimeout >/dev/null && TIMEOUT_CMD="gtimeout 60" の形で優先検出させる (post_tsc_check.sh / skills-auto-update.sh はこの形。coreutils導入だけで設計通りに起動する)。
Pitfalls
env.PATHを短すぎる値にするとin-sessionのBashが影響を受けうるので、ログインPATHの主要dirを網羅した superset にする。設定前にcp settings.json backups/でバックアップ。settings.jsonはプラグイン(例: agentmemory/remember)がライブ書換することがある。Edit前に再Readして楽観ロックに従う。envブロックはjq round-tripでも保全される。- nvm の versioned path をハードコードすると node メジャー更新でstaleになる → 必ず
/opt/homebrew/binも含める。
Verification
Security
- Security scanPassed, 91 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/macos-hook-path-timeout/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/bokuwalily/claude-code-skills/macos-hook-path-timeout)