Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

fix(hooks): pass phase argument from hook ID to observe.sh (#1042)

Mitchell5596159a8337
diff --git a/scripts/hooks/run-with-flags-shell.sh b/scripts/hooks/run-with-flags-shell.sh
index 4b064c328..227b8fc7b 100755
--- a/scripts/hooks/run-with-flags-shell.sh
+++ b/scripts/hooks/run-with-flags-shell.sh
@@ -29,4 +29,8 @@ if [[ ! -f "$SCRIPT_PATH" ]]; then
exit 0
fi
-printf '%s' "$INPUT" | "$SCRIPT_PATH"
+# Extract phase prefix from hook ID (e.g., "pre:observe" -> "pre", "post:observe" -> "post")
+# This is needed by scripts like observe.sh that behave differently for PreToolUse vs PostToolUse
+HOOK_PHASE="${HOOK_ID%%:*}"
+
+printf '%s' "$INPUT" | "$SCRIPT_PATH" "$HOOK_PHASE"