Show HN: Graft – Claude Code hooks that cut grep tokens by 42%
Coding agents start blind on every task, re-exploring the repository with grep, file opens, and import tracing. This repeated discovery burns most tool calls, tokens, and latency, and the knowledge is discarded after each session. Graft addresses this by building the codebase understanding once and reusing it across sessions.
Graft builds a graph of linked markdown files, one node per system, API, or concept, with real explanations rather than just symbol lists. It integrates via an MCP server or deep Claude Code integration, dropping hooks and a statusline into .claude/ so each prompt pulls matching nodes into context and rebuilds the graph in the background after each turn. The graph is stored as local files (like node_modules), regenerable and ignored by git, while only the wiring is shared with teammates.
In a controlled benchmark (162 runs, same agent and tools, only context differing), Graft reduced tool calls by 46%, tokens by 42%, and time by 60%, and was up to 4x cheaper and 3x faster. On SWE-bench Verified, the official harness showed Graft resolved 66% of instances vs Cold Claude Code's 54% (+12 points), with no loss of correctness.
Graft supports multiple coding agents (Claude Code, Cursor, Codex, Gemini) and includes CLI tools like graft grep and graft map for search and orientation, plus visualization. Users can start with npm install -g @nanonets/graft and graft init, with a --dry-run option to see file changes. This can significantly reduce AI coding costs and latency for teams working on large codebases.