Context Management — CCA-F Domain Five Through the Lens of the Budget
The window is a budget the model spends on your behalf without asking.
§ IFrame
The context window is a budget, and it is the only budget in this whole trio that the model spends on your behalf without asking. The frontend has a frame budget of 16.7 milliseconds and the render loop spends it. The page has a performance budget and the build spends it. An agent has a context budget — the tokens its model can attend to at once — and every tool result, every retrieved document, every prior turn spends against it, silently, until the budget is gone and the agent either truncates, forgets, or degrades.
Context Management is Domain Five of the Claude Certified Associate Foundations exam, weighted at fifteen percent. The exam treats it as a competence in its own right, not a footnote to prompting, because an agent that manages context badly fails in ways that look like the model being dumb when the model is merely starved. A long-running agent that loses the thread at turn forty did not get less capable. It ran out of budget and nobody managed the spend.
This is the third Sunday Anthropic-Day lesson. The first laid the agentic architecture (Domain One). The second built tool and MCP discipline (Domain Four). This one governs the resource every agent consumes and every tool result fills: the window itself.
§ IIDomain Foundations
Three foundations carry the domain.
Context is finite, and finitude is the whole subject. A model has a maximum number of tokens it can hold in one forward pass. That number is large now and growing, but it is fixed for any given call, and the cost of a call grows with how full the window is — in latency, in money, and in the model's own ability to find the relevant token among the irrelevant ones. A window stuffed to capacity is not a smarter agent; it is an agent looking for a needle in a larger haystack, and retrieval accuracy degrades as the haystack grows. AI Engineering names the agent's working state, its memory of what it has done and learned, as a first-class design concern precisely because the window cannot hold an unbounded history (Ch 6, pp. 329–330). Manage what goes in, or the model manages it for you by losing the middle.
The window has structure, and the structure has a cost gradient. Not all tokens in the window are equal in price. The system prompt and the early turns are stable across a session; the recent turns and the latest tool result change every call. This stability gradient is what prompt caching exploits: a provider can cache the processing of a stable prefix so it is not recomputed on every call, charging a fraction of the price for the cached portion and the full price only for the new tail (AI Engineering, Ch 9, pp. 467–469). Put the stable, reusable material — instructions, tool definitions, durable reference — at the front where it caches. Put the volatile material at the back.
Management is a set of operations on the window, not a single trick. Context management is the disciplined application of four operations: what to put in, what to leave out, what to compress, and what to fetch on demand. Selection decides what earns a place. Compaction compresses what has earned a place but no longer needs its full length. Retrieval fetches what was left out, only when it is needed. Isolation hands a bounded sub-task its own fresh window so the parent's window is not polluted. These four are the domain's working vocabulary, and the exam tests whether you know which operation a given failure calls for.
§ IIICCA-F Domain Coverage — The Four Operations
The exam's Domain Five questions reduce to recognizing which of the four operations a scenario demands.
Selection — earning a place in the window. The first discipline is refusing to put things in. A tool that returns a thousand-line file when the agent needed one function wasted nine hundred and ninety lines of budget. The fix is at the tool boundary, which ties directly to Domain Four: a well-designed tool returns the narrowest useful result, not its entire backing data. Selection also governs history; a turn that resolved cleanly and left no open thread can often be dropped from the active window entirely.
Compaction — compressing what stays. When a session runs long, the early turns hold information the agent still needs but in a form too verbose to keep at full length. Compaction replaces a span of turns with a summary that preserves the durable facts and discards the conversational scaffolding. The skill is choosing what survives the compression. AI Engineering's treatment of agent memory (Ch 6, pp. 329–330) frames this as the memory-consolidation problem: a durable record smaller than the raw transcript and faithful to the parts that matter.
Retrieval — fetching what was left out. Everything selection and compaction removed still exists somewhere; retrieval brings back the specific piece the current step needs. The discipline is just-in-time: fetch at the moment of need, use it, and let it leave the window when the step completes, rather than loading the whole corpus in advance.
Isolation — a fresh window for a bounded task. When a sub-task is self-contained, handing it its own fresh context keeps its intermediate work out of the parent's window. The sub-agent fills and spends its own budget, returns only its conclusion, and the parent's window receives the result without the thousand tokens of reasoning that produced it. The multi-agent structure is also a context-management structure, because every boundary between agents is a boundary between budgets.
§ IVThe Anthropic Academy Flavor — Practice Over the Window
The Sunday corpus is the free Anthropic Academy courses, and their context-management material is practical where the exam is conceptual. Lay the prompt out against the cache: stable content at the front, volatile at the back, because the front caches and the back does not (AI Engineering, Ch 9, pp. 467–469, with the chapter summary at p. 472 tying caching to the broader latency-and-cost picture). Over hundreds of calls in one session the cached prefix is the difference between a session that stays cheap and one whose per-call cost climbs as the window fills.
Treat compaction as a scheduled operation, not an emergency. The agent that compacts only when it hits the wall compacts badly, under pressure, losing context it did not have time to triage. The disciplined pattern compacts at natural boundaries while there is still budget to choose carefully what survives. And make memory explicit and external: the window is working memory; the store is long-term memory (Ch 6, pp. 329–330). An agent that writes its durable conclusions to a store and retrieves them on demand has a memory larger than any window.
§ VWorked Example — A Long-Running Research Agent
Trace the four operations through one session. The task: research a question across a large corpus and produce a cited brief, over dozens of tool calls that would overflow any window if managed naively.
At the start, selection governs the system prompt: instructions, tool definitions, and durable task framing go at the front where they cache. The corpus does not go in; it stays in the knowledge base, fetched on demand. As the agent works, each retrieval brings back the passages a step needs, the agent extracts the fact it wanted, and the raw passages leave the window when the step closes. After ten steps the window holds ten compact findings instead of ten thousand lines of document.
Halfway through, the session crosses a natural boundary: the first sub-question is answered. Compaction fires, replacing a dozen turns with a three-line summary holding the answer and its citations. A heavy sub-task arrives next — cross-check thirty sources for one contested claim. Isolation handles it: a sub-agent receives a fresh window and the thirty sources, does the comparison in its own budget, and returns one verdict. The parent never sees the comparison.
The brief ships. The agent ran dozens of calls and never overflowed, because every token earned its place through one of the four operations. The naive version — retrieve everything, keep every turn, no compaction, no isolation — hits the ceiling at turn fifteen and spends the rest of the session forgetting the beginning. Same model, same task. The difference is the budget was managed.
§ VIConnection to Today's Ops and Dev Lessons
The three lessons today are one idea at three scales, and the idea is the budget. The Dev lesson's frame budget is 16.7 milliseconds, kept by coalescing ticks and instancing draws. The Ops lesson's performance budget is bundle size and Core Web Vitals, kept by a regression gate that refuses the merge that overspends. This Cert lesson's context budget is the token window, kept by selection, compaction, retrieval, and isolation.
The structural rhyme is exact. Coalescing ticks into one render per frame is the frame-budget version of compacting turns into one summary. Instancing ten thousand draws into one GPU call is the render-budget version of isolating a sub-task into one returned verdict. The regression gate that compares a candidate against a baseline before merge is the discipline of refusing to spend a budget you have not measured. Three windows, one law: name the budget, measure the spend, refuse the work that overruns it.
§ VIIPractice Questions
§ VIIIClosing
Context Management is the discipline of treating the window as a budget and spending it on purpose. Four operations do the spending: selection earns a place, compaction compresses what stays, retrieval fetches what was left out, isolation gives a sub-task its own budget. Lay the stable material against the cache gradient and the budget is cheaper. Compact at boundaries and the budget is reclaimed before the wall. Push durable state to an external store and the agent's memory outlives any single window. An agent that manages its context does not get smarter; it stops getting dumber at the ceiling, which over a long session is the same thing seen from the other side.
Open the longest-running agent you operate. Find where its context fills. If it has no compaction step and no external memory store, it is forgetting the beginning of every long task by the end. Add the compaction boundary first.
Paired lessons → Ops 01-Earth-DevOps/.../2026-06-14-frontend-performance-budgets-... · Dev Polyglot-Dev/Web/2026-06-14-react-and-three-js-...
Filed 2026-06-14 Sunday Fajr · Third Anthropic-Day cert lesson · CCA-F Domain Five (Context Management, 15%)
Backward-Synergy-Reach → CCA-F Domain One (Sun 05-31) · CCA-F Domain Four (Sun 06-07) · today's Ops + Dev budget trio
HTML shipped in-cycle per HARD DISCIPLINE · aether-accent meta-card border per cert-prep series · 5 practice questions in q-card pattern · grounded AI Engineering Ch 6 + Ch 9