Graft argues code agents should inject repo context automatically, not wait for MCP calls

shhdwi · reddit · 2026-07-28

Graft argues that code-context tools should inject dependencies automatically, not wait for MCP calls

The post says many MCP-based codebase context tools are unreliable because the model may never decide to call them. Graft takes the opposite approach: it hooks into Claude Code directly, injects matching graph nodes into every prompt, shows dependents inline while editing, and re-syncs the graph in the background after each edit.

Under the hood, it builds a typed graph rather than a vector index: tree-sitter creates a deterministic per-symbol graph, and an optional --deep LLM pass turns it into markdown nodes with typed links such as dependson, uses, and produces. Method resolution follows receiver type, so shared method names do not explode into unrelated matches across the repo.

The author claims the system is up to 4× cheaper and 3× faster with no correctness loss. In a benchmark of 162 runs across two repos and two question types, the “push” mode cut cost by 32%, tool calls by 46%, and latency by 60% while keeping correctness at 93%. The “pull” MCP-tool-list mode reached 98% correctness, but only because the harness forced the tool call. A second evaluation on 5 merged PocketBase PRs reproduced all five changes at 21% lower cost.

The project is MIT licensed and open source on GitHub.

Original post →

More from coding & agent

coding & agent channel →