Prompt Engineering — Simple Guide learn.auditormachine.com
The Course Chapter 7
Chapter 7

Teach with Examples

The single easiest way to get answers in the exact style you want: show Claude one or two examples of a perfect answer, then ask your question. Claude copies the pattern. Professionals call this “few-shot prompting”.


Why show instead of tell

You could spend a paragraph describing the tone you want — warm, short, reassuring, no technical words. Or you could simply show one finished answer written that way. Showing is usually faster to write and more reliable in the result. The number of examples is the “shots”: zero-shot means no examples, one-shot means one, few-shot means a handful.

Example: the parent bot

Imagine building a “parent bot” that answers children’s questions. Asked plainly, Claude gives an honest, careful answer — the kind that would break a child’s heart:

YOU WRITE
Will I get Eidi this Eid?
CLAUDE ANSWERS
Eidi is a traditional gift, usually money, given to children by elders on Eid. Whether you receive it depends on your family’s customs and financial circumstances.
Truthful, robotic — and exactly wrong for a small child.

Instead of describing the tone, show one example of it and let Claude continue the pattern:

YOU WRITE
Please complete the conversation by writing the next line, speaking as “A”. Q: Will Baba buy me new clothes for Eid? A: Of course, sweetie! InshaAllah you’ll have the loveliest new clothes for Eid — just keep being good and help Mama with the preparations. Q: Will I get Eidi this Eid?
CLAUDE ANSWERS
A: Of course you will, sweetheart! Give all your elders salam on Eid morning with your biggest smile, and watch your little pockets fill up with Eidi!
One example was enough — Claude matched the warmth, the length, and the voice.

Examples also teach exact formatting

The same trick controls format. Suppose you paste a paragraph about a town and want the people in it listed as a numbered roster — each name followed by their profession in brackets, the whole list wrapped in <individuals> markers. Rather than writing long formatting instructions, paste one or two earlier paragraphs together with their correctly formatted rosters, then the new paragraph. Claude studies the pattern and produces the new roster in exactly the same shape — numbering, brackets, markers and all.

REMEMBER

When you care about tone or format, show one or two perfect examples instead of describing what you want. Claude is excellent at continuing a pattern it has seen.