codebase-memory-mcp icon indicating copy to clipboard operation
codebase-memory-mcp copied to clipboard

hook-augment treats log filtering (LOG=…; grep -v) as a code search

Open SStonkSS1 opened this issue 1 month ago • 0 comments

Summary

ha_parse_bash_search_pattern skips a leading NAME=value token even when a ; ends it, so log-filtering greps are treated as code searches.

Version

0.12.1 and main @ 747665d.

Reproduction

Claude Code PreToolUse Bash with hook-augment. Command:

LOG=/repo/.agent-artifacts/run.log; grep -v '/.cache/uv/archive-v0/' $LOG | grep -v fnm

Observed: graph symbols matching "archive" injected as additionalContext (untrusted repository metadata). Attachment was PreToolUse:Bash with empty useful content.

Expected

  • Split on ;, &&, ||, and | before skipping prefixes; NAME=value; is its own statement, not a prefix of the next one
  • No augmentation for inverted matches (-v, --invert-match)
  • No augmentation when every path argument is outside the indexed project or a non-source file (*.log, *.txt, /tmp/...)

Related

Not a duplicate of #2058 / #1335 (latency / warm daemon). This is a false-positive class on commands that really do start with grep / rg.

SStonkSS1 avatar Oct 31 '26 14:10 SStonkSS1