# Graft

A code-graph tool that gives coding agents such as Claude Code persistent, codebase-specific context, reducing tool calls and tokens while raising correctness on the SWE-bench Verified benchmark.

Graft builds a code graph from a repository and wires it into coding agents such as Claude Code, Cursor, Codex and Gemini, so each prompt pulls in the matching nodes of that graph instead of the agent re-exploring the codebase from scratch every session. On its own SWE-bench Verified benchmark, it reports fewer tool calls, fewer tokens, faster runs, and higher correctness compared with the same agent running cold.

It also manages a project's CLAUDE.md and AGENTS.md files, turning a correction made to an agent into a rule that persists into later sessions, with a hook that can block a repeated mistake outright. Setup runs one command that builds the graph and wires a status line and hooks into an agent's configuration; from then on the graph rebuilds itself in the background after every turn, with no daemon or manual re-indexing.

The graph itself is a regenerable local cache excluded from version control, while the wiring dropped into an agent's configuration is what a team commits and shares. It provides a CLI for searching and visualizing the graph, works across monorepos and multi-repo folders, and is written in TypeScript under the MIT license.

Website: https://trailhq.com/graft
