Skip to content

Claude Models, Prompting & Context Engineering

5 build exercises to practise the concepts in this domain.

2.1 — Write a Model Selection Dossier

Intermediate
45 minutes
  • How to characterise each pipeline stage by task shape, volume, latency tolerance, and quality bar
  • How to assign the smallest model tier that clears each measured bar
  • How to compute per-task unit economics for competing designs
  • How to design an escalation rule with triggers and expected escalation rate
  • How to write a lifecycle plan that keeps model changes eval-gated

2.2 — Redesign a One-Paragraph Prompt into a Layered Contract

Intermediate
45 minutes
  • How to write an explicit role, scope, and rule-conflict contract
  • How to design an output contract with a genuine escape hatch
  • How to structure a template with XML tags separating static and per-request content
  • How to place input-side and output-side guardrails around the model
  • How to pair every refusal rule with a fallback route

2.3 — Build a Technique-to-Failure Decision Table

Intermediate
45 minutes
  • How to classify production failures as format, boundary, reasoning, or rule-following
  • How to select the cheapest fix on the ladder for each failure class
  • How to design a diverse few-shot set with edge coverage
  • How to write a CoT variant with parseable reasoning, and judge when built-in thinking replaces it
  • How to price each technique at volume and decide what belongs in the cached prefix

2.4 — Write a Context Budget for a Long-Running Workflow

Advanced
45 minutes
  • How to break real request context into its component costs using the usage field
  • How to pre-flight requests with the token counting API
  • How to compute the replay bill and find the dominant cost line
  • How to match a management strategy to each context component
  • How to set guardrails: ceilings, compaction triggers, and overflow alerts

2.5 — Design the Reuse Layer for a High-Volume Endpoint

Advanced
45 minutes
  • How to order a prompt by stability and place the cache breakpoint
  • How to compute cache economics for both TTLs at real volume
  • How to refactor a prompt into shared modular sections
  • How to identify what belongs in a Skill rather than the system prompt
  • How to verify caching is active and alert on a collapsing hit rate