From ee2c9c8dd75cce584eab7e550d162fc4e97dc5db Mon Sep 17 00:00:00 2001 From: Pablo Speciale Date: Tue, 31 Mar 2026 12:12:02 +0200 Subject: [PATCH] fix: use POSIX-compatible pipe instead of bash herestring in hooks The PostToolUse hook used `<<<` (bash herestring) which fails when Claude Code runs hooks under `/bin/sh`. Replace with `echo | grep` for POSIX compatibility. --- understand-anything-plugin/hooks/hooks.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/understand-anything-plugin/hooks/hooks.json b/understand-anything-plugin/hooks/hooks.json index b8429bb..efdba6d 100644 --- a/understand-anything-plugin/hooks/hooks.json +++ b/understand-anything-plugin/hooks/hooks.json @@ -6,7 +6,7 @@ "hooks": [ { "type": "command", - "command": "grep -qE 'git\\s+(commit|merge|cherry-pick|rebase)' <<< \"$TOOL_INPUT\" && [ -f .understand-anything/config.json ] && grep -q '\"autoUpdate\".*true' .understand-anything/config.json && [ -f .understand-anything/knowledge-graph.json ] && echo '[understand-anything] Commit detected with auto-update enabled. You MUST read the file at ${PLUGIN_DIR}/hooks/auto-update-prompt.md and execute its instructions to incrementally update the knowledge graph. Do not ask the user for confirmation — just do it.' || true" + "command": "echo \"$TOOL_INPUT\" | grep -qE 'git\\s+(commit|merge|cherry-pick|rebase)' && [ -f .understand-anything/config.json ] && grep -q '\"autoUpdate\".*true' .understand-anything/config.json && [ -f .understand-anything/knowledge-graph.json ] && echo '[understand-anything] Commit detected with auto-update enabled. You MUST read the file at ${PLUGIN_DIR}/hooks/auto-update-prompt.md and execute its instructions to incrementally update the knowledge graph. Do not ask the user for confirmation — just do it.' || true" } ] }