Your token bill is the cheap part: dimensioning the real cost of an agent

Everyone budgets the token bill because the provider hands you an invoice for it. But an agent in production spends across five other axes that never show up on that invoice — wall-clock latency, orchestration, tool-call fees, human review, and idle polling — and for a lot of workloads the tokens are the smallest line. A model that sums all six so you can see which one you’re actually paying.

July 14, 2026 · 7 min · 1471 words · Loop & Retry

Why a long agent run costs O(N²) tokens — and how to flatten it

A naive agent’s token bill doesn’t grow with the number of steps — it grows with the square of them, because every step re-reads the whole transcript that every previous step appended to. A small cost model shows the curve, and four structural moves turn the quadratic back into something close to linear without dropping information the agent actually needs.

July 13, 2026 · 6 min · 1145 words · Loop & Retry

The context window is a cache, not a memory

Treating the context window as append-only memory is how agents get slow, expensive, and quietly wrong. The fix is to run it like a cache with a budget and an eviction policy: decide what earns its tokens every turn. Here’s the cost math, the accuracy failure mode, and a working context manager.

July 7, 2026 · 9 min · 1826 words · Loop & Retry

Retry budgets: why 20% per-step failure doubles your token bill

Retries feel cheap and local. In a multi-step agent they’re neither. A small cost model shows why 20% per-step failure can more than double your bill — and how your recovery architecture, not your failure rate, decides the multiplier.

July 5, 2026 · 8 min · 1528 words · Loop & Retry