Graft Graft, a tool from Nanonets, reduces coding agent tool calls by 46%, tokens by 42%, and time by 60% in a 162-run controlled benchmark by building a persistent graph of codebase context as linked markdown files, eliminating repeated exploration overhead. The tool integrates with Claude Code, Cursor, Codex, and Gemini, and can be installed via npm and initialized with a single command. Turbocharge Claude Code, Cursor, Codex, Gemini & every coding agent: faster, cheaper, with contextual understanding specific to your codebase. | vs. a standard session, no Graft | With Graft | |---|---| | Tool calls | 46% fewer | | Tokens | 42% fewer | | Time | 60% less | | Correctness | equal | The table is a 162-run controlled benchmark same agent, same file tools, only the context differs . The "up to 4× cheaper / 3× faster" figures are the biggest single-task wins from a separate real-repo sweep PocketBase, ollama, Excalidraw . Full method & per-repo numbers ↓ Quick start quick-start The problem the-problem What Graft does what-graft-does How the graph gets built how-the-graph-gets-built What's in a node whats-in-a-node What runs where what-runs-where Agent integration agent-integration — MCP server mcp-server · Claude Code deep integration claude-code-deep-integration CLI cli Search & orient search--orient-graft-grep--graft-map graft grep / graft map Monorepos & multi-repo folders monorepos--multi-repo-folders Visualize it visualize-it-graft-viz graft viz Benchmark benchmark Tested on your popular repos tested-on-your-popular-repos Development development License license npm install -g @nanonets/graft install the CLI, once graft init build the graph + wire it into Claude Code That is the whole setup. graft init asks which of your coding agents to wire up, builds graft/ from your code, and drops a statusline and hooks into .claude/ , so from the next session on Graft rides along in Claude Code: it pulls the matching nodes into each prompt and rebuilds the graph in the background after every turn. No daemon, no re-indexing to remember, nothing to run or maintain by default — the graph is just files. Nothing is written until you pick. Run graft init --dry-run to see every file it would touch first, or graft init --agents claude to skip the prompt and wire Claude Code alone. graft build adds graft/ to your .gitignore automatically — the graph is a local, regenerable cache like node modules , not something you commit. What you share is the wiring init dropped into .claude/ ; each teammate runs graft build to generate their own graph: git add .claude && git commit -m "wire in graft" Prefer not to install globally? npx @nanonets/graft init works the same way. Every task, your coding agent starts blind. Before it changes anything, it re-explores the repo: grep a term, open a file, follow an import, back out, try again. It is rebuilding a picture of a codebase it mapped an hour ago and threw away. That rediscovery burns most of a run's tool calls, tokens, and latency, and it is pure overhead: Repeated. Every task pays the exploration cost again, from zero. Discarded. Whatever the agent figured out dies with the session. Unshared. The next teammate, and their agent, start from scratch too. Humans onboard to a codebase once. Agents onboard every single time. Graft builds that understanding once and writes it into your repo as a folder of linked markdown files, one node per system, API, or concept. Real explanations, not a list of symbols. Each node says, in plain English, what a part of the system does and how it connects to the rest, the way a senior engineer would explain it. That is the part an agent actually needs so it can skip the exploration. It is not a dump of function names. A real graph you can read. No embeddings, no similarity search, no index to keep warm. The graph is a set of linked files your agent opens, greps, and follows, exactly the way it reads any other file in the repo. Grafted into git. The graph is just files in graft/ . Commit it, and anyone who clones the repo has it. No database, no server, no setup. Git does the syncing, and a stale graph shows up as a diff in review instead of rotting in some external store. The diff lives with the code. When a change moves things around, you see it in the graph diff in the same pull request, right next to the code that caused it. Your provider, your key, your model. Summaries are written by any provider you choose — OpenAI, Anthropic native , OpenRouter, Fireworks, Groq, a LiteLLM proxy, or a local model — under your own key. The structural code graph graft build , graft check is deterministic tree-sitter and never calls a model at all. Graft builds the graph in two passes, both powered by a language model: Read each file. Every source file is summarized once into a short description of what it does. Group into nodes. Those summaries are grouped into a curated set of nodes subsystems, key files, and concepts with typed links between them. Graft chooses the right level of detail for you instead of making one node per file, so a big repo becomes a few dozen readable nodes. php flowchart LR S Source files -- T "Tier 1 — tree-sitter