How to run the session
Week 4 closes Part II of the book and opens Part III, and the two chapters meet in one idea. Chapter 6 (Skills, Protocols, and Interoperability) finishes the agent’s workshop: a shelf of manuals the agent takes down only when a job calls for one (skills) and standard sockets in the wall (protocols). Chapter 7 (Managing the Context Window) names the discipline that every mechanism of Chapter 6 was already practicing: deciding, at each step, what lands on the desk. Chapter 6 ends by saying so, and the deck’s two halves are built so that the progressive-disclosure slide of the first half returns, under another name, in the four operations of the second. Both chapters are in the full book; the slides quote them verbatim where it matters, so students who have not bought the book can still follow the lecture.
The deck has 30 slides in two halves, split by section slides. Press N for presenter notes, F for fullscreen; slide numbers are deep links (deck.html#27 is the exercise). The PDF is the same deck, one slide per page, without notes.
Five slides are built to be answered by the room before you advance: slide 2 (every tool call succeeded; what is missing?), slide 6 (a hundred procedures in the standing prompt: how many tokens per call?), slide 11 (which layer is missing in three short cases?), slide 19 (one document, then the same document buried in two hundred pages: same answer?) and slide 22 (name the three failures in the scene before the chart appears). Slide 12 asks for a thirty-second calculation; let the room do it on paper.
Check before class that the links on slides 9 and 27 open with their inputs loaded: the skill token budget for the ten-skill library, and the context window budget planner with Chapter 2’s sketch and a growth of 1,000 tokens per step. Both tools run in the browser, need no account and no API key, and carry their inputs in the page address, so they work offline once cached. Slide 27 also plays the four-minute animated explainer Context rot and the four operations; load it before class and check the sound.
Timing (80 minutes)
| Segment | Slides | Minutes |
|---|---|---|
| Opening: every call succeeds and the work is wrong, objectives | 1–3 | 4 |
| Skills: the folder, the arithmetic, progressive disclosure, the description, three caveats with a quick budget run | 4–9 | 13 |
| The triad and protocols: which layer is missing, M×N, two kinds, the honest ledger | 10–14 | 10 |
| Inside a skill: five patterns, where good skills come from | 15–16 | 5 |
| Context engineering and context rot: the assembled window, the buried document, the attention budget, the soft limit | 17–21 | 10 |
| How context fails: the scene, the bedside chart, the clean-desk test | 22–23 | 6 |
| The four operations: the geometry, the table, all four in one run | 24–26 | 9 |
| In-class exercise: explainer, budget planner, debrief | 27 | 20 |
| Lab 3, recap, reading | 28–30 | 3 |
The plan fits the same 80-minute slot as weeks 1 to 3. The exercise is the tightest segment: about 4 minutes for the explainer, 10 for the planner and 6 for the debrief. In class, teams do only steps 1 to 3 and the sentence on doubling the window; steps 4 and 5 (the revised desk, and what it could lose) are written up afterward and submitted with Lab 3. Tell teams to run both windows before they write a single operation. The clean-desk test on slide 23 is assessed on the quiz; give it its minute. It sits after the four operations on purpose, so that slides 24–26 are fresh when teams assign them. For a 75-minute slot, cut slide 16 to one sentence and the explainer to its last two beats (from 02:55, “The four operations”). For a 90-minute slot, give the exercise 30 minutes, do steps 4 and 5 in class, and have one team present its revised desk.
Common misconceptions and how to address them
“A skill is just a long system prompt.” The standing prompt is the right home for one paragraph; the chapter keeps that role for the project-instructions file of Chapter 9. Follow the fix to its limit and you pay for every procedure on every call. A skill is the same expertise packaged so that it costs a menu line until a task calls for it. Slide 6’s arithmetic is the antidote; let the room do it.
“Progressive disclosure makes a large library free.” The chapter’s third caveat is “the menu itself is not free”: at about a hundred tokens a line (illustrative), a large installed library costs real context before any skill fires, and hundreds of near-identical descriptions recreate the too-many-tools confusion of week 3 one level up. In the quick run on slide 9, make students read both the percentage and the absolute size of the menu, for both library sizes.
“A well-written skill body will get used.” The body is invisible at the moment of choosing; only the menu line is on the desk. A vague description fails silently: no error, just an agent doing the task from general knowledge. The chapter calls the description “the highest-leverage sentence in the folder.”
“We need an integration, so we need another connector.” Teams routinely buy reach when they lack a procedure, and write procedures when they lack reach. Slide 11 drills the one diagnostic question.
“A protocol makes a connection safe.” A standard socket says nothing about what is plugged into it. Standardization lowers the cost of connecting to a stranger to one configuration line; “every socket is a door.” Week 9 takes it up; here, plant the sentence.
“Protocols are always the professional choice.” The chapter’s ledger: young and moving specs, drift at the far end, and the price of over-standardization. For one tightly coupled integration you control, a direct call is simpler, faster and easier to debug. Protocols earn their ceremony with many connections and third-party reuse.
“A bigger context window fixes context problems.” Context rot is a slope that begins long before the window is full; the advertised size “is a fact about storage.” The exercise compares two windows so that students see the line move and still arrive.
“Forty percent is the limit.” It is a practitioners’ rule of thumb that the book offers “as an illustration.” The soft limit moves with the model and the task, and the only trustworthy way to find it is to measure. Every slide that shows the number labels it.
“If the agent got something wrong, append a correction.” For a poisoned context, appending a correction “merely places truth and falsehood on the same desk and asks the model to referee,” which is a clash. The cure is removal (prune) or a fresh start.
“Context engineering is prompt engineering with a new name.” Scope, dynamics and duration all differ: a prompt is one component of a nine-component desk, it is written once where context is assembled by code on every call, and the curation never concludes. The book’s own source is careful to call the newer discipline an evolution, “not better and not worse”; do not let students turn it into a ranking.
“Curate everything as hard as possible.” Over-curation is a disease the chapter names: prune too eagerly and the fact is gone; compress too hard and the constraint that mattered silently drops. “The trade is always recall against focus.” Most tasks need only the two cheap moves, which Lab 3 builds.
“Let the agent write its own skills.” The evidence is a caution: curated skills can substantially improve success rates while self-generated ones may degrade them. It is week 3’s self-grading problem one level up. Let the agent draft, and let something that is not the agent decide.
Materials and notes for instructors
All eight figures named in the syllabus for this week are on the slides (Chapter 6: skills, tools and protocols; progressive disclosure; the M×N protocol; skill patterns. Chapter 7: context assembly; the attention lamp; the five failure modes; the four operations) and are available individually on the diagrams page. Numbers on the slides are the book’s and are labeled illustrative or sourced: the hundred-token menu line (one published guide’s illustration) and the couple-of-thousand-token body (the chapter’s own estimate), fifty skills at several thousand tokens (one implementation’s arithmetic), eighteen models, 46 versus 19 tools, the 39 percent drop for sharded instructions, the hundred thousand tokens of history (one system), and the forty percent ceiling (a rule of thumb). Window sizes in the exercise are hypothetical round numbers, not any model’s.
Protocols appear the way the chapter presents them: as categories, each with one labeled example (a tool protocol such as the Model Context Protocol; an agent-to-agent protocol such as Agent2Agent). No slide teaches a protocol’s syntax, a vendor’s skill format or a framework’s configuration; the skill folder is described as one widespread convention, and Lab 3 lets students choose their own layout.
The figures’ inner labels are small when projected; each figure opens full size from the diagrams page, which is worth a second browser tab for slides 7, 12, 18 and 20.
Note for slide 18: the context-assembly figure draws eight slices; the chapter’s inventory counts nine components “give or take,” the ninth being worked examples. The budget planner in the exercise has all nine.
The answers to the in-lecture checks (slides 6, 9, 11 and 12), the expected numbers for the exercise and the Lab 3 key are in the instructor pack.
Exercises
In class: context rot, then budget a desk (teams of three, 20 minutes)
The whole room watches the animated explainer Context rot and the four operations (about four minutes). Then each team opens the context window budget planner (the link loads the inputs below; teams can also type them). The planner runs in the browser, needs no account and no API key, and labels which parts of its arithmetic are the book’s and which are its own.
The desk is Chapter 2’s sketch, “with made-up but realistic numbers”: standing instructions 500 tokens, conversation so far 8,000, two fetched documents 40,000, the latest tool result 3,000. Each loop pass adds about 1,000 tokens. The utilization ceiling is the illustrative 40 percent.
- Type a window of 200,000 tokens (a hypothetical round number). Record utilization, the steps until the pile crosses the ceiling, and the steps until the hard limit. Copy the result as Markdown.
- Change the window to 100,000 tokens and record the same three numbers. Copy the result again.
- Assign one of the four operations (write, select, compress, isolate) to each of the four components on the desk, with one concrete move for each (“documents: select, keep the file paths and load one section when a step needs it”). The planner sometimes suggests two verbs for a component; choose the one that does the most work and say why in a clause.
- In one sentence: what did doubling the window buy, and what did it not buy?
After class, as a written note submitted with Lab 3:
- Apply your moves: type the token counts you estimate after them, with one sentence of assumptions, and re-run at 100,000 tokens. Copy the result.
- Name one thing your revised desk could lose, and the symptom that would tell you it did.
Submit: in class, the two Markdown exports (200,000 and 100,000) with steps 3 and 4; with Lab 3, the revised export and a short note with steps 5 and 6.
Acceptance criteria:
- Both windows are run with Chapter 2’s four counts, a growth of 1,000 per step and a 40 percent ceiling; the numbers in the note match the exports.
- Each of the four components has exactly one of Chapter 7’s four verbs and a concrete move, and the note says which move is one of the “two cheap moves” the chapter recommends first.
- The revised desk states its assumptions in one sentence, and its export shows how many steps remain before the ceiling at 100,000 tokens.
- The note names what the revision could lose and the symptom (in the vocabulary of the five failure modes, or a concrete observable behavior) that would reveal the loss.
- The step 4 sentence says what doubling the window bought and what it did not.
Lab 3: a skill folder, tool-result trimming and a progress file (individual, about 4 hours)
Extend your Lab 2 agent (scripted model client, structured errors, a verifier that decides “done”). No paid API is needed; optionally, also run it against a local open-weight model.
- Package one procedure as a skill folder. Choose a procedure your agent keeps needing (for the greeting project: changing user-facing text and keeping the tests in step). The folder holds a main file whose header carries a
nameand adescription(what the skill does, then when to use it, in the third person, with the words a user would type), followed by a body of instructions under a few hundred lines; one reference file; and one script. The layout is yours. One widespread convention, as an example, is a main file with a metadata header and sibling folders for references and scripts. - Load it progressively. Only the menu line (name and description) of each installed skill sits in the standing context. The body enters the history only when the model asks for it; the reference file only when the model asks for that file; the script is executed by the harness and only its output enters the history, never its source.
- Trim tool results. Once a tool result has been acted on (the model has replied after seeing it), replace its payload in the history with a one-line stub: which call it was, what it found, and how to fetch it again. Keep the most recent results whole. Keep the full transcript in a separate log for debugging.
- Write a progress file. Give the agent a tool that records progress (done, next, decisions) in a file, re-read into the context on every call. Once a step’s outcome is in the progress file, steps older than a window you choose may be dropped from the history the model sees.
- Keep the Lab 2 guarantees: structured errors,
MAX_STEPSwith a loudstopped, and “done” decided by the verifier.
Acceptance criteria:
- A scripted-client test of a run of at least 30 model calls in which the estimated size of every request (characters divided by four is enough; say it is an estimate) stays under a bound you state, and the same script with trimming and the window turned off exceeds that bound.
- The size stops growing: in that run, the largest request among calls 21 to 30 is no larger than the largest among calls 11 to 20 plus a margin you state (5 percent is plenty). The same holds in a second run in which the model never calls the progress tool; if your window waits for progress updates, it needs a fallback for a model that never writes one.
- A test that the skill’s body is absent from every request before the model loads it, that the reference file is absent until requested, and that the script’s source never appears in any request although its output does.
- A test that a trimmed result keeps its call’s
id(the call and its result still pair up), carries a re-fetch hint, and that the full payload is still in the log; and that the result the model is about to read is never trimmed. - A test that the progress file is written through a tool call and that its current content is in every request after the first write.
- A test that a fact produced by a step that has been dropped from the history is still present in the last request, through the progress file.
- The skill’s description is run through the description check of the skill token budget with no ✗ result; any ◐ is answered in one sentence in your README.
- The Lab 1 and Lab 2 guarantees still hold. No network calls and no paid API anywhere in the test suite.
Reading quiz (before week 5)
A short quiz on Chapters 6 and 7 covering the four objectives: assign four shortfalls to the missing layer; compute an adapter count with and without a protocol and name the three costs; name failure modes from symptoms; assign operations to a desk inventory.
Reading for week 5: Chapter 8, Retrieval and Knowledge, Chapter 9, Memory: Working State Across Long Runs and Chapter 10, Workflows and Composition Patterns (all in the full book).
This week's answer keys.
The reading quiz with its key, exam questions with worked answers, and the solution to this week's exercises and lab, in the free instructor pack. You get the link as soon as you confirm your email.