Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Let Claude Do the Work, Not Just Answer
claudecowork-me.com
LATEST
Recruitment Screening Workflow: Using Claude to Compress Two Days of Resume Screening Into Half a Day  ·  Claude × Google Calendar: Let AI See the Full Picture of Your Schedule — From Being Driven by Your Calendar to Actively Owning Your Time  ·  Claude Workplace Features in 2026: MCP Matures, Memory Deepens — Time to Upgrade How You Work  ·  Performance Self-Review Scene: Why You Never Know How to Write It Each Year — and How Claude Helps You Make Your Results Visible  ·  Difficult Conversation Email Scene: Bad News, Apologies, Refusals — Let Claude Help You Find That Hardest-to-Master Tone  ·  Building a Personal Knowledge Management System with Claude: Stop Letting What You Read Disappear
Glossary · prompt-techniques

Few-Shot Prompting

prompt-techniques Intermediate

30-Second Version · For the impatient
Providing 2–5 example 'input → output' pairs in your prompt so Claude learns your desired format, tone, and logic from examples, then applies the same pattern to your actual task. Faster and more accurate than describing 'what format I want' — examples are understood better than rules.
Full Explanation +
01 · What is this?

What's the fundamental difference between Few-Shot and just describing format requirements? When should I use each?

An analogy: describing format requirements is like 'please write a formal business proposal, 500 words, three sections, first section introduces the problem, second explains the solution, third covers expected outcomes' — Claude must convert your text description into an actual output structure. Few-Shot is like 'here's a proposal I wrote before, please write a new one using the same format and tone' — Claude learns directly from the example, with lower conversion cost.

When describing format in words works better:

  • You can articulate format rules very clearly (e.g., 'every point starts with a verb, max 15 words, don't translate English terms')
  • Your format has no good existing examples to provide
  • Your rules have logical conditions (e.g., 'if positive feedback, flag green; if negative, flag red')

When Few-Shot works better:

  • You have good existing examples (past reports you liked, format templates you prefer)
  • Your format requirements are hard to describe precisely in words (subtle tone differences)
  • You're concerned Claude will interpret your text description differently than intended
  • Output format is complex with multiple layers (specific table structure, nested list hierarchy)

Strongest combination: System Prompt states the rules, Few-Shot provides format examples. Use System Prompt for 'formal tone, no bullet points' and then provide 2 examples demonstrating the specific layout — better than either alone.

02 · Why does it exist?

How should I design Few-Shot examples? Are there techniques for making examples more effective?

Technique 1: Clearly label Input and Output. The most effective Few-Shot format explicitly marks 'Input:' and 'Output:' pairs so Claude knows which is input (the data you provide) and which is output (the format you want). Without clear labeling, Claude sometimes can't distinguish the example from your actual task.

Technique 2: Make examples diverse, not all the same type. If your task involves multiple scenarios (e.g., positive and negative client feedback), examples should include at least both: one positive, one negative. Only giving one type, Claude may not generalize correctly when it encounters different cases.

Technique 3: Example length and complexity should match your actual task. If examples are all very short and simple but the actual task is a complex long document, Claude may output something much shorter than you expect. Match example scale to actual task scale.

Technique 4: Use your genuinely good past outputs as examples. Theoretically designed examples rarely outperform actual outputs you've used and judged as high quality. If you have past reports or documents that came out well, use those directly rather than designing an ideal example from scratch.

Common mistakes: examples too long (consuming many tokens with low marginal benefit), or examples that are themselves mediocre quality (Claude will output at the 'mediocre' quality level you demonstrated).

03 · How does it affect your decisions?

Which workplace tasks are most worth investing in Few-Shot example design?

Few-Shot design takes time, so it's most worth investing in tasks you'll repeat frequently where output format matters. The highest-value Few-Shot applications at work:

1. Regular reports with fixed formats (weekly, monthly, client reports): once examples are designed, they're reused indefinitely. Every subsequent report requires no format re-explanation, and output format is perfectly consistent. These reports especially benefit from storage in Claude Projects for permanent example retention.

2. Client communications (email / proposals): your company has its own communication tone and format style. Use a few of your best past client emails as examples — all subsequent client emails Claude writes will match your company's style without per-message tone adjustment.

3. Data organization and classification: e.g., client feedback categorization (positive/negative/suggestions), or resume screening (fit/doesn't fit/needs confirmation). These tasks have clear classification logic — one good example lets Claude fully understand classification criteria, producing consistent formatting when processing at volume.

4. Multi-tone translation or rewriting: if you need to translate the same content into different styles (formal vs. informal), provide both versions of the same passage as examples — Claude understands exactly what style difference you want.

5. Structured data extraction: extracting specific fields from unstructured text (meeting notes, interview transcripts, press releases). Few-Shot tells Claude exactly which fields to extract and what output format to use.

04 · What should you do?

Is more examples always better in Few-Shot prompting? Is there an optimal number?

More isn't always better — marginal returns drop quickly beyond a certain number.

Research and practical usage findings:

  • 1 example: usually gets Claude to understand basic format, but may not be enough for complex formats or tasks with multiple case types.
  • 2–3 examples: the optimal sweet spot for the vast majority of workplace tasks. Enough for Claude to understand the format pattern and cover main case variants without consuming excessive tokens.
  • 4–5 examples: needed only for particularly complex formats with many edge cases. At this point, consider whether putting rules into the System Prompt might be more efficient.
  • More than 5 examples: almost never necessary. Too many examples can actually cause Claude to conflate example content with your actual task, creating more interference rather than better output.

What matters most isn't quantity but quality and representativeness. One good example that fully demonstrates your desired format with a typical input beats five vague examples.

If you find you need more than 5 examples to stabilize output format, this is typically a signal that your format is too complex — consider articulating some rules as text in the System Prompt rather than relying entirely on examples.

Real-World Example +

Mr. Chen is a consultant at a human resources consulting firm. Each week he organizes candidate responses from 10–15 clients (varying formats, varying lengths) into a standardized 'candidate evaluation summary' format for client executives to make quick decisions.

Previously he tried describing the format in his System Prompt: 'Please organize the following candidate responses into an evaluation summary including: match level (high/medium/low), key strengths (2–3 points), key concerns (1–2 points), recommended next step.' But output format varied each time — match level scoring wasn't consistent, 'recommended next step' was sometimes too long or too short, and tone sometimes differed from his company's standard.

He switched to Few-Shot, using two past candidate evaluations he considered his best work as examples:

Input: 'Candidate A: 5 years marketing experience, digital advertising specialist, currently Senior Marketing Specialist at Company X, salary expectations high, but limited B2B sales background required for this role.'

Output:
[Match Level] Medium
[Strengths] Strong digital advertising execution / Current role level comparable to target position
[Concerns] Limited B2B sales background (core job requirement) / Salary expectations exceed budget ceiling
[Next Step] Schedule phone interview to clarify sales background — if relevant project experience exists, consider advancing

Input: 'Candidate B: 3 years B2B sales experience, key account management background, fluent English, currently seeking management role, career goals highly aligned with this position.'

Output:
[Match Level] High
[Strengths] B2B key account sales background matches / English proficiency meets requirement / Career goals aligned
[Concerns] Management track feasibility (needs client confirmation)
[Next Step] Prioritize scheduling client executive interview

After using these two examples, every evaluation Claude produced was perfectly consistent: stable match level criteria, consistent section lengths, tone matching his company's style. Mr. Chen says this reduced each evaluation from 10 minutes to 3 minutes, with output quality more consistent than his own writing (because his own evaluations had subtle format variations between different days).

Diagram
Zero-Shot vs Few-Shot:有無範例的輸出差距以同一個任務(整理客戶反饋)為例,左邊展示 Zero-Shot(只描述需求)的輸出,右邊展示 Few-Shot(附上範例)之後輸出格式和品質的差異。Zero-Shot vs Few-Shot — Same Task, Different ResultsZero-Shot (describe requirements)Prompt:"Organize this client feedback into a structured format"Claude output:Client Feedback Summary:• The client mentioned several positive aspects of the product, including ease of use and good customer support.• However, there were also some concerns raised about the pricing structure and the lack of certain advanced features.✕ Format varies every time✕ No clear action orientation✕ Inconsistent structureFew-Shot (with 1 example)Prompt includes example:Input: "delivery was slow, UI is great"Output:✓ Strength: UI design [High value]✗ Issue: Delivery speed [Urgent fix]Claude output (same feedback):✓ Strength: Ease of use [High value]✓ Strength: Customer support [High value]✗ Issue: Pricing structure [Needs review]✗ Issue: Missing advanced features [Roadmap]✓ Same format every time✓ Clear action tags✓ Directly usableOne example → Claude replicates the pattern exactly · Consistent output every time · No format description neededClaude Cowork Me · claudecowork-me.com
Feel free to share. Please credit the source.
Common Misconceptions +
✕ Misconception 1
× Misconception 1: Longer, more detailed examples help Claude learn format better. Example quality isn't about length but clarity and representativeness. A short example that clearly demonstrates the input→output relationship is usually more effective than a very long one packed with irrelevant details. Overly long examples have an additional risk: Claude may carry specific content from the example (particular names, numbers, events) into your actual output rather than only learning the format.
✕ Misconception 2
× Misconception 2: Few-Shot only works for technical tasks — creative tasks should let Claude express freely. Few-Shot is equally or more effective for creative tasks. If you have a specific writing style or tone preference, two passages you like as examples are more accurate than spending 30 minutes describing 'I want that casual-but-professional tone.' The example itself is the best tone reference.
The Missing Link +
Direct Impact

The core trade-off: format precision vs. design cost.

Few-Shot's greatest strength is making format output highly precise and consistent — especially for complex formats or tones hard to describe in words. The cost: designing good examples requires additional upfront investment.

The other trade-off is token consumption. Every example consumes Context Window space; two substantive examples may consume 500–1,000 tokens — a real cost for high-volume repetitive workflows (e.g., organizing 20 reports daily).

Decision guideline: for high-repetition tasks where format consistency matters, Few-Shot investment is almost always worth it. For one-off tasks where format isn't critical, describing format in words is more efficient.

Ask a Question
Please enter at least 10 characters
More Related Topics