Autonomous agents now in closed beta. Get early access Bito Ai

The context layer your coding agent is missing 

Technical design in hours, not days 

78% of your AI coding bill is the agent looking for your code

Table of Contents

We ran a normal ten-turn session through a coding agent. The kind of afternoon a developer actually has. Trace a Slack event through Kafka into another service. Find where OAuth lives. Check whether a Jira integration already exists before building a new one. Add a field, wire up an error type.

The session cost $6.81, and $5.30 of that went to the agent grepping and reading files to find the code before it could do anything with it. 78% of the bill.

We ran the experiment five times, both configurations, to make sure the first result wasn’t a fluke. It held every time, so every number in this post is the average across the five sessions. Roughly three of every four dollars paid for the search.

Where the money actually goes

An agent starts every task knowing nothing about where your code lives. So it greps for a symbol, reads a file, follows a pointer into another file, opens three more, and only then starts answering. Everyone expects that part.

The part people miss is that the cost compounds. The agent works in a loop, and each step sends everything it has gathered so far back to the model. A file read on turn two is still riding along on turn twenty, billed as input every single time. So a wrong turn in the search doesn’t cost you once. You keep paying for it, turn after turn, until the session ends.

The usage records make this concrete. Over the baseline session the model generated about 44,000 tokens of actual answers. To produce them, it processed 5.3 million tokens of input. Almost all of that input was material the agent had already seen, resent on the next loop iteration: on average, every token the agent gathered got run back through the model about 50 times before the session was over.

And yes, prompt caching was on, with cached rereads billed at the discounted rate. The split below is what survives the discount.

CostShare
Searching / reading code$5.3078%
Everything else (the actual answers)$1.5122%

Most of what you pay a coding agent has nothing to do with reasoning about your problem. It’s the agent reconstructing where your code lives, from zero, every time you ask it something.

Same prompts, but the agent already knows where the code is

Then we reran the identical ten prompts with one change. The relevant code was handed to the agent up front, pulled from an index of the whole codebase, before it started working. No hunting for the OAuth flow, because the OAuth flow was already in front of it. No tracing across repos to find the Jira client.

Same prompts. Same model. Same caching.

Model callsTool callsFiles readTimeCost
Normal agent (searches for everything)631626225 min$6.81
Given the right context up front241438.5 min$1.13

Six times cheaper, in a third of the time. The work didn’t shrink. The agent answered the same ten questions, and answered them well. What got deleted was the search: 162 tool calls became 14, and 62 file reads became 3. Total tokens through the model dropped from 5.3 million to 1.4 million.

The gap was widest on cross-repo questions like “do we already have a git-provider integration we could reuse?” An agent on a laptop can only search what’s checked out on that laptop, so it either grinds through the local repos or answers “we don’t have one” while the integration sits in a repo three teams over. Given the index, the agent pointed straight at real code in git-provider and jira-insights. The developer had never cloned either repo.

The setup, because you should be suspicious of vendor benchmarks

Both configurations ran on Claude Sonnet 5 at high reasoning effort, identical settings on both sides, prompt caching on, n = 5 sessions per configuration. The per-question tables in the appendix are the averages across those five sessions.

Worth knowing: Sonnet is the cheap case here. Stronger models explore harder. Opus opens more files and runs longer search loops than Sonnet does before it commits to an answer, which means the search share of your bill grows with model tier. If your team runs Opus, this problem is bigger for you, not smaller.

The takeaway

If you’re paying for AI coding agents, most of the bill isn’t intelligence. It’s rediscovery, plus interest, as everything the agent read gets re-billed on every following turn. Hand the agent a map instead of making it draw one per request and the number that drops isn’t small.

That map is what Bito’s AI Architect builds. A live index of your whole codebase that resolves each question to the relevant code and feeds the agent exactly that span before it starts hunting. Same agent, same questions, a sixth of the cost.


Appendix: the data behind this post

Ten questions, five sessions per arm, Claude Sonnet 5; the numbers below are averages across the five. “Baseline” is a normal agent with the developer’s checked-out repos to read. “With context” is the same agent fed relevant code from an index of all the company’s repos before each question.

A “model call” is one round-trip to the model. A single question usually takes several, because the agent calls the model, the model asks to read a file, that read runs, and the model gets called again with the result. “Files read” counts the agent opening a file to look at it.

Baseline, the normal agent:

#QuestionModel callsTimeFiles readCost
1Trace a Slack event across repos to the consumer1128s11$0.81
2Trace the publish path in the Kafka service1159s3$0.20
3Do we have a git-provider integration to reuse?1289s20$1.74
4Do we have an OAuth impl to adapt?11161s3$0.47
5Do we have a Jira integration to reuse?1277s18$1.56
6Research: OAuth token storage best practices10111s2$0.45
7How does it decide transient vs permanent errors?557s2$0.30
8Plan: add “connect GitLab account”682s0$0.28
9Implement a new transient error kind11227s2$0.60
10Implement a traceId field through the pipeline6126s1$0.39
Total6325.3 min62$6.81

With context (Bito Governor):

#QuestionModel callsTimeFiles readCost
1Trace a Slack event across repos to the consumer132s0$0.25
2Trace the publish path in the Kafka service151s0$0.05
3Do we have a git-provider integration to reuse?147s0$0.05
4Do we have an OAuth impl to adapt?130s0$0.06
5Do we have a Jira integration to reuse?121s0$0.05
6Research: OAuth token storage best practices258s0$0.13
7How does it decide transient vs permanent errors?124s0$0.05
8Plan: add “connect GitLab account”121s0$0.06
9Implement a new transient error kind8169s2$0.21
10Implement a traceId field through the pipeline759s1$0.22
Total248.5 min3$1.13

Costs in this table are all-in: everything it takes to answer the question, against baseline’s $6.81.

Implication

Read the two “files read” columns against each other. The baseline opened 62 files across the session. The context agent opened 3, all on the last two questions, where it was writing code and needed to see the exact spot to edit. On the eight questions about understanding or finding code, the baseline read 59 files and the context agent read none.

The token ledger tells the same story from a different angle. Baseline: 5.3M tokens through the model to produce 44K tokens of answers. With context: 1.4M in, 10K out. In both arms the answers themselves are under 1% of the tokens processed. The bill is the ferrying, and the ferrying is what the index removes.

Questions 3 and 5 show the effect at its sharpest, the two “do we already have one of these?” questions. The baseline spent $1.74 and $1.56, opened around 20 files each, and ground through the local repos for nearly five minutes apiece. The context agent answered both in one model call, a nickel apiece, under a minute, because the code in question lived in repos the developer didn’t have checked out. It was handed the answer instead of failing to find it locally.

And notice where the context agent still spends: questions 9 and 10, the two that write code. Real model calls, a couple of file reads, because implementing a change means touching actual code no matter how much context you inject. That’s an honest boundary on the claim. The index collapses the search, and the search happens to be most of a normal session.

Picture of Amar Goel

Amar Goel

Bito’s Co-founder and CEO. Dedicated to helping developers innovate to lead the future. A serial entrepreneur, Amar previously founded PubMatic, a leading infrastructure provider for the digital advertising industry, in 2006, serving as the company’s first CEO. PubMatic went public in 2020 (NASDAQ: PUBM). He holds a master’s degree in Computer Science and a bachelor’s degree in Economics from Harvard University.

Picture of Amar Goel

Amar Goel

Amar is the Co-founder and CEO of Bito. With a background in software engineering and economics, Amar is a serial entrepreneur and has founded multiple companies including the publicly traded PubMatic and Komli Media.

Written by developers for developers red heart icon

This article is brought to you by the Bito team.

Latest posts

78% of your AI coding bill is the agent looking for your code

Code graphs explained for AI coding tools (2026 Guide)

The next big lever on AI spend sits between your coding agent and the model

Cursor’s limits on large codebases and monorepos

How Cursor’s codebase indexing works (2026 Guide) 

Top posts

78% of your AI coding bill is the agent looking for your code

Code graphs explained for AI coding tools (2026 Guide)

The next big lever on AI spend sits between your coding agent and the model

Cursor’s limits on large codebases and monorepos

How Cursor’s codebase indexing works (2026 Guide) 

From the blog

The latest industry news, interviews, technologies, and resources.

78% of your AI coding bill is the agent looking for your code

arrow bito ai

Code graphs explained for AI coding tools (2026 Guide)

arrow bito ai
The next big lever on AI spend

The next big lever on AI spend sits between your coding agent and the model

arrow bito ai