Phase 2: Context Engineering for Builders · 45 min · Claude Code · Python
The Four Strategies: Write, Select, Compress, Isolate
Write what you'll need later. Select only what you need now. Compress what's aging. Isolate what shouldn't touch.
Hiring signal: Being able to name which of the four strategies fixes a specific context problem — not just 'manage context better' — is the kind of precise, applicable framework interviewers use to separate real context engineering experience from buzzword familiarity.
What you will learn
- Name and distinguish the four context engineering strategies: write, select, compress, isolate
- Match a specific context problem to the strategy that actually fixes it
- Implement a rolling-summary compression pattern that keeps recent turns raw and collapses older ones
- Implement tool description selection that filters a large tool set down to what's relevant for the current task
Introduction
The Four Strategies: Write, Select, Compress, Isolate
Two engineers each run a coding agent on a multi-day refactor. The first keeps everything in one continuous session: every tool call, every file read, every one of the project's 50 available tool definitions, the full raw transcript from day one. By day three, the agent is slow, expensive, and increasingly incoherent — it references decisions from hours ago incorrectly and seems to "forget" things stated clearly ninety minutes earlier, even though, technically, every word is still somewhere in the context. The second engineer runs the same refactor using four deliberate habits: notes worth keeping past the current turn get written to a file instead of staying in the live conversation; only the 4-5 tools relevant to the current step get surfaced, not all 50; older turns get collapsed into a short rolling summary instead of staying raw forever; and retrieved documentation is kept clearly separated from the agent's own instructions so the two are never confused. Same task, same total amount of information generated over three days. Wildly different outcome, because the second engineer applied context engineering as an active discipline instead of letting context accumulate as a byproduct.
LangChain's framework names these four habits precisely, and they map directly onto the four context types from the previous lesson.
Write: persist without keeping resident
Write means putting information somewhere durable — a scratchpad file, a memory store, a project file — instead of keeping it live in the context window indefinitely. The insight is that "available when needed" and "resident right now" are different requirements. A decision made on day one of a three-day refactor needs to be retrievable on day three; it doesn't need to occupy RAM continuously for 72 hours to be retrievable. Writing it to a durable scratchpad and reading it back only when relevant satisfies the real requirement at a fraction of the ongoing cost.
Unlock the full lesson
You've read the first 2 sections. The rest of this lesson covers Select: bring in only what's relevant now, Compress: trade raw detail for staying in budget, Isolate: keep different kinds of context from touching, Build It — plus a hands-on lab, quiz, and project artifact.
Create a free account to unlock Phase 0 and Phase 1 of every course — no credit card.
Browse all courses · View pricing · DeVenture Academy