Graft
A CLI that builds a graph of linked notes from your repo and feeds the matching nodes into Claude Code, Cursor, Codex, Gemini and other agents
Medium risk
We rate an entry medium when the tool runs code, makes network calls or reads project files. Check what exactly it does before installing.
Why this level
- Reads project sources and writes the graph folder and wiring files into the repo and agent configs
- The explanation layer sends file contents to the chosen model provider under your key
Install
In your terminal, with SkillFoxx CLI
npx skillfoxx add cli/graftDetects the agents on your machine, checks the risk and pins the version.
Other ways to install
Install the tool
npm install -g @nanonets/graftInstall the CLI: npm install -g @nanonets/graft, then run graft init in the repo root and pick the agents to wire up. For the full explanation layer run graft build --deep with a provider key configured. Preview what init would write with graft init --dry-run.
Other ways from the author
npm install -g @nanonets/graft
graft initgraft init asks which agents to wire and lists the files it would write. Preview with graft init --dry-run.
This is third-party code. Review the repository files before installing.
What it does
Graft parses a repository and writes its understanding of the code into a folder of linked markdown files, one node per subsystem, API or concept. The structural graph of symbols and edges is built deterministically with tree-sitter, no model and no key, while an explanation layer and short logic excerpts come from a model run under your own provider and key. A single graft init command wires the graph into the agents you pick: it writes their instruction files, and for Claude Code it adds a live statusline, hooks and an MCP server with tools to search and traverse the graph. Before each query the graph is rebuilt against the working tree, so answers describe the code as it is now, including unsaved edits. It also ships search, repo-map and graph visualization commands.
Who it is for. For developers using coding agents on large repositories who want to cut the tokens and time spent re-exploring the code.
Good fit when
- The agent re-explores a large repository every task and burns tokens and time on it
- You want a shared context layer about the code that lives in the repo as files
- You need ranked code search and a map of relations: who calls what and depends on what
Not a fit when
- The project is small and the agent copes fine without an extra context layer
- The project language is not among those Graft supports, such files are skipped
Example request
Use graft to find where authorization is handled in this repo and show the related modulesLimitations
The structural graph and search run locally, no key and no network, while the model-written explanation layer needs a provider and key configured, which can be OpenAI, Anthropic, an OpenAI-compatible gateway or a local model. It supports 23 languages at two parse tiers; files in other languages are not indexed. The graft folder is a local cache added to gitignore, and only the wiring is committed. Graft sends anonymous usage stats, without code or paths, and it can be turned off.
How to disable. Run graft uninstall in the repository to remove every file and config entry init added. Remove the package globally with npm uninstall -g @nanonets/graft. Telemetry is turned off by graft telemetry disable or the DO_NOT_TRACK variable.
Security check
- Reads project sources and writes the graph folder and wiring files into the repo and agent configs
- The explanation layer sends file contents to the chosen model provider under your key
README in short
The README presents Graft as a context layer for coding agents and claims fewer tool calls, tokens and time at equal or better correctness, with measurements on its own harness and on SWE-bench Verified. Install is npm install -g @nanonets/graft and graft init, which builds the graph and wires the chosen agents. It explains the two-pass build, structural on tree-sitter with no key and an explanation layer through a model on your provider, and that the graph refreshes against the working tree before each query. It also covers the MCP server with six tools, the deep Claude Code integration via statusline and hooks, the CLI commands and support for 23 languages. MIT licensed.
FAQ
Do I need a language model key?
Not for the structural graph and search, they run on tree-sitter locally. A key is only needed for the graft build --deep explanation layer, and you choose the provider.
What goes into the repository?
The graft folder is gitignored as a local cache. Only the wiring init drops into .claude and the instruction files is committed, and each teammate runs graft build on their own.
Related
A skills library that gives coding agents a development process: brainstorming, planning, TDD, subagents and code review
Skills for real engineers by Matt Pocock
Skills For Real Engineers
Small composable skills for engineering with agents: plan grilling, TDD, bug diagnosis, code review and architecture
GitHub toolkit for spec-driven development: the specify CLI adds agent commands and skills to a project, from principles to implementation
Reference MCP servers
Model Context Protocol servers
Official reference MCP servers: Filesystem, Fetch, Git, Memory, Sequential Thinking, Time and Everything