Module 3 — Context Management

Context Management

The hardest engineering problem in production harnesses.

90
minutes
6
artifacts
Context is the model's working memory. When it fills, the agent loses track of its task — measurable, not theoretical. 30%+ mid-context drop (Lost in the Middle); a 256k quality cliff; history grows unboundedly. This module is the fight back.
Key Claims
Load-Bearing Claims

Position = attention (Lost in the Middle; priority stack)

History is the rot source (only unbounded layer; compaction targets it)

ACON: 26–54% reduction, 95%+ accuracy

3-tier JIT: index always, topic on demand, raw search-only

After This Module
01
Explain why context rots — the Lost-in-the-Middle effect, the 256k degradation cliff, and the token breakdown that makes tool outputs the dominant share.
02
Choose among the five context-management strategies (compaction, observation masking, JIT retrieval, note-taking, subagent delegation) and state the tradeoff each accepts.
03
Implement a compaction function that preserves decisions and current state while discarding verbose tool outputs.
04
Design the prompt-assembly priority stack and explain why anything placed early gets higher effective attention.
05
Diagnose a context-rot failure from token-usage logs and prescribe the correct intervention.
Artifacts