Berkeley and Illinois study finds agent costs come from context reads and tool calls
UC Berkeley and the University of Illinois Urbana-Champaign analyze agent cost and build Agency, a layer that cuts cost without changing the model.
Reading the context an agent already holds can account for up to 73% of its total cost, even with prompt caching turned on, according to a paper from UC Berkeley and the University of Illinois Urbana-Champaign. The authors also built Agency, a layer that sits between a harness such as Claude Code or OpenAI Codex and the model. It cuts cost without changing the model. Their five proof-of-concept techniques reduce cost by up to 35% with marginal accuracy loss, according to the paper's abstract.
The starting observation is that the harness, the software that gives an LLM access to a computing environment, matters more for cost than for accuracy. According to the abstract, system prompts and tools change task accuracy little but can change the cost of an execution by up to 2.6 times on the same model and task. So the authors analyzed how cost accumulates across agent traces instead of focusing on which model gets picked.
The analysis points to several places where cost builds up. Each LLM call re-reads the accumulated context, so the same earlier text is paid for again on every turn. That re-reading accounts for up to 73% of total cost. Tool calls add cost without adding tokens to the context. Agents use only 27% of tool outputs on average, so most of what tools return goes unused. In retrieval-heavy tasks, up to 89% of turns can go to searching the filesystem. The paper also found that agent traces contain 1.3 to 2.7 independent subtasks on average that could run concurrently, which reduces how much context each subtask has to share.
Agency is described as a harness interposition platform. It offers one abstraction over off-the-shelf harnesses, so an optimization written once can run across harnesses and models. It can monitor and modify context, tools and the environment. The techniques are described as deterministic, and they do not require manual session resets or models trained to drop context.
The 35% figure is an upper bound across the real-world benchmarks the authors used. The abstract gives no per-benchmark breakdown and describes the accuracy loss only as marginal.
What changed
The Agency layer sits between agent harnesses and the model to cut agent cost by up to 35% without changing the model, with the authors finding repeated context reads account for up to 73% of total cost.
Type: Research · Applies to: Claude Code, OpenAI Codex
Why it matters
Companies running agents may find much of their bill comes from repeated context reads and extra tool calls, which can be optimized without switching models.
What you can do
When agent costs grow, check repeated context reads and unused tool calls before switching models.
Original source
Where we saw it
DAIR.AI (Elvis Saravia)
AI wrote this summary from the sources listed, and nobody reviewed it individually before publication. Check the original source before you rely on it. How it works