Professional domain 2 · Claude models, prompting and context engineering
Choosing a model
| Model | Anthropic recommends it for |
|---|---|
| Claude Fable 5.1 | The highest available capability: agent sessions that run for hours, multistep deep research |
| Claude Opus 5.5 | Complex agentic coding and enterprise work |
| Claude Sonnet 5.5 | Speed and capability for everyday coding, agent and enterprise workloads |
| Claude Haiku 5.5 | The lowest latency and price: real-time and high-volume work, sub-agent tasks |
- Two ways to start: efficiency-first (begin with Haiku, test, move up only for capability gaps) or capability-first (begin with Opus, optimise, then lower the effort or move down). The decision factors are capability, speed, cost and effort.
- The effort setting trades thoroughness for tokens and latency:
low,medium,high,xhigh,max. Not every model supports it: Haiku 4.5 doesn't, andxhighis only on some models. Most supported models default tohigh; Opus 5.5 and Haiku 5.5 default tomedium. Lower it for simple, high-volume or latency-sensitive work and for subagents. - Model names change often. The exam tests the trade-off (capability against latency and cost), so learn the reasoning, not the line-up.
Prompts, templates and guardrails
- A system prompt sets the role, the rules, the output format and how to refuse. Templates keep the fixed part stable and put variables (user input, retrieved documents) in clearly marked places, for example in XML tags.
- Zero-shot for simple, well-specified tasks; few-shot (a few diverse examples, including hard cases) to make judgment consistent; chain-of-thought or thinking for multi-step reasoning.
- Instructions in a prompt are probabilistic. Hard rules need enforcement in code (see domain 5).
Context windows and token usage
- The newest models have a 1M-token context window by default and can write up to 128k output tokens in one request. Haiku 4.5, now a legacy model, has a 200k window and up to 64k output tokens; older models have smaller limits.
- More isn't better: as the token count grows, accuracy and recall degrade (context rot). Curate what goes in.
- If the input alone is too long, the API returns an error. If the input fits but the output runs out of room, recent models stop with
model_context_window_exceeded. - Tools for long work: the token-counting API, context editing (beta; clears old tool results and thinking), server-side compaction (beta) and the memory tool.
See also: Foundations domain 1 · The agentic loop and stop reasons.
Prompt reuse: caching, modular prompts and Skills
- Prompt caching reuses a stable prefix, cached in the order tools → system → messages, with up to 4 breakpoints. Put stable content first and variable content last. Changing a level (for example the tool definitions) invalidates it and everything after it.
- The cache lasts 5 minutes by default, or 1 hour at a higher price. Writes cost 1.25× the base input price (2× for 1 hour); reads cost 0.1× on most models, less on some of the newest. Prompts below a minimum length (512 to 4,096 tokens, depending on the model) aren't cached.
- Modular prompts: shared, versioned blocks (policies, formats) reused across prompts, so one change updates every use.
- Skills use progressive disclosure: only each skill's name and description (about 100 tokens) load at the start; its instructions (under 5k tokens) load when a request matches; bundled files and scripts load only when needed. Use skills only from trusted sources: a skill can direct tool use and run code.
Docs: Choosing a modelEffortPrompting best practicesContext windowsPrompt cachingAgent Skills
Practise Domain 2