← Research

Zenodo — technical report (not peer-reviewed)

The Context Economy of Agentic LLM Sessions: Where the Money Actually Goes

Evgenii Arsentev · ARSENTEV.AI · ORCID 0000-0002-9120-7298 · 2026-09-10

Abstract

A measurement of where token spend actually goes in agentic LLM coding sessions.

Agentic coding assistants are usually reasoned about as generators: the model writes code, and the code it writes is what you pay for. This report measures that assumption against a complete local log corpus of one practitioner's agentic work — 722 sessions, 150,902 model calls, 34.56 billion tokens — and finds it close to inverted.

Main findings.

Under published per-token API list rates, 83.5% of modeled spend is context handling (re-reading cached conversation state and writing new state into the cache) and 16.5% is generation of new text. Re-reading context alone costs 3.42× as much as everything the models produced.

Token counts are more extreme: 97.05% of billed tokens are cache reads, 2.57% cache writes, 0.38% output, 0.01% fresh input — roughly 256 tokens of cached context read back for every token generated.

Cost is highly concentrated: 80% of the total falls on 24 of 722 sessions (3.3%), and sessions longer than 200 model calls — 8% of sessions — account for 92.2% of spend. Median session cost $1.92 against a mean of $35.72.

A derived measure, input amplification (total input tokens billed in a session divided by that session's peak context size), has a median of 23.7×, a 90th percentile of 125.1× and a maximum of 4,182× (n = 590 sessions of at least three model calls): the same working state is paid for dozens of times over the life of a session.

Delegated sub-agent calls are 52% of all model calls, each carrying its own context and its own multiplier.

Method contribution. The report documents two non-obvious deduplication traps in streaming agent logs that change the answer by roughly a factor of two in each direction: one model call is written to disk as several records sharing a request identifier, input-side counters are repeated rather than incremental (a naive sum overstates total cost by 1.95×), and output_tokens is a cumulative snapshot of the stream rather than a per-record delta (so keeping the first record per request understates generation by about half). The correct reconstruction is an element-wise maximum over records grouped by requestId / message.id. Symlinked log directories are a further duplication hazard for per-file pipelines. The pipeline was implemented twice independently; the two totals agree to within 0.02%.

Limitations. This is a single-practitioner, single-toolchain case study rather than a sample of a population; it is observational, not experimental, so no causal claim is made about session policy or workflow changes. Dollar figures are a model applied to logs at today's list rates, not an invoice (the work ran under subscription plans). The observation window pools two different operating regimes across two machines. Long-context surcharges are not modeled, which biases the estimate downward in exactly the expensive tail. Only logs present on disk at collection time are included.

Data availability. An aggregated, de-identified dataset (runs_final.json, one record per session: hashed identifier, call counts, token counters by class, peak context, modeled cost) is published with the report, along with the four figures. It contains no session content — no prompts, model output, file paths, file contents, tool arguments, project identifiers or hostnames.

Keywords: large language models, agentic systems, AI coding agents, prompt caching, context window, cost analysis, token economics, telemetry, log analysis, software engineering economics, case study

Cite

@techreport{arsentev2026context,
  author      = {Arsentev, Evgenii},
  title       = {The Context Economy of Agentic LLM Sessions: Where the Money Actually Goes},
  institution = {ARSENTEV.AI},
  year        = {2026},
  doi         = {10.5281/zenodo.22688706},
  url         = {https://doi.org/10.5281/zenodo.22688706}
}