Github Top Trending Tool Just Fixed The AI Agent’s Biggest Problem

12:482 min readAI LABS09/08/2026Computing/Software

Key Takeaway

Graft eliminates redundant AI agent file searching by building a structural knowledge map, cutting token costs by 32 percent and task duration by 60 percent.

Highlights

  • High-end AI coding models burn through usage limits rapidly and slow down because they repeatedly search project files across multiple turns.

  • Graft builds a knowledge graph mapping code connections, reducing token usage by 42 percent and task execution time by 60 percent.

  • Graft operates as a terminal command that integrates with Claude Code and Codex without requiring a separate API key.

  • Vector search compares code meanings through similarity numbers, whereas Graft maps actual functional dependencies between files.

  • Graft updates its project map automatically when code changes without rebuilding the entire project from scratch.

Timeline

  1. Token Consumption and Search Limitations of AI Coding Agents

    Powerful models like Opus, GPT-5.6, and Fable 5.1 process vast amounts of context during simple tasks like locating buttons or files. Each search iteration appends tool results to the context window, causing performance degradation and premature usage limits. While vector search attempts to resolve this by matching semantic vectors, it frequently confuses functionally opposing code blocks like account creation versus deletion.

    • Advanced models exhaust token limits and execute slowly due to repetitive terminal searches.
    • Default agents send entire conversation histories and tool responses back to the model on every turn.
    • Vector search fails to map opposing functional relationships between similarly worded code sections.
  2. Architecture and Operation of Graft

    Graft functions as an open-source terminal command that maps project architecture without relying on external API keys or vector embeddings. It reads code directly to establish precise file dependencies, letting agents identify impacted code paths immediately. The CLI and MCP setups attach relevant file locations before tool execution, bypassing multi-turn search overhead.

    • Graft compiles a project knowledge graph containing nodes and edges to track functional code dependencies.
    • Benchmarks across 162 runs show a 46 percent reduction in tool usage and a 32 percent decrease in overall cost.
    • Graft stores the map locally as a JSON file and supplies matching file locations directly to the agent prompt.
  3. Installation, Workflow Integration, and Build Performance

    Running the init command within a project folder generates operational hooks that automatically update the knowledge map after file edits. Initial builds show modest efficiency gains, but subsequent project changes execute rapidly because the dependency map is already established. Non-code files remain outside the knowledge graph and rely on standard agent lookup methods.

    • Project initialization installs automated hooks that maintain map synchronization during file modifications.
    • Building a booking application with Fable 5.1 and Graft required 39 minutes compared to 47 minutes without Graft.
    • Graft exclusively maps code files, leaving text documents like product requirement documents to default processing methods.

Description

Claude skills are how Graft plugs into Claude Code, so this is also a Claude skills guide: what are Claude skills, how to use Claude skills, and Claude skills explained, on a tool that cuts the tokens your agent burns searching your project. Try Hedra at https://hedra.link/ailabs and use code AILABS50 for 50% off your first month. Community with All Resources: https://ailabspro.io/?v=mHIdsR_VSrM The Roundup, our daily newsletter covering the AI stories that matter. Join now: https://www.theroundup.so/ Graft: https://trailhq.com/graft WHY YOUR AGENT BURNS TOKENS BEFORE IT CHANGES ANYTHING - Coding agents search your project with terminal commands before every edit, and rarely find the right file on the first try - Every one of those turns resends your whole conversation plus all the earlier tool results - The context window grows, the model slows down, and you hit your usage limit sooner - Quality drops too, because there is too much in the window to focus on one thing - Worst on high end models like Opus, GPT Astra and Fable 5.1, where one task already takes a while WHAT IS CONTEXT ENGINEERING, AND WHY IT MATTERS HERE - Context engineering is deciding what actually reaches the model instead of letting the agent discover it from scratch - Graft's answer is a knowledge graph: a map of every part of your project and how the parts connect - Each part is a node, each link is an edge, saved as a JSON file with a browser viewer you can explore - Other tools use vector search, which matches by similarity, so "create an account" and "delete an account" both look right. The map records which part actually uses which CLAUDE CODE SKILLS, HOOKS, AND HOW GRAFT INSTALLS - How to add skills in Claude the easy way: the graft init command creates the skill inside your project folder for you - So if you have looked at how to create Claude skills, this is the version where the tool generates it - The skill tells the agent how to use Graft and which commands it has, which is what skills Claude loads at session start are for - It also installs hooks, and the video explains what a hook is: a small script that runs on its own at a set point - AI automation at the plumbing level: one hook hands over the instructions at session start, one attaches up to three matching locations to every prompt, one updates the map after Claude edits a file - For a project you already started, graft build maps the code that is already there HOW TO USE CLAUDE SKILLS LIKE THIS ONE IN A REAL PROJECT - Claude skills tutorial style walkthrough: copy the install command, or paste their setup prompt into your agent and let it install everything - Run init inside the folder you are working in, pick your coding agent, and the setup lands in that project - Works with Claude Code and Codex, and other AI agents that use terminal commands or MCP - There is an MCP option too. With hooks, Graft attaches locations to every message. With MCP, the agent asks only when it needs something. In their tests MCP got a few more answers right, the CLI was faster, and you get both - No separate API key, so it runs on your normal Claude AI subscription THE NUMBERS FROM THEIR BENCHMARK - Best case, four times cheaper in token usage - Across 162 runs: 60% less time, 46% fewer tool calls, 42% fewer tokens, 32% lower cost on average - The saving comes from searching the agent no longer does, so it pays off more the bigger the project WHAT HAPPENED WHEN WE BUILT A REAL APP WITH IT - A booking and scheduling app, like Calendly but for independent providers, built with Fable 5.1 twice, once with Graft and once without - With Graft: 39 minutes and about 31% of the context window. Without: 47 minutes and about 35%. Both apps worked - The gap widened after that. A full landing page revamp took under 2 minutes, then Graft updated the map and showed its estimate of the tokens saved - We started from a PRD and a claude.md tuned for long autonomous runs, and that template is in AI Labs Pro THE HONEST LIMITATION - Graft only maps code, so your PRD, area files and learnings.md are still read the old way - We modified it for projects with multiple plan files, and that version is in AI Labs Pro One of the best Claude skills is the one you never think about, and this is that kind of tool. If you build with AI tools every day and your agent eats your limit before it writes a line, this is the fix. More AI, Claude and Claude Code workflows every week. 0:00 Intro 0:55 Why agents burn tokens 3:34 What Graft does 5:29 Sponsor 6:23 How it works 8:17 Setup 10:04 Testing it #ai #claude #ClaudeCode #aiautomation #claudeai #aitools #aiagents #claudeskills

Write about this video