What actually drives your Claude bill: cache misses, quadratic context, and prepaid retries

The per-token rate on Anthropic’s pricing page is real, but it’s the least useful number for predicting your actual invoice. Three multipliers move the bill far more than model choice does — a cache that silently misses, a transcript that grows quadratically with run length, and a best-of-N pattern that prepays for latency you may not need. Here’s the arithmetic on all three, combined, with real numbers.

August 20, 2026 · 8 min · 1565 words · Loop & Retry

Best-of-N is prepaid retries: the cost math of racing parallel attempts

Launching N attempts at once and keeping the first success feels like a free win over sequential retries — you trade money for tail latency, and money is supposedly the thing you have more of. It isn’t free, and it isn’t even always a trade: for the correlated failures that dominate real production incidents, best-of-N pays for N guaranteed-identical failures up front instead of stopping at one.

August 9, 2026 · 6 min · 1154 words · Loop & Retry

The transcript is a log, not an index: retrieval for long-running agents

Eviction and summarization keep a long-running agent’s window small, but the summaries themselves still accumulate in the linear transcript — and on a run long enough, that accumulation becomes the new quadratic. Past a few hundred steps, the fix isn’t a better compaction policy inside the window. It’s moving history out of the window entirely and querying it like a database instead of replaying it like a log.

August 5, 2026 · 7 min · 1348 words · Loop & Retry

Your timeout is a bet: pricing the tradeoff before you pick a number

Every per-step timeout is a number someone typed in without a model behind it — too short and you kill real work in flight, too long and you pay to sit idle waiting on a hang. Both mistakes are failure modes with a price tag. A small cost model finds the number that actually minimizes total cost instead of the one that felt safe.

July 18, 2026 · 6 min · 1235 words · Loop & Retry

Debugging a failed agent run costs more than the run itself

The cheap part of a failed agent run is running it again. The expensive part is that you can’t — the failure was non-deterministic, so the run that broke is gone, and you pay to summon it back. A cost model shows why reproduction, not repair, dominates your debugging bill, and why always-on tracing is almost always cheaper than the alternative it replaces.

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

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 · 8 min · 1534 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

Your agent's p99 is a different animal

Average latency is the number you demo and the number nobody experiences. A multi-step agent is a sum of random variables, so its total time is dominated by the tail of each step — and the more steps you add, the more certain it becomes that at least one of them is slow. Here’s the model, why the p99 of the whole is worse than the p99 of the parts, and the two levers that actually move it.

July 13, 2026 · 6 min · 1264 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 · 1651 words · Loop & Retry