← News

Agents & MCPSources: arXiv · 18 Nov 2026

Study finds context tricks can raise costs for LLM coding agents when caching applies

A measurement study of more than 20,000 agent runs reports that adding retrieved code or trimming old outputs often costs more, not less, once discounted cached input is priced in.

In plain words

Coding agents reuse their whole conversation with a language model on every step, and cached input tokens are billed at a lower rate. Researchers measured what happens when agents add retrieved code or delete old tool outputs. Both changes can backfire financially: shorter or better-informed prompts do not reliably mean cheaper runs.

What was announced

The arXiv paper treats context management as a cost-measurement problem, running open models on SWE-bench Verified, SWE-bench and Loc-Bench while billing uncached input, cached input and output tokens separately. In the main evidence-package experiments, retrieved code cut read and search commands by 18–34% but raised cost by 33–42% when cached input cost one tenth of the uncached rate, with no measurable improvement in resolution.

Removal showed mixed results: dropping old observations saved 19–36% without a cache discount but increased cost by 38–116% at the tenth-price cache. The authors also note that shorter prompts do not guarantee cheaper runs because agents may respond by taking more steps, and that concurrent experiments can share cached prefixes and distort cost comparisons. They argue context-management methods should be judged using both token prices and the agent's subsequent behavior.

What it does not show

  • The evidence is the paper's abstract only; full methodology, model choices and caveats are not available in the supplied passages.
  • Findings come from the authors' own runs of open models on three benchmarks and have not been independently confirmed.

For security and IT teams

Scope
The cost findings apply to coding-agent runs on SWE-bench Verified, SWE-bench and Loc-Bench with open models, under the paper's stated cache pricing assumptions.

Sources

Source-support review completed 19 Nov 2026. This story was drafted with AI assistance and checked against retained source passages. Automated checking is not independent verification.

Coverage: arXiv: abstract.

Updates and corrections

No corrections so far.

First published 19 Nov 2026

New to the subject? AI from the Ground Up starts from the beginning.