You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
hook-guard search substring-matches the whole command string, firing on non-searches #3121
That is a plain substring test over the entire command string, including quoted arguments and heredoc bodies. Observed on graphifyy 0.9.48:
Command
Result
Correct?
grep -rn foo .
fires
yes
rg foo
fires
yes
git commit -m x
quiet
yes
git log -S foo
quiet
yes
git commit -m "add flag support"
fires
no — "flag " contains "ag "
gh pr create --body "you can find it here"
fires
no — prose contains "find "
echo "see grep docs"
fires
no
heredoc whose body mentions grep
fires
no
The "ag " and "fd " tokens are the worst offenders: any English word ending in ag or fd followed by a space matches. flag, tag, diag, bag all trip it.
The heredoc case is self-inflicting for anyone whose project documents its own use of graphify — writing a design doc that mentions grep fires the guard on the write.
Each false positive injects a context line into a tool call where graphify has nothing to contribute, and trains the agent to skim the line, weakening it where it is correct.
Suggested fix: decide on the command's executed tokens rather than the raw string — strip heredoc bodies and quoted spans, split on shell operators (|, ||, &&, ;, &, newline, (, do, then), skip leading VAR=value assignments, and check whether the first remaining word of any segment basenames to a search tool. Worth reconsidering whether find should fire at all: it locates files by path, which the AST index does not cover.
Reported from a downstream project that has worked around it with a wrapper script.
Activity
fix(cli): hook-guard search detection matches executed commands, not …
chore: bump to 0.9.53
safishamsi commentedon Aug 30, 2026
Fixed in v0.9.53: https://github.com/Graphify-Labs/graphify/releases/tag/v0.9.53. Closing as resolved.
fix(hooks): skip positional wrapper args in search guard, cap oriente…
fix(hook): give Bash file reads (cat, head, sed -n, ...) the read nudge