Context Engineering · ~8 min
Twenty-three lessons collapse into one sentence and one habit. Here's the whole map, and how to use it.
Every technique in this course is one move toward a single goal, stated by Anthropic and worth memorising:
The context window is the agent's entire world — what isn't in it doesn't exist, and what is in it competes for a fixed pool of attention. So the whole discipline splits into three arenas:
The skill isn't memorising 24 techniques — it's recognising the symptom and reaching for the right one.
| When you notice… | Reach for | |
|---|---|---|
| The agent "forgot" a rule you wrote | Check position & layer; move it to an edge or restate | 02·06 |
| Output getting vague mid-session | You're in the dumb zone — compact now, don't wait for 95% | 01·04 |
| Window filling with tool output | Mask single-use outputs; offload big payloads | 09·10 |
| Long task drifting off-objective | Recite the goal at the tail; keep a todo.md | 12 |
| The agent looping on the same error | Preserve the trace (recovery), then break the doom loop | 12 |
| The bill / latency too high | Stabilise the prefix; static-first; watch cache_read | 07 |
| CLAUDE.md is bloated & ignored | Cut discoverable lines; compress to crisp rules | 05·08 |
| Coding against the wrong API version | Feed it the real versions / live docs | 15 |
| Exploration polluting the main thread | Delegate to a sub-agent; it returns a summary | 11·13 |
| A token optimization that "feels" right | A/B it on a real task before trusting it | 18 |
| A confident diff built on a wrong premise | Context poison — hard-reset, re-anchor on ground truth | 19 |
| External content following its own instructions | Injection — treat as untrusted; layer the defence | 19 |
| Window full but you don't know from what | Run /context; attribute, then fix the culprit | 20 |
| Agent writing generic, off-codebase code | Prime it: read broad→narrow before you ask | 21 |
| A long unattended loop's token bill exploding | Carry typed state outside the prompt; O(n²)→O(n) | 22 |
| Work marked "done" with sub-tasks unfinished | Context anxiety — give runway, counter-prompt, verify | 23 |
The whole discipline reduces to a habit. For every token you're about to add — a file, a rule, a tool result, a preloaded doc — ask:
"Does this improve output on this specific task?" If no, it's pollution — leave it out, fetch it later, or summarise it away.
Final review — mixed recall across the course
Question 1 · Lesson 01Output-quality degradation onset is best modeled as…
Question 2 · Lesson 07A cached-prefix read costs roughly…
Question 3 · Lesson 19Indirect prompt injection succeeds because the model is…
Question 4 · Lesson 22Typed state-carry bends a long loop's cost from…
Question 5 · Lesson 23An agent marking work "done" too early is showing…
audit-instruction-file + compress-prompt) turn this knowledge into tools you can run.