Re-Reading Is Not Free: Token Traces and Cache-Aware Energy Estimation for LLM Agents in Software Engineering

Researchers from TWT GmbH, the National Technical University of Athens, Harvard and others analyze ten weeks of real Claude Code use, nearly one billion tokens, and show that energy estimators which count only output tokens miss most of an agent's work.
Ask this paper
Workload. 42 sessions and 752 task episodes across six workstreams. Cached-context reads make up 94.8% of API-reported tokens and uncached input only 0.017%. About 260 cached tokens are read for every generated token.
Context growth. Context grows 5.3-fold over a session but only 1.4-fold within a task, so most context is carried over from earlier tasks.
Energy. A cache-aware estimator gives about 250 kWh for the workload, against about 10 kWh from the output-based EcoLogits estimator. No modeling assumption varied closes the 25-fold gap. Starting each task from a fresh context would lower the estimate by about 60%.
Subagents. Parent-session logs report only a subagent's final internal call, undercounting delegated tokens tenfold. Here that changes energy by about 5%, but token-volume studies are fully exposed to it.
Abstract
As large language models (LLMs) evolve from conversational assistants into autonomous agents embedded in software development workflows, estimating their environmental footprint requires moving beyond conventional token-based accounting. Existing energy estimators focus on isolated request-response interactions, overlooking the repeated processing of accumulated context, cache reuse, and work delegated to subagents. We analyze nearly one billion tokens collected across 42 sessions and 752 task episodes over ten weeks of real-world AI-assisted software development. Cached-context reads make up 94.8% of all API-reported tokens, while uncached input accounts for only 0.017%; for every generated token, approximately 260 cached tokens are read. Context grows 5.3-fold over a session compared with 1.4-fold within individual tasks. To quantify the energy implications, we extend an existing analytical inference-energy model to account for cached-context processing, yielding a cache-aware hybrid estimator. It estimates approximately 250 kWh for the workload, compared with approximately 10 kWh from the output-based estimator EcoLogits, a 25-fold difference largely driven by cached-context reads. Neither estimator has been validated on long cached contexts, but no modeling assumption we varied closes the gap. Starting each task from a fresh context would lower our estimate by about 60%. We also find that parent-session logs report only a subagent's final internal call, undercounting delegated tokens by a factor of ten; for this workload the correction changes the energy estimate by about 5%, but token-volume studies are fully exposed to it. Our findings expose a substantial gap between how current energy estimators and agentic workloads treat context, highlighting the need for workflow-level energy accounting that captures context accumulation, cache reuse, and delegated execution.