Mastering Claude: Efficient AI Workflows
Lecture 2

Navigating the Context Ocean

Mastering Claude: Efficient AI Workflows

Transcript

SPEAKER_1: Last time we landed on this idea that Claude is a reasoning engine, not a lookup tool. Now I want to get into the actual mechanics — specifically the context window. SPEAKER_2: Right. The context window is what Claude can see for a given response — the conversation messages plus any included files or tool outputs, all sharing one finite space. Tokens are the currency, and long prompts, big files, and tool results all spend from the same budget. SPEAKER_1: So what happens when someone just dumps a pile of documents in and hopes for the best? SPEAKER_2: Performance degrades — sometimes dramatically. Anthropic is direct about this: poorly structured or overloaded context can significantly degrade model performance even with a capable model. It's not a model problem. It's a design problem. SPEAKER_1: That's striking. For someone processing large organizational datasets, the instinct is to paste everything in. But that's counterproductive? SPEAKER_2: Exactly. Think of it like handing a researcher an unsorted room of filing cabinets versus a clearly labeled archive. Anthropic recommends structuring inputs into explicit sections — task description, constraints, examples, reference material — so the model knows which parts to prioritize. Without that, you get vague, hedged answers. SPEAKER_1: So structure is the fix. But what about stale information sitting in the window from earlier in a long session? SPEAKER_2: That's a real hazard. Anthropic specifically warns that leaving obsolete instructions or outdated state in context can actively mislead the model's reasoning. The practical move is splitting context into two layers: stable background knowledge stored in files — think specifications or style guides — and transient, task-specific state in the live conversation. SPEAKER_1: Two layers. So the stable stuff doesn't need to be re-pasted repeatedly, and the live conversation stays lean. How does the model handle the transient layer over a long session? SPEAKER_2: Summarization becomes a core technique. For long-running workflows, the guidance is to periodically distill previous steps into concise, structured notes and continue from those summaries rather than keeping full raw logs. It's like a navigator writing a position report instead of replaying the entire voyage. SPEAKER_1: Is there a more automated version of this — something built into the tooling itself? SPEAKER_2: Yes. Anthropic's context editing system lets agents programmatically decide which tool outputs to keep, which to summarize, and which to discard. It turns context management into part of the agent's logic. And the results are measurable — combining memory tools with context editing in Claude Code improved agent performance metrics by a substantial margin over a baseline without those mechanisms. SPEAKER_1: So there's a hierarchy here. What does that actually look like in practice? SPEAKER_2: For example, in Claude Code you can have a global memory file storing personal workflows and preferences across all projects. A project-level file then overrides or augments that for a specific task. Below that, short-term decision notes cover the current session. Each level has clear precedence, so the model has a clearer signal about what's authoritative. SPEAKER_1: That's almost like a filing system with inheritance rules. Now — what about skills? That term keeps coming up. SPEAKER_2: Skills are reusable, structured descriptions of capabilities — a security review process, say, or a competitive research protocol. The model can autonomously activate them when the current context matches. Martin Fowler's analysis of coding agents notes that this on-demand loading helps avoid overloading the context window with irrelevant details. SPEAKER_1: So instead of pasting the same instructions repeatedly, they live as a skill and get pulled in when the context calls for them. That's a real efficiency gain. SPEAKER_2: context engineering means treating rules, skills, memory files, and hooks as a formal system — not a collection of ad hoc prompts. Claude Code itself uses a plan-and-execute pattern, building a plan first, then executing in steps and writing intermediate results back to keep context manageable. Long sessions can checkpoint key information into files periodically, which reduces what Anthropic calls context drift. Remember: a well-architected context window is what separates a reliable workflow from one that slowly loses coherence.