Prompt and Context Optimisation
Treat prompts, examples, tool descriptions and skills as versioned, measured artefacts, and improve them by hand, by optimiser and in production without breaking what already works.
2 modules · 7 lessons~17 hoursUpdated 2026-10-30Certificate included
- Lessons7
- Quizzes7
- Sources42
- Of study~17h
About this course
About this course
A business running agents in production has dozens of per-step agents, and each one carries prompts, few-shot examples, tool descriptions and skills that drift, rot and break when the model changes. This course teaches the engineering discipline for that text: how to write prompts for current Claude models and what to delete from old ones, how to choose examples, how to iterate against an eval without fooling yourself, what DSPy, MIPROv2 and GEPA really buy you, how to optimise tools and skills, and how to version, A/B test, migrate and regression-test prompts in production. The running examples are a report summariser and a follow-up questions drafter; code is short Python, and exercises run on your Claude subscription.
About the running example
The examples follow a fictional property-law (conveyancing) firm in England and Wales: a summariser for property search reports and a drafter for pre-contract enquiries. It's a case study, chosen because its documents are long, structured and high-stakes. You don't need a legal background, and the same patterns apply to contracts, insurance claims, invoices, support tickets or patient records. In the lessons, a matter is one client's case and a solicitor is the lawyer who signs work off.
What you'll learn.
- 1Rewrite a prompt for current Claude models: structure, context and reasons, examples and effort settings, and remove the patterns that were written for older models
- 2Select, order and place few-shot examples deliberately, and measure whether they help or anchor the model
- 3Run an eval-driven iteration loop with a frozen test split and a prompt changelog, and estimate how much of a dev-set gain is selection noise
- 4Optimise a prompt with DSPy (MIPROv2) and GEPA, cost the run, and judge the result against a held-out set
- 5Optimise tool descriptions, agent instructions and skills against trigger and task evals, not only single prompts
- 6Version prompts in a registry, run a case-level online test with sample-ratio and peeking safeguards, and migrate a prompt to a new model behind a regression suite
2 modules, 7 lessons.
8h 15m of lessons
Module 1 · 3 lessons · 3h 20m
Designing prompts systematically
How current Claude models read a prompt, how to choose the examples it sees, and the eval-driven loop that turns prompt changes from opinions into measurements.
- 1Prompting current Claude modelsHow current Claude models read a system prompt, how to structure one for a production step, and which habits from older models (shouting, scripted reasoning, prefill, sampling knobs) to delete, with a report summariser rewritten end to end.1h 5m7-question quiz5 sources
- 2Choosing few-shot examplesWhat examples actually teach a model, when they help and when they anchor it, how to select, order and place them (static, retrieved, many-shot), and how to measure whether they earn their tokens, using a follow-up questions drafter.1h 5m6-question quiz7 sources
- 3Eval-driven prompt iterationThe loop that turns prompt edits into measured changes - splits, one change at a time, repeated trials, paired comparisons and a changelog with a reason for every line - and how to estimate how much of a dev-set win is just selection noise.1h 10m6-question quiz5 sources
Module 2 · 4 lessons · 4h 55m
Optimising and operating prompts
Automatic optimisers and what they really buy, optimising tools and skills, and the production machinery for prompts: registries, online tests, model migrations and regression suites.
- 4Automatic prompt optimisationHow optimisers search over prompts and examples - from APE and OPRO to DSPy's MIPROv2 and GEPA's reflective, Pareto-based evolution - what they genuinely buy you, what a run costs, and how they overfit, with a DSPy version of the report summariser.1h 20m7-question quiz7 sources
- 5Optimising tools, instructions and skillsAn agent's behaviour depends on far more text than its system prompt - tool names and descriptions, error messages, skill descriptions and bodies. How to evaluate each surface (tool selection, skill triggering, end-to-end tasks) and optimise it by hand, with Claude, and with GEPA- and ACE-style methods.1h 10m6-question quiz6 sources
- 6Prompt registries and online testsWhere prompts live and how a new version reaches production - git, registries such as Langfuse, Braintrust and PromptLayer, labels, caching and rollback - and how to run a case-level online test whose result you can trust, with sample-ratio checks and no peeking.1h 10m6-question quiz6 sources
- 7Model migration and regression suitesMoving a prompt to a new model safely - the API breakages, token and cost changes, and behavioural drift to check, how to design a regression suite that catches negative flips, and a worked migration of the report summariser from Claude Haiku 4.5 to Haiku 5.5.1h 15m6-question quiz6 sources
Optimise and ship the questions drafter
Take a follow-up questions drafter from a legacy prompt to an optimised, versioned, regression-tested configuration that can survive a model migration, using every technique in the course, and write a release note you could defend line by line.
Finish it. Get certified.
Complete every lesson of Prompt and Context Optimisation and you get a certificate with your name on it. Free, like the course.
- A public page with a certificate ID anyone can check
- Download it as a PDF
- Add it to LinkedIn in one click
Prompt and Context Optimisation, answered.
Is Prompt and Context Optimisation free?
Yes, for everyone: all 7 lessons, 7 quizzes, the capstone brief and the certificate are free, with no card and no trial. The hands-on exercises need the tools listed under Prerequisites.
Do I get a certificate?
Yes. Finish every lesson of Prompt and Context Optimisation and you get a certificate with your name and a certificate ID, on a public page anyone can check. Finishing every course in a learning path earns the path certificate too. You can download each one as a PDF and add it to LinkedIn. They're certificates of completion from the Coders In Hoods AI Academy, not an accredited qualification.
How long does Prompt and Context Optimisation take?
About 17 hours: 2 modules and 7 lessons, at your own pace. Your progress is saved to your account, on every device.
Which roles is it for?
It's on the Machine Learning Engineer roadmap: the courses those jobs ask for, in the order to take them.
What do I need before I start?
Agent Foundations (tools, context engineering, structured outputs) and Evaluating and Scoring Agents (datasets, graders, judge calibration, paired statistics), or equivalent experience. Recommended: Agent Benchmarks and Simulations, for multi-turn eval cases with simulated users and stateful environments. Comfortable reading and writing Python. Claude Code installed on a Claude subscription; an OpenRouter key or a local Ollama model only for the stretch exercises. Basic probability: proportions, standard errors, what a p-value is.
More in Evaluation and Optimisation.
- IntermediateAI agents · Evals
Evaluating and Scoring Agents
Turn "it seems better" into numbers you can defend: error analysis, code graders, calibrated LLM judges and honest statistics.
7 lessons ~20hFree - IntermediateResearch methods · Evals
Think Like a PhD Student
Ask a question, design the experiment, annotate the data, doubt the result, write it up and get it reviewed: the research discipline for AI agent work.
10 lessons ~26hFree - AdvancedAI agents · Evals
Agent Benchmarks and Simulations
Evaluate multi-turn, stateful agents with simulated users and real environments, and build benchmarks whose numbers survive an audit.
9 lessons ~32hFree - AdvancedFine-tuning · Reinforcement learning
Fine-Tuning and RL for Agents
Train a small open model for one agent step with supervised fine-tuning, preference optimisation and reinforcement learning, and prove with your eval suite whether it beats an optimised prompt.
8 lessons ~38hFree
