From a64f7eac28f71ebdc2e2a7834a8049fda27fb2c7 Mon Sep 17 00:00:00 2001 From: Andrew Hundt Date: Wed, 1 Jul 2026 20:40:19 -0400 Subject: [PATCH] fix(cli): clarify hook reminder guidance Clarify the Codex/Gemini/Antigravity SessionStart reminder so it recommends graph tools before broad grep for structural code discovery instead of implying they replace file reads. Spell out that auto-indexing uses the MCP server CWD or explicit repo paths when enabled, and add a focused Codex hook regression assertion for the wording. Signed-off-by: Andrew Hundt --- src/cli/cli.c | 5 +++-- tests/test_cli.c | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/cli/cli.c b/src/cli/cli.c index 0f22f67b6..79828d1c4 100644 --- a/src/cli/cli.c +++ b/src/cli/cli.c @@ -1639,8 +1639,9 @@ int cbm_remove_codex_mcp(const char *config_path) { * and NO newlines. (issues #330 + Gemini/Antigravity parity) */ #define CMM_SESSION_REMINDER_CMD \ "echo \"Code discovery: prefer codebase-memory-mcp (search_graph, trace_path, " \ - "get_code, query_graph, search_code) over grep/file-read; graph-backed tools " \ - "auto-index CWD or explicit repo paths when auto_index=true and under " \ + "get_code, query_graph, search_code) before broad grep for structural code " \ + "discovery; graph-backed tools auto-index the MCP server CWD or explicit repo " \ + "paths when auto_index=true and under " \ "auto_index_limit; search_code needs an indexed project; call _hidden_tools " \ "for explicit index_repository.\"" diff --git a/tests/test_cli.c b/tests/test_cli.c index 7d46a3e7b..8eced19ae 100644 --- a/tests/test_cli.c +++ b/tests/test_cli.c @@ -1783,6 +1783,9 @@ TEST(cli_codex_session_hook_issue330) { ASSERT(strstr(d, "[[hooks.SessionStart]]") != NULL); ASSERT(strstr(d, "[[hooks.SessionStart.hooks]]") != NULL); ASSERT(strstr(d, "search_graph") != NULL); + ASSERT(strstr(d, "before broad grep for structural code discovery") != NULL); + ASSERT(strstr(d, "MCP server CWD") != NULL); + ASSERT(strstr(d, "grep/file-read") == NULL); ASSERT(strstr(d, "[mcp_servers.other]") != NULL); /* pre-existing content preserved */ /* Idempotent: a second upsert leaves exactly ONE hook block. */ ASSERT_EQ(cbm_upsert_codex_hooks(cfg), 0);