Save 75% on Claude Code: Open-Source Tool Optimizes Agent Memory
shhdwi · reddit · 2026-08-03
A developer shared an open-source tool called Graft that drastically reduces Claude Code costs by preventing the agent from repeatedly scanning the codebase.
How it works: The tool pre-scans the repository and saves its structure as a linked Markdown file in Git. Claude reads this file before executing tasks, avoiding the need for numerous tool calls to understand the context. It plugs natively into Claude Code's hooks system for fully automated operation.
Benchmark results (over 162 runs):
- 46% fewer tool calls
- Up to 4x fewer tokens consumed
- 60% less time spent
- Significant cost reductions, enabling Sonnet to achieve Opus-level performance.
Related event: Open-source tools map codebases to cut AI coding token waste(5 posts)→
More from coding & agent
- 'LLM code is sloppy' rebutted with real ffmpeg code: identical if/else branches in a top library — kingslyj · 2026-10-16
- Office-editing tool calls need file, worktree and unit: lessons from dsh-univer-office — FunDistribution6537 · 2026-10-16
- Architect MD workflow: Gemini one-shot outputs that beat Opus, via 5-lens plan critique — oikk01 · 2026-10-16
- Prove a coding agent actually ran the tests: check artifacts, not approvals — ComprehensiveShake76 · 2026-10-16
- Building an acceptance harness for AI spreadsheet edits: allowlists, recalc checks, idempotency — ukdicha-modakkk · 2026-10-16
- Agent actions need checks outside the model: NVIDIA demos lean on guardrails amid wave of real agent incidents — Creamy-And-Crowded · 2026-10-16