Manuscript Offprint

arXiv:2608.25399

Can your AI agent be cheaper? Investigating the effects of task specifications on token spend in agentic coding tasks

Jakub Smékal

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Agentic coding workflows are now widely deployed in real-world systems. With long-horizon reasoning and tool use, token usage has become an important consideration for both cost and efficiency. Two engineers using AI will solve the same problem differently. How the specification of a task shapes an agent's token spend, and whether that spend can be predicted in advance, are open questions. Here, we study the effects of different task specifications on agentic token spend with the Kimi K3 model at three thinking efforts. Across 2,700 runs, we show that reducing a full task specification to a bare user story raises token spend by 29.7%, while run-to-run variance remains unaffected by any prompt changes. We show that prompt-sensitivity is task-dependent, running from 13% to 115%. We fit a simple predictor that can price a full distribution of task specifications and thinking effort configurations from a single cheap probe on an unseen task within 36%, improving over prior work in predicting token spend. Our work provides initial results quantifying the effects of task specification on agentic token spend and introduces a method that can be used to systematically evaluate the cost of AI coding workflows.

1 Introduction

Token spend has become a central consideration in deploying agentic coding systems. Rising model capability unlocks longer-horizon autonomy, in which an agent works from a single task description without further human supervision. Recent work shows that agentic token usage is both large relative to single-shot use and inherently stochastic: two identical runs of the same prompt can differ by a factor of 30 in tokens [4].

Studies of agentic spend have varied the model, holding each task’s problem statement fixed [4]. A separate line of work has varied the prompt, but only its surface form, holding its meaning constant [17, 18]. The effect of a specific task description on token spend remains largely unmeasured. This poses two questions for practitioners:

  • To what extent is token spend controllable through the task specification and the thinking effort setting?

• To what extent is token spend predictable on a previously unseen task?

We hold the model fixed and vary the prompt. We construct a distribution of task specifications for a set of agentic coding tasks from SWE-bench Verified [6, 11], bounded by an oracle specification that hands the agent the fix and a raw prompt of unstructured failing-test output, with structured variants in between that strip either most of the specification or one section at a time. Every specification is run at three thinking efforts, and each is repeated multiple times to estimate run-to-run token spread. Our results are summarized as follows:

  • The prompt moves the mean. Cutting a full specification down to a plain prose description of the problem raises token spend by 29.7% and turns to success by 16.4%, in the same direction on every task we measure.

  • The prompt does not move the variance. Rerunning an identical specification produces ×1.34\times 1.34 spread in token spend, and no specification we tested widens or narrows it.

  • The cost distribution is cheaply predictable. A single probe run costing eleven cents on an unseen task predicts its spend across every other specification and thinking effort to typically 36%, against 161% with no measurement at all.

The rest of the paper describes our experimental methodology and results in greater detail. Section 3 describes how we construct a set of task specifications and our experimental setup, and Section 4 presents our findings analyzing and predicting agentic token spend. We conclude with a discussion of takeaways for practitioners deploying agentic coding workflows.

References (20)