GitHub radar

Graft: A Context Graph That Speeds Up Coding Agents

An open-source tool builds an understanding graph of your code and feeds it straight into Claude Code, Cursor, Codex, and other agents, instead of having them re-explore the repository every time.

01trailhq/Graft 9.3kTypeScript

Graft calls itself an open-source context layer for large codebases. It walks a repository once with tree-sitter, groups files into nodes by subsystem, and writes a plain-language explanation for each node plus typed links to the nodes around it. Everything lands as ordinary markdown files in a local folder next to the project, no database and no server. From there, a coding agent reads the node instead of grepping the repo blind, either through a bundled MCP server or by opening the files directly. On SWE-bench Verified, the official benchmark that grades real GitHub issues with the maintainers' own tests, an agent using Graft resolved 33 of 50 instances against 27 for a cold agent, with 23% fewer tokens and 32% less wall-clock time. The structural parsing is deterministic and needs no model key at all; only the richer, plain-language notes call a model, and for that you plug in your own key from any provider (Anthropic, OpenAI, OpenRouter, or a local one). Built by the team behind Trail (trailhq.com), and published on npm as @nanonets/graft.

Why a vibe-coder should care

This is exactly the kind of overhead I run into in my own long Claude Code sessions: the agent re-explores the project structure before it touches a single line, and that eats both time and tokens. Graft does not replace the model I actually work with day to day (Opus 5, and Fable 5.1 for the hard cases) — it just saves the agent the exploration step. Honestly, the part that works for free and fully offline already covers the main win; the richer plain-language notes are the one place you pay, with your own model key. It wires into Claude Code with a single command, and nothing about how you write code has to change.

How to install

Copy this and send it to your agent — Claude Code, Codex, any of them:

Set up a context graph for this project: take https://github.com/trailhq/Graft, install it per the README (npm install -g @nanonets/graft, then graft init and pick Claude Code), and show me what changed — the graft/ folder and the Claude Code statusline. If you need a model API key for the richer notes, ask me.

Runs on a regular laptop — only Node.js 20 or newer is needed, no GPU required.

Open on GitHub