Graft Claude Code Token Savings: Is 42% Real?
Graft reports 42% fewer tokens in Claude Code. We verify its price, benchmark limits, Claude rates, and the buyer test that matters.
By AI Pricing Guru Editorial Team
AI Pricing Guru articles are maintained by the editorial workflow behind the site: daily pricing snapshots, provider source checks, and review passes for model launches, subscription limits, and billing changes.
TL;DR
- Graft is an MIT-licensed local CLI with no published subscription or per-token fee; the public npm package was version 0.10.1 when checked.
- The 42% figure is Graft's vendor-run 162-run benchmark: mean tokens fell from 8,070 to 4,650, while its reported mean direct model cost fell 32% from $0.0429 to $0.0292 per task.
- The result is not a universal grep discount, and the repository does not publish the raw 162-run logs needed for an independent reanalysis.
- Claude Sonnet 5 pricing remains $2 input, $0.20 cache read, $2.50 five-minute cache write, $4 one-hour cache write, and $10 output per million tokens.
Current API cost for a fixed token workload
USD per 1M tokens. Input and output rates are charted separately.
Test your own token mix before accepting the 42% claim
Assumes 75% input tokens and 25% output tokens using current per-million rates.
Claude Sonnet 5
anthropic
$40.00
- Input share
- $15.00
- Output share
- $25.00
GPT-5.6 Sol
openai
$80.00
- Input share
- $30.00
- Output share
- $50.00
Claude Opus 5
anthropic
$100.00
- Input share
- $37.50
- Output share
- $62.50
Claude Fable 5
anthropic
$200.00
- Input share
- $75.00
- Output share
- $125.00
Current model rates—Graft changes context use, not the provider price
| Model | Provider | Input / 1M | Cached / 1M | Output / 1M |
|---|---|---|---|---|
| Claude Sonnet 5 | anthropic | $2.00 | $0.2 | $10.00 |
| Claude Opus 5 | anthropic | $5.00 | $0.5 | $25.00 |
| Claude Fable 5 | anthropic | $10.00 | $1.00 | $50.00 |
| GPT-5.6 Sol | openai | $4.00 | $0.4 | $20.00 |
Built from pricing.json at publish time.
Graft is a new open-source context layer for coding agents, and its headline is attractive: 42% fewer tokens for Claude Code. The number is real in the narrow sense that it appears in Graft’s published benchmark. It is not yet an independently reproduced result, a guaranteed discount, or evidence that every grep call becomes 42% cheaper.
The pricing boundary is equally important. Graft itself has no published subscription or metered token price. Its deterministic tree-sitter graph runs locally without a model call. Claude Code, Claude API usage, and optional deep graph enrichment still consume whatever paid plan allowance or provider API tokens the buyer already uses.
What Graft is and what it costs
Graft builds a local code graph, exposes search and dependency tools through MCP, and can install hooks for Claude Code and other coding agents. The structural build, check, and search path is local and deterministic. The project says it sends no telemetry.
The official repository is public under the MIT License, and the npm package is publicly downloadable. When checked on August 14, npm’s latest tag returned 0.10.1, while the repository’s package.json and changelog already declared 0.11.0. Buyers should record the exact installed version instead of assuming the default npm tag matches the current source tree.
There are three different costs to separate:
| Cost layer | Current treatment | What the buyer pays |
|---|---|---|
| Graft structural graph | Local, deterministic, MIT-licensed | Machine time and maintenance, no published Graft fee |
Optional --deep enrichment | Uses the buyer’s configured model provider | Normal API tokens at that provider’s rate |
| Claude Code task execution | Uses Claude plan allowance or API-style billing, depending on the route | Existing Claude plan or model cost |
This is why Graft should not receive a model row in our canonical pricing dataset or public pricing API. It is a context tool, not a new Claude model, endpoint, or rate card.
Where the 42% token claim comes from
Graft’s README describes a controlled sweep of 162 runs across two repositories. The harness used the same Claude Sonnet 5 agent and file tools in three variants: a cold baseline, a Graft bundle pushed into context, and a pull-based tool mode. Tasks covered single-file and multi-file questions with three trials each.
For the cold baseline versus the pushed Graft context, the published means are:
| Metric per task | Cold Claude Code | Claude Code with Graft | Reported change |
|---|---|---|---|
| Tokens | 8,070 | 4,650 | 42% lower |
| Direct model cost | $0.0429 | $0.0292 | 32% lower |
| Tool calls | 4.2 | 2.3 | 46% lower |
| Wall time | 39.8 seconds | 15.8 seconds | 60% lower |
| Correctness | 93% | 93% | No change |
The arithmetic behind the token headline checks out: (8,070 - 4,650) / 8,070 is about 42.4%. The cost reduction is smaller because total tokens are not a bill. Input, output, cache reads, and cache writes have different rates.
Graft also reports a separate 50-instance SWE-bench Verified comparison: 27/50 resolved without Graft and 33/50 with it, alongside 23% fewer tokens and 19% lower cost. The project says it used official SWE-bench images and the official grader.
That 12-point correctness gap is not statistically conclusive on 50 independent observations at conventional thresholds: a simple two-sided two-proportion test is about p=0.22. A paired test could be more informative, but the per-instance arm outcomes needed to run it are not published in the repository. The README’s broader “up to 4× cheaper” headline also comes from separate per-repository tasks; the controlled 162-run sweep reports a 32% mean cost reduction.
Both result sets are useful shortlist evidence. Both are still Graft-run studies. The repository publishes aggregate methodology and results in the README, but its current tree does not expose the raw 162-run transcripts, token ledgers, judge records, or a complete replay bundle. We therefore cannot independently recompute the aggregates or test sensitivity to task selection.
Why “42% fewer grep tokens” overstates the evidence
The Hacker News title compresses the result into “Claude Code hooks that cut grep tokens by 42%.” The published benchmark is broader. It measures mean task tokens after supplying a code graph, not a universal reduction in tokens produced by grep itself.
Graft may save context when an agent otherwise repeatedly opens files, follows imports, and searches for relationships. It can also add context up front, and the pull mode trades some speed for a different retrieval pattern. The outcome will depend on repository size, language support, task type, graph freshness, agent version, model, cache state, and whether the baseline was already given good repository instructions.
The honest claim is: Graft reports 42% lower mean token use in its 162-run Claude Sonnet 5 context benchmark. Anything broader needs an independent workload.
Current Claude pricing did not change
Anthropic’s official documentation still lists Claude Sonnet 5 at $2 per million input tokens, $0.20 per million cache reads, $2.50 per million five-minute cache writes, $4 per million one-hour cache writes, and $10 per million output tokens. Anthropic made the $2/$10 input/output rate permanent on August 10, cancelling the previously scheduled September increase.
Graft does not change those unit prices. If its context reduces the mix of billable tokens on a specific task, the task costs less. If optional deep enrichment adds provider calls, or a stale graph sends the agent down the wrong path, those costs must be added back.
Using Graft’s own mean cost figures, 100 benchmark-like tasks would move from about $4.29 to $2.92 in direct model cost, a $1.37 difference. That is an illustration of the vendor’s reported task mix, not a forecast for a production repository. Use the live table and calculator above with your actual input, cache-write, cache-read, and output counts.
What buyers should test
Run an A/B test on accepted work, not a demo prompt. Pin the Graft version, Claude Code version, model snapshot, repository commit, hooks, permissions, and cache condition. Use at least 20 representative tasks split across bug fixes, cross-file changes, unfamiliar modules, and routine single-file work.
Start with graft init --dry-run and inspect every proposed file. Graft can write repository hooks and agent instructions; when Codex’s shared AGENTS.md host is selected, the documented default may also register user-level MCP and hook files. Use --no-global during the first repository-scoped evaluation if machine-wide configuration is not intended. Each teammate should build the local graph after cloning rather than committing the generated cache.
For each arm, record:
- input, cache-read, cache-write, and output tokens;
- direct model cost and any deep-enrichment calls;
- tool calls, latency, retries, and limit events;
- tests passed and whether the final change was accepted;
- setup, graph refresh, and maintenance time.
The best decision metric is cost per accepted change. A lower token total is not a win if review time rises or the agent misses dependent files. Conversely, a context tool can be valuable even when token savings are smaller than 42% if it improves blast-radius coverage or reduces failed loops.
Our AI Pricing Guru Labs leaderboard already prices Claude models on the same deterministic 49-task suite. Graft itself is not added as a model result because it changes the agent harness, not the underlying endpoint. A valid Graft study needs paired repository tasks, identical model and tool settings, raw usage records, accepted-change grading, and a separately measured indexing/enrichment cost.
Teams that want a separately metered coding route for comparison can also test the Z.ai coding plan on the same task set.
Affiliate disclosure: AI Pricing Guru may earn a commission from the sponsored Z.ai link at no extra cost to you. It does not affect this analysis.
Bottom line
Graft is a credible open-source experiment in reducing coding-agent rediscovery. Its published 42% token result is large enough to justify a test, and the project provides more methodology than a typical launch claim.
It is still a vendor result with a narrower scope than the Hacker News title suggests. Graft is free to download, not free to operate in every mode; Claude prices are unchanged; and the only defensible saving is the one reproduced on your repositories as cost per accepted change.
Sources: the official NanoNets/Graft repository, public npm package, Hacker News discussion, Anthropic’s Claude model pricing documentation, and the Claude Sonnet 5 announcement. Sources and prices checked August 14, 2026.