The Course

Domain 2 · 13% of the exam

The warehouse
and the forklift.

A model can only reason about what's on the warehouse floor. What you load, in what order, and what you leave on pre-staged pallets — that is context engineering. This episode makes you feel every token.

Objectives

What you’ll be able to do

  1. Select Claude models based on stated trade-offs
  2. Design system prompts, templates, and guardrails
  3. Apply zero-shot, few-shot, and chain-of-thought techniques
  4. Optimize context windows and manage token usage
  5. Reuse prompts via caching, modular blocks, and Skills

The story

The night the warehouse overflowed

Meera's claims system worked — until week six, when a broker attached a 900-page policy binder to a claim and the answers turned to mush. Her junior engineer, Theo, had been loading everything onto the warehouse floor: the whole binder, all prior conversation, every example he'd ever written. "More context is more accuracy," he said. The floor said otherwise.

Meera walked him to the loading dock. "The floor is huge — but it is a floor. Every container you place costs money to move and time to read. Load the rules of the warehouse first — the system prompt. Then the pallets you reuse every shift — stable content, pre-staged and cached. Then, and only then, tonight's shipment: the one claim we're deciding."

Theo re-ordered the floor: static prefix first, cache enabled, retrieval bringing only the binder pages that mattered. Cost fell by two-thirds. Time-to-first-token fell by more. And the answers sharpened — because the model stopped wading through containers it didn't need. The art isn't loading more. It's loading right.

Metaphor map

Images that stick

ConceptImageWhy it sticks
Context windowThe warehouse floorVast but finite. Everything the model reasons about must physically fit on it — nothing else exists.
TokensShipping containersThe unit everything is measured in. Every container costs money to place and time to read.
PromptThe forklift manifestWhat gets loaded, in what order. Ordering is a design decision, not an accident.
System promptRules at the doorRole, tone, boundaries — posted before any shipment arrives, persistent across every shift.
Prompt cachePre-staged palletsStable content staged once, reused every shift. Touch a pallet and everything behind it must be restaged.
Model tiersThe vehicle fleetBike, van, truck. Speed, cost, and capacity trade against each other — pick per route, not by pride.

Model selection

Model selection is a trade-off, not a ranking

The Claude family spans three tiers. The exam never asks "which is best" — it asks which is right for a stated constraint: latency, cost, or depth of reasoning.

Haiku

Fast tier

Smallest, fastest, cheapest. The bike courier: unbeatable through traffic with a light load.

Pick it for
high-volume, latency-critical, well-scoped tasks: routing, extraction, simple Q&A
Watch for
depth — complex multi-step reasoning is not its route

Sonnet

Balanced tier

The workhorse van. Strong reasoning at production-friendly speed and cost — the default for most systems.

Pick it for
the general case: agents, coding, analysis, RAG answers
Watch for
assume this unless a stated constraint pushes you off it

Opus

Capable tier

The heavy truck. Maximum reasoning depth for the problems that resist everything else.

Pick it for
hardest reasoning, high-stakes judgment, complex synthesis
Watch for
cost and latency — don’t send the truck for an envelope

In production

A support copilot, re-engineered

In production · banking

A support copilot, re-engineered

BEFORE
9k-token compliance prefix re-sent and re-billed on every request; agents waited seconds for the first word.
REORDER
Static content moved ahead of dynamic; prompt caching enabled on the stable prefix. No content changed — only order.
RIGHT-SIZE
Routine lookups routed to the fast tier; complex disputes escalated to the capable tier. One system, two vehicles.
AFTER
Input cost down roughly two-thirds; first token in a fraction of the time; identical answers on the eval set.

Storyboard

The film, shot by shot

01
8s

A model’s mind is not infinite. It is a floor — vast, lit, and finite.

Cameraslow aerial descent into an endless warehouse, grid of floor lights waking row by row
Motionfloor tiles illuminate in a wave; a 200k counter ticks up in the corner
Sounddeep hum, fluorescent flicker, soft tick per row
02
10s

Everything it will ever consider must be loaded. Container by container. Token by token.

Cameratracking shot alongside a forklift
Motioncontainers labeled SYSTEM, DOCS, EXAMPLES, HISTORY stack into distinct colored zones
Soundforklift beeps, container clunks in rhythm
03
12s

The amateur fills the floor. Watch what happens.

Cameratime-lapse from the rafters, 30° slow orbit
Motioncontainers pile chaotically; aisles vanish; a cost meter spins red; the picker slows to a crawl
Soundaccelerating clatter, alarm tone as aisles close
04
10s

The architect loads differently. Rules at the door. Pallets that never change, staged once.

Cameraclean push-in on the entry gate, then pan to a glowing pre-staged zone
MotionRULES sign bolts on; blue pallets shrink-wrap and glow green with a CACHED stamp
Soundbolt clicks, shrink-wrap hiss, warm chime on the stamp
05
10s

Now every shift starts warm. Only tonight’s shipment moves. Cost falls. The first word comes fast.

Camerasplit screen: cold floor vs warm floor, synchronized clocks
Motionleft forklift reloads everything; right floor already lit, one small container arrives; TTFT bars race
Soundleft: full loading din; right: single clunk, then quiet
06
10s

Three vehicles wait outside. The bike, the van, the truck. The route chooses the vehicle — never the ego.

Cameradolly across a loading dock at dusk, three silhouettes
Motionroute lines draw to each vehicle: dense city grid → bike; highway → van; mountain haul → truck
Soundbike bell, engine start, air brakes; cut to title card

Flashcards

Recall drill

Select a card to reveal the answer.

Quiz

Exam drill

Question 1

An application sends a 9,000-token static system prompt and policy document on every request, followed by a short varying user message. Latency and cost are both concerns. Which change most directly addresses both?

Question 2

A logistics firm classifies incoming emails into 40 routing categories. Zero-shot accuracy is mediocre: the model confuses adjacent categories whose difference is hard to describe in words. What should you try first?

Question 3

A long-running assistant’s conversation history grows without bound. By hour three, responses slow down, costs climb, and the model starts missing instructions given at the start. What is the architecturally sound fix?

Revision

Close your eyes and remember

The floor is huge, but it is a floor. Rules at the door, pallets pre-staged, tonight's shipment last. Right vehicle for the route. Loading right beats loading more.

Domain 2 · 13% of your exam

Next: Domain 3