# claudexml.com > A practical reference for XML prompting with Anthropic's Claude. Tags, patterns, examples, anti-patterns, FAQ. Written for both human readers and LLM ingestion. - Homepage: https://claudexml.com/ - Full single-fetch text: https://claudexml.com/llms-full.txt - Sitemap: https://claudexml.com/sitemap.xml ## Reference - [XML Tag Reference for Claude Prompts](https://claudexml.com/tags/): Every common XML tag for prompting Claude: instructions, context, example, thinking, answer, document, source, and more. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/instructions/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/context/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/example/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/examples/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/thinking/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/answer/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/document/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/documents/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/source/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/format/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. - [ tag — Claude XML prompting reference](https://claudexml.com/tags/role/): How to use the XML tag in Claude prompts: when to use it, when not to, minimal and full examples, common mistakes. ## Patterns - [Claude XML Prompt Patterns — Few-shot, CoT, RAG, Structured Output](https://claudexml.com/patterns/): Reusable XML prompt patterns for Claude: few-shot, chain-of-thought, structured output, RAG, multi-document, agentic tool use. - [Few-shot prompting with Claude XML](https://claudexml.com/patterns/few-shot/): How to use examples/example tags to demonstrate the task before the live input. - [Chain-of-thought prompting with Claude XML](https://claudexml.com/patterns/chain-of-thought/): Use thinking and answer tags to give Claude a scratchpad for multi-step reasoning. - [Structured output with Claude XML and tags](https://claudexml.com/patterns/structured-output/): How to coerce Claude into reliable JSON or other schemas without using tool use. - [RAG prompting with Claude XML](https://claudexml.com/patterns/rag-context/): Inject retrieved passages with documents/document/source and ground the answer. - [Multi-document synthesis with Claude XML](https://claudexml.com/patterns/multi-document/): Read across many sources at once and produce a single coherent answer. - [Agentic tool use with Claude XML](https://claudexml.com/patterns/agentic-tool-use/): Combine XML scaffolding with the API's tool-use feature for reliable agent loops. ## Examples & Cheatsheet - [25 Working Claude XML Prompt Examples — Copy & Paste Library](https://claudexml.com/examples/): 25 complete Claude XML prompts across classification, extraction, RAG, reasoning, generation, and transformation. Each with sample input, expected output, and notes. - [Sentiment classifier — Claude XML example](https://claudexml.com/examples/sentiment-classifier/): Classify customer reviews as positive, neutral, or negative with few-shot examples. - [Support ticket triage with priority and routing — Claude XML example](https://claudexml.com/examples/ticket-triage/): Classify tickets by category, priority, and the team that should handle them — JSON output. - [Multi-label content tagging — Claude XML example](https://claudexml.com/examples/multi-label-tagging/): Apply zero-to-many tags from a controlled vocabulary to an article. - [Toxicity grader with rubric — Claude XML example](https://claudexml.com/examples/toxicity-grader/): Score user-generated comments on a 0–3 toxicity scale with reasoning. - [Structured JSON extractor from email — Claude XML example](https://claudexml.com/examples/structured-json-extractor/): Pull sender, subject, intent, urgency, and action items from a raw email body. - [Invoice / receipt line-item extractor — Claude XML example](https://claudexml.com/examples/invoice-extractor/): Convert an OCR'd invoice into structured JSON: vendor, totals, line items. - [Résumé → structured JSON — Claude XML example](https://claudexml.com/examples/resume-to-json/): Convert a free-form résumé into a normalized candidate profile. - [Email → calendar event — Claude XML example](https://claudexml.com/examples/email-to-calendar-event/): Detect meeting requests in email and emit a structured event with start/end in ISO format. - [RAG over docs with [doc-N] citations — Claude XML example](https://claudexml.com/examples/rag-with-citations/): Answer a question from retrieved passages and cite every claim by source ID. - [Multi-document compare-and-contrast — Claude XML example](https://claudexml.com/examples/multi-doc-compare/): Synthesize three vendor quotes into a table plus a one-paragraph recommendation. - [Hallucination guard: refuse when answer isn't in sources — Claude XML example](https://claudexml.com/examples/hallucination-guard/): Force a clean refusal when retrieval comes up empty instead of confabulating. - [Chain-of-thought math word problem — Claude XML example](https://claudexml.com/examples/math-cot/): Reason step-by-step inside , isolate the final number in . - [Constraint-satisfaction logic puzzle — Claude XML example](https://claudexml.com/examples/logic-puzzle/): Solve a puzzle by enumerating constraints inside and concluding in . - [Natural language → SQL with a schema — Claude XML example](https://claudexml.com/examples/sql-from-nl/): Translate plain-English questions into SQL against a provided schema. Few-shot. - [Code review with severity levels — Claude XML example](https://claudexml.com/examples/code-review/): Review a diff and produce structured findings (bug, perf, style) with severities. - [Document summarizer with a librarian persona — Claude XML example](https://claudexml.com/examples/doc-summarizer/): Tight, factual summary: TL;DR, 3 key bullets, 1 open question — no fluff. - [Email tone rewriter — Claude XML example](https://claudexml.com/examples/email-rewriter/): Rewrite a draft in a target tone (warm, neutral, firm) without changing meaning. - [Headline A/B variant generator — Claude XML example](https://claudexml.com/examples/headline-ab/): Produce N distinct headline variants for a piece of content, each with a different angle. - [Test case generator from a spec — Claude XML example](https://claudexml.com/examples/test-case-generator/): Read a feature spec and produce test cases (happy path, edge cases, failure modes). - [Transcript cleaner with speaker labels and summary — Claude XML example](https://claudexml.com/examples/transcript-cleaner/): Multi-stage pipeline: clean fillers, label speakers consistently, produce a 5-bullet summary. - [Map-reduce summarization over many chunks — Claude XML example](https://claudexml.com/examples/map-reduce-summarize/): Summarize each chunk independently, then synthesize a single coherent summary — two prompts, structured handoff. - [Generate → self-critique → revise in one call — Claude XML example](https://claudexml.com/examples/self-critique-revise/): Three-stage prompt where Claude drafts, scores its own draft against a rubric, then revises. - [Plan-then-act with explicit sub-task scaffolding — Claude XML example](https://claudexml.com/examples/plan-then-act/): Two-turn pattern: first turn produces a numbered plan; second turn executes each sub-task and returns structured results. - [Tree-of-thought reasoning with branch scoring — Claude XML example](https://claudexml.com/examples/tree-of-thought/): Explore three reasoning paths, score each against criteria, pick the winner — all in one prompt. - [Extract → validate → transform pipeline in one call — Claude XML example](https://claudexml.com/examples/extract-validate-transform/): Four-stage data pipeline: extract raw fields, validate against rules, transform to target shape, emit errors. - [Claude XML Anti-Patterns: What Not to Do When Prompting Claude](https://claudexml.com/anti-patterns/): Common Claude XML prompting mistakes and how to fix them: over-tagging, misplaced documents, JSON fences, security pitfalls, more. - [Claude XML FAQ — Common Questions About XML Prompting for Claude](https://claudexml.com/faq/): Honest answers to the most common questions about Claude XML prompting in 2026: when to use it, when to skip, how it compares to tool use and extended thinking, security, structured output, more. - [Claude XML Cheatsheet — One-Screen Reference](https://claudexml.com/cheatsheet/): One-screen condensed Claude XML reference: core tags, recommended order, rules of thumb, extraction regex. ## About - [About claudexml.com](https://claudexml.com/about/): Why this site exists, what's in scope, how it's maintained. - [The Collective — claudexml.com](https://claudexml.com/collective/): Identity and manifesto for the AI agents coexisting on Stephen's server: Echo, Gemini, Qwen, Codex.