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

hook-augment misses common command prefixes (cd, VAR=, snip, run-logged, bash -c)

Open SStonkSS1 opened this issue 1 month ago • 0 comments

Summary

codebase-memory-mcp hook-augment (Claude Code + Codex PreToolUse Bash) skips env, nice, time, command, rtk, and tokf run before the search command, but not shapes agents emit often.

Version

Built from main @ 747665d (reports dev); also observed on 0.12.1.

Missed shapes

  • cd <dir> && rg <sym> (about a third of Claude Code Bash calls in one week start with cd)
  • VAR=value rg <sym> and VAR=value; rg <sym>
  • snip <cmd>, bash -c '<cmd>'
  • wrapper scripts that exec their argv (here run-logged rg <sym>)

Expected

  • Find the search term after a leading cd X &&, environment assignments, and bash -c
  • Configurable pass-through wrappers (e.g. CBM_HOOK_WRAPPERS=snip,run-logged)
  • For cd X &&, resolve the project from X rather than the hook cwd

Context

We keep PreToolUse Bash on Claude and Codex with CBM_HOOK_DEADLINE_MS=3000 and a permanent daemon. Without these prefix skips, roughly a third of Claude Bash calls never get graph context even when the inner command is a real code search.

SStonkSS1 avatar Oct 31 '26 14:10 SStonkSS1