Prompt and Context Engineering
3 build exercises to practise the concepts in this domain.
6.1 — Measure the Window, Then Take Three Things Out of It
Intermediate
45 minutes
- How to measure where a context window actually fills up
- How context editing clears tool results that the agent has already used and what it reports back
- What a compaction summary keeps by default and what a custom instructions string silently drops
- How an isolated context changes the cost and the work of passing it what it needs
6.2 — Change One Thing at a Time and Test Against a Set That Does Not Move
Intermediate
60 minutes
- How to build an evaluation set that shows what a prompt change did
- What moving standing rules from a user turn to the system field is actually worth
- How consistent, delimited examples change format compliance
- Why max_tokens is a safety limit and never a length control
- How delimiting and labelling incoming content changes what the model obeys
6.3 — Enforce the Shape, Then Try to Break It
Intermediate
45 minutes
- How the three ways of producing structured output differ in who enforces the shape
- Which errors a guaranteed schema does not prevent, so that they need a validator
- Why stop_reason is checked before the payload
- How a retry that carries the validation errors differs from an identical retry