What matters in AI.

Subscribe

Context methods can increase coding agent cost by a maximum of 116%

Code that a tool finds cut read and search commands by 18 to 34%, but it increased cost by 33 to 42%.

Researchers measured the cost of 2 methods to control context for AI coding agents, in more than 20,000 runs of open models on 3 coding tests. A coding agent sends its full conversation to the model again and again. With prefix caching, the provider charges less for the start of an input that it has seen before. The tests used a cache price of one tenth.

The test setup

One method adds code that a tool finds to the prompt, to decrease search. The other removes used tool outputs, to make prompts with less text. The researchers counted uncached input, cached input and output independently.

The numbers

  • Added code: 18 to 34% less read and search commands, but 33 to 42% more cost. The tasks that agents finished did not increase in a way that the researchers could measure.
  • Removal of used outputs with no cache discount: 19 to 36% less cost.
  • The same method with a cache price of one tenth: 38 to 116% more cost.

The limits

Prompts with less text do not make runs with less cost, because agents can do more steps. Tests that operate at the same time can use the same cached prefixes and twist the cost. The tests used open models only.

Insight: Less text in the prompt can mean more cost

In October 2026, a test of 2,000 runs found that the lower cost of a tool almost went away for a full task. Vendors count tokens, but the cache price and the number of steps set the cost. The provider that sets the cache price reads as the one that controls who gets less cost. Teams that get these tools must find the cost of a full task.

Sources

  1. Context Has a Price: Adding and Removing Context for LLM Coding Agents under Prefix Cachingarxiv.org
AI MATTER · NEWS · AI MATTER · NEWS ·18 NOV2026

Posted

Tags

Learn the terms in this story

More in Research

All Research news