From 930fa09d4dd84ce7df1e1a6896ec85e776c2b93c Mon Sep 17 00:00:00 2001 From: Linus Beckhaus Date: Fri, 6 Mar 2026 21:11:38 +0100 Subject: [PATCH] fix(hooks): pass augment pattern after end-of-options marker Prevent grep/glob patterns that begin with '--' from being parsed as CLI flags. Apply the '--' separator across Claude and Cursor hook call sites (direct binary and npx fallback paths). --- gitnexus-cursor-integration/hooks/augment-shell.sh | 2 +- gitnexus/hooks/claude/pre-tool-use.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gitnexus-cursor-integration/hooks/augment-shell.sh b/gitnexus-cursor-integration/hooks/augment-shell.sh index 48ea185b0..5380c5dc8 100644 --- a/gitnexus-cursor-integration/hooks/augment-shell.sh +++ b/gitnexus-cursor-integration/hooks/augment-shell.sh @@ -37,7 +37,7 @@ if [ -z "$PATTERN" ] || [ ${#PATTERN} -lt 3 ]; then fi # Run gitnexus augment -RESULT=$(npx -y gitnexus augment "$PATTERN" 2>/dev/null) +RESULT=$(npx -y gitnexus augment -- "$PATTERN" 2>/dev/null) if [ -n "$RESULT" ]; then # Escape for JSON diff --git a/gitnexus/hooks/claude/pre-tool-use.sh b/gitnexus/hooks/claude/pre-tool-use.sh index 96efbaaff..dc978a266 100644 --- a/gitnexus/hooks/claude/pre-tool-use.sh +++ b/gitnexus/hooks/claude/pre-tool-use.sh @@ -64,7 +64,7 @@ fi # Run gitnexus augment — must be fast (<500ms target) # augment writes to stderr (KuzuDB captures stdout at OS level), so capture stderr and discard stdout -RESULT=$(cd "$CWD" && npx -y gitnexus augment "$PATTERN" 2>&1 1>/dev/null) +RESULT=$(cd "$CWD" && npx -y gitnexus augment -- "$PATTERN" 2>&1 1>/dev/null) if [ -n "$RESULT" ]; then ESCAPED=$(echo "$RESULT" | jq -Rs .)