Guides · measured July 2026
More than half your AI coding bill is the agent looking for files.
Every coding session, your agent burns tokens hunting for the right file, reading directory listings and search dumps it forgets a turn later. On a real 4.47-million-file machine we measured it: about 58% of a session's tokens go to finding, not writing. Here are the practical ways to cut that bill, starting with the one lever that moves it most.
TL;DR · the short version
About 58% of a coding session's tokens go to the agent finding files, not writing them, measured on a real 4.47M-file machine.
Five hygiene levers (thinking level, model size, lean context, a stable cache prefix, naming the path) each trim a few percent of overhead.
The sixth lever removes it: hand the agent a prebuilt index and the file-hunting share of the bill drops from ~58% to ~0%.
One content query that cost ripgrep 93.8 s returns in 16 ms, 58,625× faster; a full agent file-find falls from 6m 57s across 71 tool calls to 16 ms in one.
Everything local is free, forever: the app, whole-machine search, MCP. Hosting starts at $5.99/mo.
Six ways to spend fewer tokens, by impact
Five trim the bill. One halves it.
None of these is a trick. They are the honest set of things that lower what a coding agent costs you per session, ordered by how much they actually move the number. The first five are good hygiene worth a few percent each. The sixth is infrastructure, and it is the one worth measuring.
Turn extended thinking down when you don't need it.
Reasoning tokens are billed like every other token. A one-line rename does not need maximum thinking: save the deep reasoning for real design work and let routine edits run light.
Right-size the model.
Use the cheap fast model for boilerplate and mechanical edits; keep the top model for architecture. Paying premium rates for a find-and-replace is money you never get back.
Prune the standing context.
Every line of CLAUDE.md and every pre-pasted file is re-sent on each turn, not just the first. A lean prompt is cheaper on every single turn of the session.
Keep the cacheable prefix stable.
Prompt caching discounts the repeated head of a conversation, but only while it does not change. Editing or reordering early context throws the discount away.
Say where, not just what.
“the auth guard in packages/api” costs fewer turns (and fewer tokens) than “find the auth guard.” A path is the cheapest hint you can give an agent.
Stop the agent grepping: give it an index.
This is the big one. The five above trim overhead; this one removes it. The agent stops shelling out to scan the disk and asks a prebuilt index instead. The rest of this page measures it.
One real session, measured
Where a session's tokens actually go.
One file-find request on the benchmark machine, resolved to a single content query. With no index the agent reached for its shell tools and ground through it, streaming file trees and match output into the context window on every turn. With the same request answered by a prebuilt index, the file-hunting tokens went to about zero. Same model, same machine, same work. Here is what moved.
Tokens spent grepping are tokens not spent reasoning, and on a metered plan they are dollars, on a subscription they are how fast you hit your usage cap. Even the simplest version of this task (one file, searched by name) took the agent 193.5 s of blind walking; the index returns it in 85 µs, a single lookup that is 2,276,000× faster on its own. The bill did not shrink because the model got cheaper. It shrank because the agent stopped paying to search.
Anchor 1 · Claude Code
Claude Code's cheapest search tool still scans the disk. And bills you for the dump.
ripgrep is genuinely excellent software, one of the fastest greps ever written. But a grep has no index; it re-walks the directory tree and re-reads the bytes on every single query. When Claude Code needs to search content it shells out to ripgrep, grep, find or Glob, and the match output flows back into the context window. Because the growing context is re-sent on the next turn (prompt caching discounts that, it does not erase it) a fat search result is a cost you keep paying. On the benchmark machine one heavy content query took ripgrep 93.8 s; the same query against a prebuilt index returned in 16 ms, 58,625× faster across the five-query set (5.6 ms mean).
This is not ripgrep losing at its job: it is a scanner doing a scanner's work, and returning a scanner's output. Speed is only half the win; the other half is that an index returns the answer, not the haystack. Right tool for one open folder. Wrong tool to run hundreds of times an hour across a whole machine, paying for the dump each time.
Anchor 2 · Claude Max
A bigger plan raises the ceiling. It doesn't lower the floor.
Claude Max keeps the strongest model in the loop and lifts your usage limits, often worth every dollar for the reasoning. But the retrieval layer underneath is identical on Free, Pro and Max: the same find, grep, ripgrep and Glob. Upgrading the plan does not shrink the ~58% of each session that drains into file hunting. It just lets you burn through more of it before you hit a wall.
Put the other way around: because more than half of every session is search, a usage cap runs out more than twice as fast as it would if the agent were not grepping. Fix the floor and the same plan stretches more than twice as far. Keep Max for the thinking; fix the floor for the bill. They are different layers, and the index is the neutral one every plan plugs into.
What Max changes
Model quality in the loop
Higher usage limits
Deeper reasoning per turn
What it doesn't
How files are found
The grep-the-disk floor
The ~58% search tax
The sixth lever, measured
Hand the agent an index. The search line item goes to zero.
Interlinked keeps an always-fresh index of every file on the machine (names and contents, every repo, the git-ignored files a cwd grep never sees, documents included) and exposes it to any agent over MCP. One signed install auto-configures 19 AI clients, Claude Code among them, with no JSON editing. Filename lookups land at 85 µs (139 µs median across 20 queries, median, not best case); content in ~7 to 9 ms. A save is searchable in about a millisecond, under 30 ms worst case, so the index never bills the agent to re-scan a file you just wrote. At rest the whole engine sits around 44 MB, and the index on disk stays under 1% of the drive.
The same index carries a knowledge vault that rides along on the searches the agent already runs, with no model in the loop, so it adds nothing to your token bill. On a fresh machine it found 12 of 12 repos and replayed 8,455 git events in 1.7 s into 26,958 relationship pairs, no failures. Notes any agent leaves on a file are handed to the next agent automatically. Speed finds the file; the vault knows why it matters, and neither one spends a token of yours.
ONE INSTALL · 19 AI CLIENTS · CLAUDE CODE, CURSOR, CODEX, COPILOT, WINDSURF, ZED AND THE REST.
Common questions
Before you install. Straight answers.
The honest version of what people ask before letting an agent search an index instead of the disk.
Does this add another AI, model, or API key to my stack?
No. There is no LLM, no embeddings, and no keys: just a prebuilt index and a path/id match, answered locally in milliseconds. Nothing leaves the machine, and nothing is added to your token bill.
ripgrep and grep are already fast. Why replace them?
They are excellent, but a grep has no index: it re-walks the tree and re-reads the bytes on every query, and the match dump lands in a context window that is re-sent every turn. On the benchmark machine one heavy content query took ripgrep 93.8 s; the same query against the index returns in 16 ms, 58,625× faster.
How much does file-hunting actually cost per session?
About 58% of a session's tokens on the machine we measured. Handing the agent an index takes that file-hunting share from ~58% to ~0%, and drops one real file-find from 6m 57s across 71 tool calls to 16 ms in a single call.
Will it slow down my machine or eat memory?
At rest the whole engine sits around 44 MB, less than a browser tab. A file you just saved is searchable in about a millisecond, so the agent never pays to re-scan work you just wrote.
What does it cost, and does it work with Claude Code?
Everything local is free forever, no card. Hosting starts at $5.99/mo, and one signed install auto-configures 19 AI clients, Claude Code among them.
Do this today
Cut the biggest line item in one install.
Install once. One signed installer wires up 19 AI clients: Claude Code, Cursor, Codex, Copilot, Windsurf, Zed and the rest. No config, no keys.
Let it index. Filename search works immediately; content fills in behind it. At rest the whole engine sits around 44 MB, less than a browser tab.
Point it at a path when you can. Whole-machine when you don't know where something lives; scoped to a folder when you do. Scoped queries return in microseconds.
Stop pre-pasting file trees. Let the agent ask the index instead of dumping the disk into context. That is the move that takes the ~58% search tax down to ~0%.
Everything local is free forever, on all your devices, no card. Hosting starts at $5.99/mo. Download for Windows.
Related reading: the token cost of file hunting, making Claude Code faster, and content search vs ripgrep.