The video explains why coding agents like Claude Code and Codex burn tokens: before making any change they have to grep and read their way to the right file, and every tool result gets resent to the model, bloating context and slowing things down. It then covers Graft, a free open-source CLI trending on GitHub, which builds a knowledge graph (nodes and edges) of your codebase so the agent knows which files and lines to open before it calls a single tool. Graft's own benchmark across 162 runs claims 60% less time, 46% fewer tool calls, 42% fewer tokens and 32% lower cost, and the presenter's own test showed a modest gain on the first build but much faster edits afterward.
- Agents waste tokens because finding the right file takes multiple search turns, and each turn resends the whole conversation plus prior tool output to the model, which grows context, slows responses and degrades output quality.
- Existing solutions mostly use vector search, which matches by meaning; the video argues this fails because 'create account' and 'delete account' look similar but do opposite things, so most coding agents don't use it.
- Graft instead reads your code and records which part actually uses which, storing a map of nodes (code parts) and edges (connections) as a JSON file, with a browser viewer for exploring it.
- It's free, open-source, needs no separate API key so it runs on your existing subscription, and only an optional step uses a model to write plain-language pages describing what each part does.
- In Graft's own benchmark of 162 runs: 60% less time on average, 46% fewer tool calls, 42% fewer tokens, 32% lower cost, with a best case of roughly 4x cheaper token usage.
- Installation adds a Graft skill plus hooks to the project: one injects map instructions at session start, one attaches up to three matching code locations to every prompt, and one updates the map after the agent edits a file.
- There are two modes: the CLI version guesses locations from your prompt and attaches them every time (faster), while the MCP version only answers when the agent asks (slightly more accurate in Graft's tests); you get both.
- Savings scale with project size, and Graft only maps code — PRDs, notes and learnings files still get found the slow default way, which is why the presenter made a modified version for non-coding work.
This is the mechanism the whole tool rests on, plus the practical difference between the CLI and MCP modes.
Every time you send a prompt, graft checks the words in your message against the map and attaches up to three matching locations to it. So the model already knows which files and lines to read before it uses a single tool.
It's the hands-on comparison, including the honest caveat that the first build barely benefits because the map doesn't exist yet.
With Graft, the build took 39 minutes and used around 31% of the context window. Without Graft, the same build took 47 minutes and used around 35%.
Similarity alone doesn't tell you how the parts of your app connect. The code for creating an account and deleting an account can both match a question about accounts, but they do two opposite things.
Across 162 runs, tasks took 60% less time on average. The agent used its tools 46% fewer times and 42% fewer tokens.
Graft only maps code. So it doesn't map your PRD or the notes, which means the agent uses the usual default method when it has to read those.