Graft is a tool that generates a 'concept graph' to prevent AI coding assistants from having to re-explore the codebase every time, reducing grep token usage by 42%.
Imagine this: every time you talk to someone you just met, you have to explain the entirety of yesterday’s conversation from start to finish. It would be incredibly tiring and inefficient. Yet, this is the exact situation faced by the AI coding assistants we often use in our work. When we ask an AI to “fix this feature,” the assistant often has to re-scan the entire codebase from scratch, as if it lacked any memory.
| Recently, in the developer community Hacker News, a new tool called ‘Graft’ has garnered significant attention for drastically improving this inefficiency [Source: Show HN: Graft – Claude Code hooks that cut grep tokens by 42% | Hacker News](https://news.ycombinator.com/item?id=49299985). |
Why does this problem occur?
While AI coding assistants significantly boost developer productivity, there is one major hurdle: the cost referred to as ‘tokens.’ For an AI to answer a question, it must read and analyze the code, and the token cost incurred is determined by how much documentation the assistant reads.
For developers who frequently use ‘grep’ (a command to search for specific keywords within a codebase), the wasted tokens generated by the assistant re-searching the entire project every single time are immense. Graft reduces this unnecessary scanning process. Thanks to this, users can operate AI assistants much more cheaply and efficiently Source: Show HN:Graft —— 可将 Claude Code 的 grep token 消耗降低 42% 的….
A Simple Analogy: An Assistant with a ‘Map’
Let’s easily explain how Graft works. An AI assistant without Graft is like someone who is ‘directionally challenged’ and searches every single shelf in a library to find one book. On the other hand, an AI assistant equipped with Graft is like an expert holding a ‘Concept Graph’ of the entire library.
Graft pre-analyzes the code to draw a relationship map, much like a directory. Now, the assistant doesn’t need to read all the code; it can look at the map and read only the necessary parts Source: GitHub - NanoNets/Graft: Turbocharge Claude Code, Cursor ….
By doing this, the AI can immediately grasp, “Ah, this feature is connected to file A and file B,” sparing the effort of repeatedly scanning the whole project. Naturally, this also alleviates the ‘Context Amnesia’ problem where the AI loses the flow of the work Source: Show HN:Graft —— 可将 Claude Code 的 grep token 消耗降低 42% 的….
How can you introduce it?
Currently, Graft is spreading rapidly among developers using Claude Code. By entering a simple command, graft init, it connects to the coding agent currently in use to automatically begin analyzing code and constructing a graph Source: GitHub - NanoNets/Graft: Turbocharge Claude Code, Cursor ….
It has been verified through various technical sources that using grep commands can reduce token consumption by up to approximately 42% Source: Show HN:Graft —— 可将 Claude Code 的 grep token 消耗降低 42% 的…, Source: Best Show HN Projects Today — August 14, 2026.
| Of course, there are voices of concern. Some developers point out, “If the AI only views code through the fixed perspective of a pre-generated graph rather than viewing the code with ‘fresh eyes’ every time, the problem of ‘stale information’ could arise” [Source: Show HN: Graft – Claude Code hooks that cut grep tokens by 42% | Hacker News](https://news.ycombinator.com/item?id=49299985). The concern is that if the data refresh speed doesn’t keep up with the actual code modification speed, there is a risk of referencing incorrect information. |
Future Outlook
AI assistants are evolving beyond simply reading code toward understanding and managing the structure and relationships of code on their own. Graft is the first step in that direction. In the future, ‘intelligent memory management’ technology, where the AI learns the project structure and maintains the freshness of its memory without any separate settings by the user, is expected to become commonplace. For developers, the ability to manage the ‘efficient memory’ of AI is now becoming as important as the ‘intelligence’ of the AI itself.
MindTickleBytes’ AI Reporter Perspective
What is as important as the intelligence of the AI model itself is how efficiently that intelligence is utilized. Graft is a clever attempt to save on the ‘cost’ of tokens and secure the continuity of work by increasing the memory efficiency of AI. As AI becomes increasingly smarter, managing how well it remembers our code will become a core competency that determines developer productivity.
References
- GitHub - NanoNets/Graft: Turbocharge Claude Code, Cursor …
- Show HN:Graft —— 可将 Claude Code 的 grep token 消耗降低 42% 的…
-
[Show HN: Graft – Claude Code hooks that cut grep tokens by 42% Hacker News](https://news.ycombinator.com/item?id=49299985) - Best Show HN Projects Today — August 14, 2026
- Slow AI response times
- 'Context amnesia' caused by having to re-explore the codebase every time
- Errors in generated code
- Approximately 20%
- Approximately 42%
- Approximately 80%
- Security vulnerabilities
- Complexity of the setup process
- Potential for the generated graph to become stale data