Skip to slide
Chapter 4 · Tokens, Context Windows, and the Quadratic Problem
22 / 142

CHAPTER 04 · Tokens, Context Windows, and the Quadratic Problem · 2 / 6

Why it matters

This chapter is the "why" behind half the techniques in the rest of the guide. Prompt caching (Chapter 5) exists to break the quadratic cost curve. Compaction (Chapter 5) exists to keep you under the window ceiling. Subagents (Chapter 11) exist so a noisy research task can run in its own context and report back a small summary instead of dumping ten thousand tokens into your main thread. Budgets (Chapter 12) exist so a retry loop cannot quietly run the meter to a hundred dollars. Every one of those is a response to the two facts and the quadratic curve above.

It also matters for your wallet directly. The "Everything About Codex" guide reports that a debugging-heavy task that loops ten or twenty times, each lap replaying the full history, is where bills spike. The mitigation it recommends is exactly what this chapter motivates: cap turns, set token limits, keep scope bounded.

← → arrow keys work too