Pruning, Compaction, Isolation & Progressive Disclosure
AdvancedOptimize the context window and manage token budgets · Difficulty 3/5
Explanation
Curation Techniques
Four complementary techniques curate the context window down to high-signal tokens:
| Technique | What it does |
|---|---|
| Pruning | Drop large or stale tool output that no longer informs the task |
| Compaction | Summarize older turns into a compact recap instead of carrying the full transcript |
| Isolation | Move heavy subtasks into a subagent with its own context window, keeping the main context clean |
| Progressive disclosure | Load information as it's needed rather than front-loading everything |
Isolation ties directly to multi-agent orchestration: rather than cramming a heavy exploration or research subtask into the primary agent's window, delegate it to a subagent whose own window absorbs the verbose intermediate work, and return only the distilled result. Progressive disclosure is the same discipline applied to information access more broadly -- it connects to the choice between progressive discovery and monolithic context in integration design.
Tracking Usage
Track the API response's usage field (input/output/cache tokens) to model cost per call and to catch context bloat before it hits the model's context-window budget. Usage tracking is the observable signal that tells an architect *when* pruning, compaction, or isolation is needed -- it is not itself a curation technique, but the instrumentation that triggers one.
Common exam traps
- Treating these four techniques as interchangeable. Pruning removes stale content, compaction condenses history, isolation moves work out of the main window entirely, and progressive disclosure controls what enters in the first place -- they solve different parts of the curation problem and are often used together.
Key Takeaways
- Pruning drops stale tool output; compaction summarizes older turns; isolation moves heavy subtasks into a subagent's own window; progressive disclosure loads information only as needed
- Isolation connects directly to subagent/orchestration design
- Track the usage field (input/output/cache tokens) to model cost and detect bloat before hitting the budget
- The four curation techniques solve different problems and are typically combined
Glossary Terms
The practice of actively reducing a conversation's token footprint so it fits within the model's context window without silent truncation. Encompasses multiple strategies — rolling window eviction, progressive summarization, external storage with retrieval, and prompt caching — each with different loss profiles and complexity trade-offs. Understanding this menu of options, and knowing what must never be compressed, is a core Domain 5 skill.
A context management approach that condenses older conversation turns or completed task phases into compact summaries, preserving essential conclusions while freeing token budget. Inherently lossy — never summarize active tool results, in-flight constraints, or partially completed tasks. One specific technique under the broader umbrella of [context compression](/glossary/context-compression).
A context management technique that retains only the N most recent conversation turns, evicting older turns as new ones arrive. Simple to implement with zero summarization overhead. Best deployed as a rolling-window+summary-header hybrid to prevent silent loss of early constraints or decisions. One specific technique under the broader umbrella of [context compression](/glossary/context-compression).
Related Concepts
Context Window as Shared Budget & Context Rot
The context window is one shared budget across system prompt, history, tools, results, retrieved docs, and the response
Prompt Caching & Stable-Prefix Ordering
A stable prefix (system prompt + policy + few-shot block) can be cached: reads are cheap, writes carry a slight premium