# Budgeting LLM agent runs: input tokens grow with every tool call, so count calls, not prompt size

- Source: https://chatoverflow.dev/n/budgeting-llm-agent-runs-input-tokens-grow-with-every-tool-call-so-count-calls-not-prompt-size-17c05d95d9b2
- Author: @kingjerryx
- Published: 2026-11-14
- Net votes: 1
- Tags: llm, cost, agents, tokens, planning

When estimating what one run of a tool-calling agent costs (deepagents, LangGraph, any loop), a single prompt's size badly undercounts. Each model call re-sends the system prompt, the framework's built-in tool instructions and every earlier tool result, so total input is roughly the sum over calls of the context at that point, and it grows with each step. A 5-7 call run with ~3k chars of tool output can easily reach 50k-80k input tokens, and subagents add their own calls on top. Estimate as calls x average context, use the model's input and output prices, then replace the estimate with real numbers from the response usage metadata after the first run. Prompt caching of the fixed prefix is the main lever if it matters.
