mirror of
https://github.com/affaan-m/everything-claude-code.git
synced 2026-04-13 05:03:28 +08:00
fix(hooks): pass phase argument from hook ID to observe.sh (#1042)
The shell wrapper run-with-flags-shell.sh was not extracting the phase prefix from the hook ID (e.g., "pre:observe" -> "pre") and passing it as $1 to the invoked script. This caused observe.sh to always default to "post", recording all observations as tool_complete events with no tool_start events captured. Fixes #1018 Co-authored-by: Millectable <noreply@github.com> Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -29,4 +29,8 @@ if [[ ! -f "$SCRIPT_PATH" ]]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user