Quanta

← Back to Briefings

A 12,000-Token History Budget for Busy Agent Teams

Cost at volumeEN10 reads

For teams running long coding sessions, support workflows, or operational agents, conversation history can become a recurring expense. Each request may resend earlier instructions, messages, and tool results. The latest question might be short while the input behind it keeps growing.

The practical response is a history budget, not indiscriminate deletion. An illustrative ceiling of 12,000 tokens gives a team something concrete to enforce and test. It is not a universal recommendation: the right limit depends on task complexity, required evidence, and the model’s context capacity.

01 · Define what “flat costs” actually means

Trimming history can stabilize the history portion of input costs per request. It does not guarantee a flat invoice. Request volume, output length, model choice, tool activity, and cache behavior still affect spending.

Set separate limits for retained history, retrieved material, tool results, and generated output. Reserve room for system instructions and tool definitions before allocating history space. A bounded history is useful only when the rest of the request is also visible.

02 · Keep task state instead of a complete transcript

A transcript records everything that happened. A useful working context records what the next step needs. Separate persistent instructions from disposable conversational detail, and maintain a compact task-state summary.

  • › Preserve: the current objective, explicit constraints, approved decisions, unresolved questions, and necessary evidence.
  • › Retain recent exchanges: keep enough verbatim conversation to preserve references, corrections, and the immediate reasoning context.
  • › Remove first: repeated instructions, superseded plans, duplicate tool results, and irrelevant diagnostic output.
  • › Store elsewhere: full logs, large documents, and completed intermediate artifacts that can be retrieved when needed.

Do not turn uncertain observations into settled facts during summarization. Label assumptions and retain identifiers for supporting records. Keep authorization rules in trusted instructions rather than relying on a generated summary to preserve them.

03 · Trim before the budget becomes an emergency

Measure tokens while assembling each request. Start compaction below the hard ceiling so the summary and the next tool result have room to fit. Use the provider’s token-counting facility where available; otherwise, apply a conservative estimate and reconcile it against reported usage.

Prefer a stable summary plus a rolling window of recent exchanges. Rewrite the summary when the task changes materially, rather than after every message. Repeated summarization adds cost and can gradually distort details.

Preserve message structure during trimming. Tool calls and their corresponding results may need to remain together to satisfy provider requirements. Truncating arbitrary text is not equivalent to producing a valid, useful conversation.

04 · Protect cache value while reducing history

Stable prefixes can benefit from prompt caching where supported. Put reusable instructions and durable context before frequently changing material when the provider’s format allows it. Avoid rewriting the entire prefix for a small update.

However, caching is not free context. Quanta meters calls on real tokens, with cache writes and cache reads priced separately. Compare the cost of retaining cached material with the cost of summarizing and sending a smaller request. Cache eligibility, retention, and billing behavior can differ across models.

05 · Roll out the policy against quality and spend

Test the same trimming policy on representative workloads, including long debugging sessions and tasks that revisit earlier decisions. If your team uses Claude Sonnet 5.5 and GPT-6.1 Sol, validate each separately rather than assuming identical behavior.

Track input tokens, output tokens, cache writes, cache reads, summarization overhead, retries, and task completion. Review failures for missing constraints or lost evidence. A cheaper request that causes repeated recovery work may increase the total cost of finishing a task.

Quanta is a practical fit for teams managing sustained workloads across models through one pay-as-you-go balance. Open a Quanta account to evaluate your history policy with metered usage. Keep the rollout narrow initially, then expand once both spending and completion quality remain within your team’s targets.