Most token budgeting conversations focus on output length, because output tokens are the ones that feel expensive and unpredictable. For an agent working against a codebase, that framing is backwards. The input dominates. A single agentic task in production can consume 15,000 to 1,000,000 or more tokens per request depending on how many steps it takes, while a single-turn chatbot reply sits in the 200 to 2,000 token band and a retrieval-augmented question with fetched documents lands in the 2,000 to 12,000 range per this token usage reference. The spread between those categories is roughly an order of magnitude at every boundary, and it is driven almost entirely by how much material gets pulled into the prompt.
There is a second reason to count before loading. Agents degrade with context length well before they hit the nominal window limit. After roughly 25 to 30 tool calls, even 200K-token windows show coherence problems, with models forgetting early results and re-executing completed steps as described in this survey of long-horizon agent planning. The same analysis notes that accuracy can drop 20 to 30 percentage points when relevant information sits in the middle of a long window rather than at its edges in this analysis of agentic task complexity. A codebase that technically fits is not automatically a codebase the agent can use well.
That is the practical argument for measuring input first: fitting is a necessary condition, not a sufficient one, and the gap between "fits" and "works" is where most of the wasted spend lives.



