How many examples should I include?
The docs say "Include 3–5 examples for best results". You can also ask Claude to evaluate your examples for relevance and diversity, or to generate more from your initial set.
What tags should wrap the examples?
The docs recommend <example> around each example and <examples> around several, so Claude can tell examples from instructions. The names of the inner fields are not prescribed; keep them consistent with your real input and output.
Will a newer model copy the wording of my examples?
The official section I read does not answer this. There is no official conclusion, so use your own validation set to see whether outputs hug the examples' wording too closely.
I'm not an engineer. One-line version?
Instead of lecturing a new hire with a long list of rules, show them three to five finished examples done right, including a tricky one or two.
When you ask Claude to classify or to rewrite into a fixed format, the fastest improvement is often not a longer instruction but a few examples. Anthropic calls this few-shot or multishot prompting. This article uses a support-ticket classification prompt to show how to choose examples, how to wrap them in tags, and how to check for yourself whether they help. I read the official guidance on Anthropic's platform docs Prompt Engineering page; the example prompt is my own and has no output attached, because I did not run it.
<example> tags, with multiple examples inside <examples>, so Claude can tell them from instructions).Below is a ticket-classification prompt I wrote (the tag structure follows the official advice; {{new ticket text}} marks where you substitute real content):
Classify each support ticket into one category: refunds, account, shipping, or other.
Reply with the category name only.
<examples>
<example>
<ticket>My order arrived with a cracked screen. I want my money back.</ticket>
<category>refunds</category>
</example>
<example>
<ticket>How do I change the email on my login?</ticket>
<category>account</category>
</example>
<example>
<ticket>Tracking says delivered, but nothing is at my door.</ticket>
<category>shipping</category>
</example>
<example>
<ticket>Your app is great, thanks for the update!</ticket>
<category>other</category>
</example>
<example>
<ticket>I was charged twice and the parcel is also late.</ticket>
<category>refunds</category>
</example>
</examples>
<ticket>{{new ticket text}}</ticket>
Note the fifth example: it deliberately includes a mixed ticket that looks like both refunds and shipping, labeled with the answer you want. That is the Edge Case "Diverse" asks for; if your rule is "any billing problem goes to refunds", this example teaches Claude the rule without a long paragraph of explanation. The fourth example covers "none of the above", so Claude does not force every message into the first three categories.
The section I read does not discuss the risk of examples being copied too literally, and gives no trade-off beyond the 3–5 count; another part of the page says newer models follow instructions more literally but does not connect that to examples. So whether a newer model will copy your examples' wording verbatim has no official answer, and only your validation set can tell you.
This is my view, not an official conclusion: if your prompt already has a long passage saying "classify like this, not like that", try turning the rules in it into two or three examples with answers, especially edge cases. Examples are harder to misread than rule descriptions and easier for you to check; but they lengthen every call's input, so count that cost if you reuse the prompt heavily, and consider Prompt Caching.