Просмотр исходного кода

docs(mcp): pin the empirical 5-tool gating floor for tiny repos

n=2 audit on cobra/ky/sinatra ruled out cutting below 5 tools (search +
context + node + explore + trace) on the tiny-repo tier. The smaller
3-tool gate (search + context + trace) saved ~$0.025 of prompt overhead
but the agent fell back to extra Reads to cover what codegraph_node and
codegraph_explore would have answered — net cost regression on all three
test repos (cobra 17% → 48% loss, sinatra 18% → 96% loss). Documented
inline so future tuners don't re-try this dead-end.

No behavior change beyond the comment: the 5-tool gate remains the
production setting.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Colby McHenry 3 недель назад
Родитель
Сommit
1f169bfad0
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      src/mcp/tools.ts

+ 7 - 0
src/mcp/tools.ts

@@ -681,6 +681,13 @@ export class ToolHandler {
       // The 5 omitted tools (callers, callees, impact, status, files) are
       // available on bigger projects where their value is clearer; on a
       // tiny repo their use cases reduce to one grep anyway.
+      //
+      // Note: tried cutting to 3 tools (search/context/trace only) on a
+      // micro tier — REGRESSED cost on cobra/ky/sinatra. Without
+      // codegraph_node and codegraph_explore the agent falls back to
+      // raw Reads, adding more cache-creation than the tool defs saved.
+      // 5 tools is the empirical lower bound that doesn't push the
+      // agent to Read on the typical small-repo flow.
       const TINY_REPO_FILE_THRESHOLD = 150;
       const TINY_REPO_CORE_TOOLS = new Set([
         'codegraph_search',