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

Read full text
Authors: Evgeny V. Arsentyev
Cited by: 1

Abstract

Version 1.1 (15 September 2026): correction of the modeled costs. Version 1.0 (DOI 10.5281/zenodo.22688706) priced the logged tokens with two errors. Both are the author's. Claude Fable 5 cache reads were priced at $0.25 per million tokens instead of $1.00. The $0.25 read rate applies only to Claude Fable 5.1, introduced on 1 September 2026. Every cache write was priced at the 5-minute rate (1.25× input), but the logs show mostly 1-hour writes, which are billed at 2× input. On machine B, 82.9% of cache-write tokens are 1-hour writes and 17.1% are 5-minute writes. On machine A, 100% are 1-hour writes after 15 August 2026, and earlier logs cannot be checked. Token counts, token composition, input amplification and the deduplication method are unchanged. Every dollar figure and every cost share changes. With all writes priced at the 1-hour rate: Context handling / generation: 87.8% / 12.2% (was 83.5% / 16.5%). With machine B's write-duration mix it is 87.6% / 12.4%, and if every write were a 5-minute write, 86.2% / 13.8%. Cache writes: 31.9% of cost (was 27.0%). Re-reading context costs 4.59× all output (was 3.42×). Modeled total: $34,977 (was $25,790; $30,794 if every write were a 5-minute write). Claude Opus 5: 49.9% of cost (was 60.5%). Claude Fable 5: 37.8% (was 25.3%). 80% of cost falls on about 21 of 722 sessions, or 2.9% (was 24, or 3.3%). Sessions over 200 calls (8.0% of sessions) carry about 92.8% of cost (was 92.2%). Both figures are estimates. The dataset does not record the model of each session: 446 of 722 sessions could be re-priced exactly, and the rest were scaled by corpus-wide ratios. The direction of the findings does not change: context handling remains the dominant cost, and its share rises under every write-duration assumption. The size of the corrected figures depends on how long cache writes were kept, which cannot be verified for part of machine A. This version contains the corrected report (PDF and REPORT.md), per-session cost estimates (session_costs_recomputed.json) and the recomputation scripts with their outputs (recompute-2026-09-15.zip). runs_final.json is unchanged, and its cost field keeps the version 1.0 rates. Price list: https://platform.claude.com/docs/en/about-claude/pricing (retrieved 15 September 2026). 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, 87.8% of modeled spend is context handling (re-reading cached conversation state and writing new state into the cache) and 12.2% is generation of new text. Re-reading context alone costs 4.59× 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 an estimated 21 of 722 sessions (2.9%), and sessions longer than 200 model calls — 8% of sessions — account for an estimated 92.8% of spend. Median session cost about $2.30 (estimate) against a mean of $48.44. 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.

Publication details

Journal / source
Zenodo (CERN European Organization for Nuclear Research)
Publication date
15 September 2026
Language
EN