Skip to content
Tech News
← Back to articles

Show HN: Graft – Claude Code hooks that cut grep tokens by 42%

read original more articles
Why This Matters

Graft is a tool that significantly reduces the redundancy and overhead in codebase exploration for AI coding agents by creating a persistent, local graph of the project. This enables faster, more efficient interactions, saving time and computational resources for developers and AI tools alike. Its implementation can streamline collaborative workflows and improve the responsiveness of AI-assisted coding environments.

Key Takeaways

Contents

Quick start

npm install -g @nanonets/graft # install the CLI, once graft init # build the graph + wire it into Claude Code

That is the whole setup. graft init asks which of your coding agents to wire up, builds graft/ from your code, and drops a statusline and hooks into .claude/ , so from the next session on Graft rides along in Claude Code: it pulls the matching nodes into each prompt and rebuilds the graph in the background after every turn. No daemon, no re-indexing to remember, nothing to run or maintain by default — the graph is just files.

Nothing is written until you pick. Run graft init --dry-run to see every file it would touch first, or graft init --agents claude to skip the prompt and wire Claude Code alone.

graft build adds graft/ to your .gitignore automatically — the graph is a local, regenerable cache (like node_modules ), not something you commit. What you share is the wiring init dropped into .claude/ ; each teammate runs graft build to generate their own graph:

git add .claude && git commit -m " wire in graft "

Prefer not to install globally? npx @nanonets/graft init works the same way.

The problem

Every task, your coding agent starts blind. Before it changes anything, it re-explores the repo: grep a term, open a file, follow an import, back out, try again. It is rebuilding a picture of a codebase it mapped an hour ago and threw away. That rediscovery burns most of a run's tool calls, tokens, and latency, and it is pure overhead:

... continue reading