Skip to content

Local code intelligence for developers and AI agents. Connect code, docs and infrastructure in a persistent graph, with CBM Lens, MCP tools, agent integrations and change-aware test selection.

test(smoke): expect Bash Claude hook matcher

Jake Abendroth36b7b18b4d2f
diff --git a/README.md b/README.md
index b542178a0..cf265d370 100644
--- a/README.md
+++ b/README.md
@@ -441,7 +441,7 @@ overwrite user-modified agents.
| Agent | Activation | MCP config | Durable context / augmentation |
|-------|------------|------------|--------------------------------|
-| Claude Code | Detected | `~/.claude.json` | Skill + three exact-tool graph agents; `SessionStart`, `SubagentStart`, non-blocking `PreToolUse` for `Grep`/`Glob`, and post-`Read` coverage |
+| Claude Code | Detected | `~/.claude.json` | Skill + three exact-tool graph agents; `SessionStart`, `SubagentStart`, non-blocking `PreToolUse` for `Grep`/`Glob`/`Bash`, and post-`Read` coverage |
| Codex CLI | Detected | `$CODEX_HOME/config.toml` | `AGENTS.md`, skill, three read-only agents; `SessionStart` + `SubagentStart` |
| Gemini CLI | Detected | `.gemini/settings.json` | `GEMINI.md`, three explicit read/graph-tool subagents; `BeforeTool`, `AfterTool` `read_file` coverage, and `SessionStart` |
| Zed | Detected | platform `settings.json` (JSONC) | `AGENTS.md` + shared skill |
@@ -488,7 +488,7 @@ overwrite user-modified agents.
### Sessions, compaction, and subagents
Hooks installed by this project are fail-open and context-only. Claude Code's
-`PreToolUse` observes `Grep`/`Glob` and injects matching graph symbols as
+`PreToolUse` observes `Grep`/`Glob`/`Bash` and injects matching graph symbols as
`additionalContext`; `PostToolUse` on `Read` adds targeted coverage context when
the graph could not fully parse or index that file. It never denies or replaces
the requested tool call.
diff --git a/scripts/smoke-test.sh b/scripts/smoke-test.sh
index 2e7fded67..d0474a6a2 100755
--- a/scripts/smoke-test.sh
+++ b/scripts/smoke-test.sh
@@ -1415,7 +1415,7 @@ fi
echo "OK 8c-i: Claude exact-tool graph subagent"
# 8d: Claude Code hooks keep search augmentation and read-coverage reporting
-# separate: PreToolUse matches exactly Grep|Glob, while PostToolUse matches
+# separate: PreToolUse matches exactly Grep|Glob|Bash, while PostToolUse matches
# exactly Read. Neither hook may grow a Search or catch-all matcher.
if ! cat "$FAKE_HOME/.claude/settings.json" 2>/dev/null | python3 -c "
import json, sys
@@ -1423,7 +1423,7 @@ d = json.load(sys.stdin)
all_hooks = d.get('hooks', {})
pre = all_hooks.get('PreToolUse', [])
post = all_hooks.get('PostToolUse', [])
-ok = (any(h.get('matcher') == 'Grep|Glob' for h in pre) and
+ok = (any(h.get('matcher') == 'Grep|Glob|Bash' for h in pre) and
any(h.get('matcher') == 'Read' for h in post))
bad = any('Search' in str(h.get('matcher', '')) for h in pre + post)
sys.exit(0 if (ok and not bad) else 1)
@@ -1431,7 +1431,7 @@ sys.exit(0 if (ok and not bad) else 1)
echo "FAIL 8d: Claude search/read hook matchers are not exact"
exit 1
fi
-echo "OK 8d: Claude Code PreToolUse Grep|Glob + PostToolUse Read"
+echo "OK 8d: Claude Code PreToolUse Grep|Glob|Bash + PostToolUse Read"
# 8e: Claude Code shim script — must be non-blocking augmenter, not a gate.
# #929: Windows installs a .cmd script (extensionless bash shims triggered the
diff --git a/src/cli/cli.h b/src/cli/cli.h
index 2cec80c05..02f32c194 100644
--- a/src/cli/cli.h
+++ b/src/cli/cli.h
@@ -283,7 +283,7 @@ const char *cbm_get_aider_instructions(void);
/* ── Pre-tool hook management ─────────────────────────────────── */
/* Upsert a PreToolUse hook in ~/.claude/settings.json for Claude Code.
- * Adds a Grep|Glob matcher that reminds to use MCP tools.
+ * Adds a Grep|Glob|Bash matcher that reminds to use MCP tools.
* Returns 0 on success. */
int cbm_upsert_claude_hooks(const char *settings_path);