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

Custom status line for Claude Code shows context usage, rate limits, and token counts at a glance
A custom script adds a persistent status line to Claude Code, displaying context %, 5-hour rate limit %, KV cache reads, cumulative input/output tokens, model name, and working directory — color-coded for dark terminals.

Claude's Silent Drop-Off: The Action Layer Failure When AI Agents Hit Business Sites
Claude can read business sites (pricing, booking flows, forms) but fails at the action layer — booking, submitting, or routing — due to lack of callable endpoints. This causes invisible user drop-off with no analytics signal.

Kanwas: Open-source shared context board for teams and AI agents
Kanwas is an open-source multiplayer workspace where teams and AI agents share documents, evidence, and decisions on a canvas with live streaming tool calls. Self-hosted via Docker, it's git-backed with Yjs and BlockNote.
How I Feel About AI: A Developer's Honest Take on Reasoning, Doom, and the Open Web
A developer reflects on AI: gut-feeling LLMs with emergent reasoning, the threat of superintelligence, and the toll on the open web and artists.