Why it matters

Token budgets shape long agent runs. Understanding shapes ops.

Advertisement

The architecture

Estimate budget: model max - system - reserve.

Track spent tokens.

Stop or summarize when near.

Token budget flowReserve budgetcontext windowTrack spentprompt + tools + outputSummarize / stopwhen near budgetSummarize history when running short; prioritize recent + important context
Token budget.
Advertisement

How it works end to end

Model max: 128k, 200k, 1M.

Reserve for output.

Summarize old context.

Prioritize important.