Graft: Claude Code Hooks Cut grep Tokens by 42%

Graft (github.com/NanoNets/Graft) is a CLI tool that builds a persistent knowledge graph for coding agents like Claude Code, Cursor, Codex, and Gemini. It pre-computes codebase context so agents skip the repetitive grep-and-open exploration loop.
Concrete wins from the benchmark
- 42% token reduction (grep tokens specifically)
- 46% tool-call reduction
- 60% time savings
- Correctness jumps from 54% to 66% on SWE-bench Verified
The controlled benchmark ran 162 trials with the same agent and file tools — only the context differed. SWE-bench results were graded by the official harness.
Why it works
Coding agents re-explore the repo from scratch on every task. Graft builds an understanding once and writes it into your repo as a folder of linked markdown files — one node per system, API, or concept. These are real explanations, not symbol lists. No embeddings, no similarity search, no daemon.
Quick start
npm install -g @nanonets/graft
# install the CLI, once
graft init
# builds the graph + wires it into Claude Code
graft init asks which agents to wire up, builds graft/ from your code, and drops a statusline and hooks into .claude/. The graph is just files — commit it and teammates get it via git. Run graft init --dry-run to preview changes.
What you commit is the .claude/ wiring; each teammate runs graft build to generate their own graph. The graph is gitignored by default as a local cache.
Extra features
- MCP server for agent integration
- Deep Claude Code integration (statusline + hooks)
graft grepandgraft mapfor search and orientation- Monorepo and multi-repo support
graft vizfor browsing the graph- Works with Cursor, Codex, Gemini, and more
Who it's for: Teams using AI coding agents in large codebases who are tired of paying tokens for context they've already explored.
📖 Read the full source: HN AI Agents
👀 See Also

Attesor: AI-Powered Reverse Engineering of Rosetta 2 for Linux VM
Attesor is a GitHub project that uses AI to reverse-engineer Apple's Rosetta 2 binary translation technology, aiming to document its architecture and potentially enable x86_64-to-ARM64 translation on Linux virtual machines.

ClawMetry: Open-Source Observability Dashboard for OpenClaw Agents
ClawMetry is an open-source observability dashboard for OpenClaw agents that provides live session activity, token cost tracking, memory file change detection, and stuck session alerts. It runs locally with pip install clawmetry and was built using OpenClaw itself.

Message Your Other Claude Code Sessions: Cross-Session Messaging
Claude Code v2.1.224+ lets Claude send messages between your sessions to coordinate parallel work, share findings, and warn about breaking changes without you copy-pasting.

AI Roundtable: Tool for Comparing 200+ AI Models on Structured Questions
AI Roundtable is a free tool that lets users pose questions with defined answer options, select up to 50 models from a pool of 200+, and get structured responses under identical conditions. It also includes a debate feature where models can see each other's reasoning and a reviewer model that summarizes transcripts.