Learn · Context management & reliability · CCAR-F task 5.1
Context is a budget, not a bucket
Long sessions lose facts in the middle. Keep a sourced case-facts block outside the history, trim tool output, and load the rest just in time.
Key ideas
- Context is a finite attention budget: recall drops as it fills, and the middle is read least reliably.
- Keep critical facts in a short, structured, sourced case-facts block that lives outside the summarised history and is re-injected each turn.
- Progressive summarisation blurs exact amounts, dates and promises; keep a structured issue list for multi-issue sessions.
- Trim tool output to the fields you need; context editing can clear old tool results.
- Use notes files, just-in-time retrieval, /compact (with focus instructions) and /clear between unrelated tasks.
- For long inputs, put a key-findings summary first and use section headers.
Worked example: Compacting with a focus
In Claude Code, /compact keep the API design decisions summarises the session while telling the summary what must survive. Auto-compact does the same near the limit; in the API, server-side compaction plays this role.
Exam traps
- Answering "the agent forgets the order number" with a bigger context window.
- Asking the user to repeat facts the agent already verified.
- Relying on a running summary for exact amounts and commitments.
- Pasting every tool field and document up front instead of loading just in time.
Official docs
Practise CCAR-F questions · Next lesson: Escalation and ambiguity