Stop paying your agent to rediscover the codebase every prompt
Graft writes a plain-English map of your codebase into linked markdown files so coding agents stop burning tokens rediscovering what they learned last session.

What it does
Graft constructs a static graph of your codebase as a folder of linked markdown files, one node per subsystem or concept, written in plain English rather than symbol dumps. It hooks into agents like Claude Code so each prompt carries that context up front, aiming to cut the blind exploration phase where agents grep and open files they mapped an hour ago. The graph rebuilds incrementally via content-hash caching, and a tree-sitter structural layer keeps the file-to-file wiring current without calling a model.
The interesting bit
Instead of embeddings or a vector database, Graft treats context as a set of markdown files your agent already knows how to read, grep, and follow—no new retrieval mechanism required. The refresh-before-answer check stats the source tree against a fingerprint in about three milliseconds, so the graph stays current with unstaged edits without ever reading git.
Key highlights
- Controlled benchmark (162 runs) reported 46% fewer tool calls, 42% fewer tokens, and 60% less latency versus a cold start, with equal correctness.
- SWE-bench Verified scores jumped from 4/8 to 6/8 resolved instances against standard Claude Code, with 17% fewer tool calls.
- Tier-1 structural graph is pure tree-sitter and deterministic; LLM passes only run when you choose a provider and supply your own key.
- No telemetry, no daemon, no server, and no similarity search—just files in a
graft/directory that git can diff like any other code. - The graph is cached by content hash, so rebuilds touch only changed files; the README cites 0.18 seconds for a single edited file in a 124-file repo.
Caveats
- The benchmark sample is two repos (the tool itself and a Node/Express auth service); broader language or framework coverage is not explicitly tested in the published numbers.
- Deep integration is currently wired for Claude Code via
.claude/hooks; other agents rely on an MCP server, which may offer a thinner experience. - The “up to 4× cheaper / 3× faster” figures come from single-task wins on a separate sweep of PocketBase, ollama, and Excalidraw, not the controlled 162-run mean.
Verdict
Teams already paying for agent minutes on large or unfamiliar repos should look here; if your codebase fits in a single file or your agent rarely gets lost, the setup is unnecessary overhead.
Frequently asked
- What is NanoNets/Graft?
- Graft writes a plain-English map of your codebase into linked markdown files so coding agents stop burning tokens rediscovering what they learned last session.
- Is Graft open source?
- Yes — NanoNets/Graft is open source, released under the MIT license.
- What language is Graft written in?
- NanoNets/Graft is primarily written in TypeScript.
- How popular is Graft?
- NanoNets/Graft has 1.2k stars on GitHub.
- Where can I find Graft?
- NanoNets/Graft is on GitHub at https://github.com/NanoNets/Graft.