How Many Examples Should You Show Claude?
One real example is a good start, and it's often enough to fix a format. Anthropic's docs recommend 3 to 5 for best results, because a single example can teach Claude the wrong things. Wrap them in <example> tags so Claude can tell them apart from your instructions.
[Describe the task in one or two sentences.] Match the format, tone and length of these examples. Don't reuse their content. <examples> <example> Input: [a typical real input] Output: [the output you'd accept without edits] </example> <example> Input: [a harder or unusual case] Output: [how it should be handled] </example> </examples> Now do the same for: <input> [your real input] </input>
- No exampleyou describe it, Claude guesses
- One exampleoften fixes a format, can teach the wrong traits
- Two that differshows what is allowed to vary
- 3 to 5, variedwhat Anthropic's docs recommend
Try it now
- 1Find one output you'd accept as is, such as a past email or a ticket you wrote well. Paste it into the prompt above with its input.
- 2Run it on three real inputs. Note anything Claude copied that you didn't mean to teach, such as length or a repeated phrase.
- 3Add a second example that differs in that way, and run the same inputs again. You'll know it worked when that unwanted habit is gone and the format holds.
Use it when
Formats that you'll repeat or that need to stay consistent: changelog entries, ticket labels, product descriptions, or a house style. Also use it when you've rewritten Claude's output more than once to get the same change.
Skip it when
Open brainstorming, where examples can narrow the range of ideas too early. Also skip them for anything with a strict machine-readable shape on the API. Anthropic's structured outputs feature enforces a schema, which an example can't do.
Why it works
Anthropic's docs call examples one of the most reliable ways to steer format, tone and structure. They should be relevant to your real task, diverse enough to cover edge cases, and clearly marked. Diversity matters because of what Claude picks up. If every example is short and upbeat, it may treat both of those as rules, even if you only cared about the format. Differences between examples show Claude what's allowed to vary. Descriptions can't do this as well. Rule of thumb, not a vendor figure: "concise" means different things to different people, and a five-line sample shows what you mean.
Example
Say you want release notes from raw commit messages. Your first example turns "fix null check in auth" into "Fixed a crash when signing in with an expired session." Your second covers a commit with no user impact, and the output is "No user-facing changes." Without the second example, Claude might invent a benefit for every internal commit, since your only example showed a user-facing fix.
Going further
Anthropic's docs suggest two extra uses: ask Claude to review your examples for relevance and diversity, or to generate more from your starting set. Then check what it generates, since those examples will shape every later output. For repeated work, put your examples in a project's instructions or knowledge, so they apply to every chat there and you don't have to paste them each time.
Common mistakes
- Using examples that disagree without meaning to, such as different date formats. Claude can't tell which one you intended.
- Writing made-up examples that are cleaner than your real data, then getting poor results on messy inputs. Anthropic says to mirror your actual use case.
- Pasting examples with no tags or labels, so they blur into your instructions or the input.
- Sending several near-identical examples. They add length without showing what can vary.
Sources
- Prompting best practices, Claude Platform Docs
- Structured outputs, Claude Platform Docs
- Create and manage projects, Claude Help Center
Checked 6 November 2026. Products change often, so confirm details with the vendor.