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

llmLibrarian: Local RAG Engine with MCP Integration for File-Based AI Search
llmLibrarian is a local RAG engine that exposes retrieval over MCP, allowing AI agents like Claude to query indexed files. It uses ChromaDB collections for organization, Ollama for synthesis, and keeps everything on-device.

Visual Prompting Framework Replaces Text Prompts with Single Image for Claude AI
The Carrying Capacity Principle v9 is a bidirectional structural framework that uses a single flowchart image instead of text prompts for Claude AI. It provides structural diagnosis or generative construction plans based on system parameters or goals.

Tripsy Launches MCP Server for Claude: Manage Trips via Structured API
Tripsy's official MCP server lets Claude directly read, create, and update trips, activities, stays, transportation, and expenses. Setup takes ~1 minute via Claude's custom connector.

Qwen3.6-27B as a Local Reasoning Layer: 2-Week Multi-Agent Test Results
A developer replaced Claude with local Qwen3.6-27B in a multi-agent orchestrator for 2 weeks across 47 workflows. Results: strong reasoning, 12% tool-call format errors, and 12k token context limit.