Prompt engineering
Claude XML tags
Claude XML tags are XML-style delimiters Anthropic recommends to separate instructions, context, examples, documents, and variables in Claude prompts.
Expanded definition
Claude XML tags are not a special API feature; they are a prompt-structure convention. Anthropic recommends descriptive tags such as <instructions>, <context>, <examples>, <document>, <source>, and <input> to help Claude parse complex prompts unambiguously. They are especially useful when prompts mix long documents, examples, tool instructions, output-format rules, and user-provided data. Good tag names should be consistent, descriptive, and nested when the content has a natural hierarchy.
Related terms
Explore adjacent ideas in the knowledge graph.
Related
Comparisons, tools, and models that connect to this idea.