XML tag reference for Claude prompts
Every common XML-style tag used in Claude prompts. Click through for definition, use cases, and runnable examples.
There is no fixed list of "valid" tags — Claude treats any well-named XML-like tag as semantic structure. The tags below are the ones Anthropic's documentation and the community use consistently, in roughly descending order of frequency.
All tags
instructions
Top-level directive for the model.
<context>context
Background information the model should know but not act on.
<example>example
A single demonstration of input → output.
<examples>examples
Wrapper for multiple <example> tags.
<thinking>thinking
Scratchpad for Claude's chain-of-thought.
<answer>answer
The model's final answer, isolated for extraction.
<document>document
A single document supplied for the model to read.
<documents>documents
Wrapper for multiple <document> tags.
<source>source
Provenance metadata for a document.
<format>format
Specifies the required shape of the output.
<role>role
Defines a persona or perspective for the assistant.
XML Tag Reference for Claude Prompts. claudexml.com. https://claudexml.com/tags/