Writing / Tag / 16 of 77

Cost

Every essay tagged Cost, newest first.

Cost on this site means token spend you did not plan for. An agent that loops on the same tool seventy times, a memory store that keeps every junk observation, a fleet of agents nobody can count, a run that keeps working after the user has closed the tab. None of these are pricing problems. They are control problems, and the invoice is just where they surface.

So the essays here are mostly about putting a boundary where there was none: a deadline that propagates cancel down the whole tree, a no-progress guard that stops the loop, a per-tenant budget enforced before the call rather than after, a token budget for a long context window instead of filling it because it is there.

If you want one place to begin, read the tracing essay, because you cannot fix spend you cannot see. Then prompt prefix caching, which is usually the largest single saving, and the loop detection guard for the failure mode that bills you the fastest.

Read the guide: LLM Cost Optimization for Agents: A Production Guide

October 2026

7 essays / No. 56 to 73

September 2026

4 essays / No. 38 to 53

August 2026

3 essays / No. 23 to 32

July 2026

2 essays / No. 14 to 15