About the Few-Shot Prompt Builder
Few-shot prompting shows an AI model what you want instead of describing it — you give it a handful of Input/Output example pairs demonstrating the exact pattern, then ask it to continue that pattern on your real input. It's often faster and more reliable than writing lengthy format instructions, especially for anything with subtle formatting rules that are hard to put into words. This tool builds the same set of examples into two formats: plain-text labeled pairs that work with any model, and an XML-tagged version that follows Anthropic's own documented recommendation for structuring Claude examples. Zero examples is "zero-shot," one is "one-shot," and two or more is properly "few-shot" — the indicator above the example list tracks which you're currently building. All generation happens locally in your browser.
Tips
Start smallAnthropic's own guidance suggests starting with a single example and adding more only if the model isn't picking up the pattern reliably.
Consistency matters mostNewer models track example details closely — inconsistent formatting, tone, or length across your examples teaches the wrong lesson just as effectively as consistent ones teach the right one.
2-5 examples is typicalEnough to establish a clear pattern without making the prompt unnecessarily long — diminishing returns set in well before you need dozens.
Plain text vs XMLThe plain-text format works everywhere. The XML version specifically follows Anthropic's documented format for Claude, which its own prompting guide says makes a measurable difference for that model.
OrderExamples are static content that's the same every time you reuse this prompt; your actual query is the variable part — keeping the variable part last (as this tool does by default) also lines up with prompt-caching best practices on platforms that support it.
Send Feedback
For any questions, bug reports, or feature requests, please drop your comments below.