Tommy Tran
Author directory2026
Where the Tokens Go: A Measured Anatomy of LLM Agent Trajectory Costs
Tommy Tran
Proceedings of the Second Workshop for REsearch on Agent Language Models (REALM 2026)
Tommy Tran
Proceedings of the Second Workshop for REsearch on Agent Language Models (REALM 2026)
Tool-using agents repeatedly transmit prompts and conversation history, but aggregate token counts obscure which components drive cost. We introduce a five-component accounting convention for append-only agent loops, using provider usage records and fixed-prefix token-count probes without a local tokenizer. With prompt caching disabled, in 954 episodes (4891 requests) from one claude-haiku-4-5-20251001 model across three synthetic task families, the recurring fixed prefix accounts for 76.6% of baseline input tokens. Tool schemas contribute 69.1%, echoed assistant output 6.5%, and the tool-result residual, including framing, 16.9%. A descriptive fit to continuing episodes gives per-step input growth of about 363 tokens; longer-horizon cost ratios are extrapolations. Across the same 144 tasks, family-informed tool pruning reduces mean cost by 24.1% with a success difference of -1.4 percentage points (paired 95% CI [-3.5, 0.0]). A rolling history window saves 2.0% with identical observed outcomes. Truncating results at 600 characters reduces success from 98.6% to 47.2% while more than doubling mean cost alongside longer unsuccessful episodes. These findings apply to the tested model, mock tools, and short horizons. The accompanying package reproduces the analysis from frozen usage logs and prefix counts.