“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.”Prithvi Rajasekaran, Ethan Dixon, Carly Ryan, Jeremy Hadfield (Anthropic Engineering) · Effective context engineering for AI agents · 2025 · Effective context engineering for AI agents (Anthropic Engineering, 29 septembrie 2025) — secțiunea «The anatomy of effective context»
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.
The attention budget works like the working memory of a tired person. When someone tries to hold too many things at once, they do not become better informed, just more distracted. The model is the same: every log line or whole file read takes up space that is no longer available for instructions. So before any advanced technique comes a question of discipline: is this token worth it? A concrete case: instead of pasting an entire configuration file into the conversation, you paste only the line you care about. The rest is noise that pays rent. The next step is to see what actually happens when the window fills up anyway.
A filling window doesn't fail suddenly; it wears down quietly. The model never says "I forgot" — it just starts answering more superficially, ignoring old rules, fixing the wrong thing. It's like a desk buried in papers: you keep working, but finding anything gets harder. The first remedy is compaction: ask for a faithful summary of the session and restart the window from it, like a shift handover where someone leaves a note for the next person. Dead details go, key decisions stay. But a summary alone won't carry a full day of work — that's where notes kept outside the window come in.
Why it matters A session that "forgets" its instructions does not have a bad model; it has a full window.