Book
Effective context engineering for AI agents
by Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, Jeremy Hadfield (Anthropic Engineering) · 2025 · 1 reading card
1 card
Effective context engineering for AI agents · 2025
Every new token spends attention budget; keep in context only what carries signal.
The official Claude Code best-practices guide (2026) starts from a single constraint: the window fills quickly, and performance degrades as it fills. The 2025 article gives the mechanism: models have an "attention budget" that every new token consumes, with diminishing returns — which is why a larger context is not automatically a better one. From this follow the techniques for long-horizon work: compaction (a faithful summary, then a fresh window), structured notes kept outside the window and re-read on demand, sub-agents with clean context for research whose condensed reports flow back into the main thread, and "just-in-time" loading: lightweight identifiers (paths, queries) instead of whole files. At the keyboard: /clear between unrelated tasks, /compact with instructions about what must survive, /btw for a side question that has no business staying in the history, command-line tools (gh, aws) instead of APIs with verbose responses, search and ranged reads instead of whole files, a status line that shows consumption. The right measure of productivity is not tokens per hour but tokens per finished task.
“Given that LLMs are constrained by a finite attention budget, good context engineering means finding the smallest possible set of high-signal tokens that maximize the likelihood of some desired outcome.”