HeadlinesBriefing favicon HeadlinesBriefing.com

Graft: Turbocharge AI Coding Agents

Hacker News •
×

Graft is a new tool designed to "turbocharge" AI coding agents like Claude Code, Cursor, Codex, and Gemini by making them faster, cheaper, and more contextually aware of your specific codebase.

Currently, AI coding agents often start tasks "blind," re-exploring the entire codebase with each new request. This process consumes significant time, tokens, and latency. Graft addresses this by building a "graph" of your codebase once. This graph, stored as linked markdown files in the `graft/` directory, provides plain English explanations of system components and their interconnections, similar to how a senior engineer would explain it.

When integrated with an agent, Graft injects relevant nodes into prompts, allowing the agent to skip the redundant exploration phase. Benchmarks on SWE-bench Verified show that agents using Graft achieve higher correctness (66% vs. 54%) and significant improvements in token savings (23%), cost savings (19%), and wall-clock time (32%) compared to agents without Graft.

The setup is straightforward: install Graft via npm, run `graft init`, and it automatically wires the chosen agent, builds the graph, and integrates hooks. The graph is a local, regenerable cache, not intended for direct commit, ensuring teammates generate their own versions. Graft supports various LLM providers and uses tree-sitter for deterministic code parsing, ensuring the structural graph generation is model-agnostic.