Lesson 3 of 6 · 4 min read
Clearing, Compaction and Notes
Long-running agents need context reduction, and the tools differ in how much they lose. Tool-result clearing replaces results already used with placeholders while keeping the record of each call. Notes move durable facts and progress out of the transcript into a small structured store the agent rereads. Compaction rewrites the conversation into a summary and is the lossiest, so it runs rarely, at deliberate boundaries, under a contract that names what must survive, and with a test that checks it did.
free sign-in, no card required
Practise it as an interviewer asks it
What is context engineering, and why does an agent need it when the model already has a 200k-token window?Your agent has a 200k-token window and falls apart at 55k. Why, and what do you change?Memory, context and retrieval: draw the difference for an assistant used for months.Find the right code in a two-million-line monorepo without flooding the context.Clearing tool results, compacting the history, writing notes: when does each one fit?Human approval may arrive three days later. Design the wait.