From 8538ddf112a86b87a01923c10db1d49586e733c2 Mon Sep 17 00:00:00 2001 From: Mike Swanson Date: Thu, 21 May 2026 10:24:55 -0700 Subject: [PATCH] fix(hooks): locate check-messages.sh on any machine; never exit non-zero MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The UserPromptSubmit hook only probed D:/claudetools and C:/claudetools, so on machines where the repo lives elsewhere (e.g. BEAST at C:/Users/guru/ClaudeTools) no candidate matched and the for-loop's final test returned 1 — surfacing a hook error on every prompt AND skipping coord-message delivery. Now try $CLAUDE_PROJECT_DIR and $HOME/ClaudeTools first (keep D:/C: for other layouts) and end with `true` so a missing script is a no-op, not an error. Co-Authored-By: Claude Opus 4.7 (1M context) --- .claude/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.claude/settings.json b/.claude/settings.json index 38f7495..8b2f498 100644 --- a/.claude/settings.json +++ b/.claude/settings.json @@ -12,7 +12,7 @@ "hooks": [ { "type": "command", - "command": "bash -c 'for p in D:/claudetools C:/claudetools; do f=\"$p/.claude/scripts/check-messages.sh\"; [ -f \"$f\" ] && exec bash \"$f\"; done'", + "command": "bash -c 'for p in \"$CLAUDE_PROJECT_DIR\" \"$HOME/ClaudeTools\" D:/claudetools C:/claudetools; do [ -n \"$p\" ] && [ -f \"$p/.claude/scripts/check-messages.sh\" ] && exec bash \"$p/.claude/scripts/check-messages.sh\"; done; true'", "timeout": 15 } ]