If you show Claude two or three examples of the result you want, it matches your format and style far more accurately than a long description would. Providing examples like this is called few-shot prompting. This guide explains why it works, how to build good examples, and which tasks few-shot fits best.
🟢 Model references match the current lineup · model notice · Fable subscription
Fable 5 and 5.1 subscription (updated September 7, 2026): Claude Fable 5.1, released September 1, 2026, is the current Fable model and Fable 5 is now legacy. Plan terms are the same for both — Max and Team Premium plans include Fable at up to 50% of the weekly usage limit; Pro and Team Standard use usage credits (
- Two or three examples (few-shot) match format and style accurately.
- Examples are more precise than long explanations.
- Follow the four conditions of a good example.
- Especially effective for format-matching tasks.
What is few-shot
Giving only instructions with no examples is zero-shot; giving a single example is one-shot; showing two or more examples of the input and the desired output is few-shot. Instead of describing "classify it like this" in words, you show two or three actually-classified examples.
Why it works
Examples convey format, tone, and classification criteria that are hard to put into words. Claude picks up the pattern in the examples and continues in the same way, so a few short examples are often more accurate than a long explanation.
Four traits of good examples
- Consistent format — every example follows the same structure and order.
- A sensible count — usually 2 to 5 works well. Too few and the pattern is unclear; too many and the input gets long (adjust per task).
- Variety — include a range of different cases.
- Edge cases — one or two tricky examples make the criteria clear.
Where few-shot shines
Few-shot is powerful when the "shape of the right answer" is clear. For the task types below, show two or three examples instead of explaining.
Example: matching a format
To classify sentences as "Sentiment: positive/negative/neutral", show examples first:
Input: Shipping was fast, loved it -> Sentiment: positive Input: It arrived with torn packaging -> Sentiment: negative Input: It is just average -> Sentiment: neutral Input: (sentence to classify)
Just two or three examples lead Claude to answer in the same format.
Caveats
If the examples lean one way, the answers follow that bias; for instance, only-positive examples can make Claude reluctant to judge something negative. And if the example format is inconsistent, the output wavers too, so making the examples themselves accurate and consistent matters most.
Related reading
Few-shot is especially effective for format-heavy tasks (classification, extraction, transformation). It pairs well with specifying the output format and role prompting. For more, see the prompt engineering guide and the official Anthropic documentation.
Frequently asked questions
What is few-shot?
Showing two or three examples of the result you want, so Claude follows that format and style.
How many examples are ideal?
Usually two or three. Too few won't establish a pattern; too many get long — keep to key examples.
When is it most effective?
For tasks that need consistent output format/style (classification, filling templates, unifying tone).
Related articles
- Getting Started with Claude: From Sign-Up to Your First Chat (Beginner's Guide)
- How to Use Claude: A Step-by-Step Guide for Beginners
- How to Download & Install Claude: Web, Desktop, and Mobile
- How to Prompt Claude Well: 7 Basics of Writing Prompts
- Giving Claude a Role (Persona): How to Get More Precise Answers