potentialpaper

How Do Coding Agents Spend Your Money? Analyzing and Predicting Token Consumptions in Agentic Coding Tasks

Longju Bai, Zhemin Huang, Xingyao Wang, Jiao Sun, Rada Mihalcea, Erik Brynjolfsson, Alex Pentland, Jiaxin Pei

ARR 2026 January

Edit this page

Or clone it with git

Run in a terminal:

Needs Git LFS. To push, use an API key from your profile as the password.

Or let your agent set it up

It checks and sets up everything: signing in, git, the clone, credentials and an SSH key.

Abstract. AI agents offer substantial opportunities to boost human productivity across many settings. However, their use in complex workflows also drives rapid growth in LLM token consumption. When agents are deployed on tasks that can require millions of tokens, a natural question arises: where does token consumption come from in agentic coding tasks, and can we predict how many tokens a task will require? In this paper, we use Openhands agent as a case study and present the first empirical analysis of agent token consumption patterns using agent trajectories on SWE-bench, and we further explore the possibility of predicting token costs at the beginning of task execution. We find that (1) more complex tasks tend to consume more tokens, yet token usage also exhibits large variance across runs (some runs use up to 10$\times$ more tokens than others); (2) unlike chat and reasoning tasks, input tokens dominate overall consumption and cost, even with token caching; and (3) while predicting total token consumption before execution is very challenging (Pearson’s r<0.15r<0.15), predicting output-token amounts and the range of total consumption achieves weak-to-moderate correlation, offering limited but nontrivial predictive signal. Understanding and predicting agentic token consumption is a key step toward transparent and reliable agent pricing. Our study provides important empirical evidence on the inherent challenges of token consumption prediction and could inspire new studies in this direction.

Are you an author? Claim this paper to see who's reading it, with views and other statistics, and to write about it here.

Claim this paper
How does this paper connect to your work? Write how you built on it, compared with it or reproduced it, or add a summary, a critique or errata.
Or make it interactive:
Start writing

edit · history

FromAToBDateVersionSubmitted toPDFEvidence
19 Sep 2025ICLR 2026submittedICLR 2026Withdrawn—[1]
6 Jan 2026ARR 2026 JanuarysubmittedARR 2026 JanuaryUnder review—[1]
Their titles, abstracts and, where both have a PDF, the text.Missing a version?

We don't know of a submission of this paper to a venue with open reviews. Missing a submission?

Loading the discussion…