Chapter 36Part 7 · The Implementation Playbook

Compaction and the Token Budget

Budget tokens like money, compact history without dropping commitments, and detect degradation before a user does.

What this chapter covers

Every long-running agent has a forgetting policy — most teams have simply never read theirs. This chapter turns the context window into a budget with named line items, and compaction into a designed transformation that protects decisions, commitments, and identifiers while summarising or discarding everything else.

Key takeaways

  • How to allocate a context window across instructions, tools, retrieval, history, and response headroom
  • The three tiers of conversation state: durable, compressible, and disposable
  • Why a bigger window worsens dilution instead of fixing it
  • Compaction triggers that work: occupancy thresholds and task milestones
  • The degradation probe that catches a forgetful agent before a customer does

Why it matters

Agents that stay coherent on turn fifty are not the ones with the biggest windows. They are the ones whose teams decided, on purpose, what to forget — and cut token cost per task while doing it.

Read the full chapter — unlock the book

The Context Advantage is a living guide for the agentic era. Chapters 1 – 3 are free. Everything else, plus future updates, templates, and resources, is included with the lifetime edition.

Already bought it on another browser? Open it here

Browse the full table of contents, or explore the four pillars — Context, Control, Cost, and Choice.