XML/Tag Structuring
Structure & output
Level 1 · FoundationsWrap distinct parts of a prompt in XML-style tags — especially effective with Claude.
XML/Tag Structuring separates a prompt's parts — instructions, input, examples — using explicit tags like `<instructions>`/`<input>`, rather than relying on line breaks or prose transitions to signal where one section ends and another begins. Particularly effective with Claude models specifically, which are trained to weight this kind of explicit tag structure heavily. Alternative, not a combination, to Markdown/Symbol Structuring: pick whichever convention fits the model/context, not both at once in the same prompt.
When to use it
Use it when a prompt mixes instructions with a large or complex input — the tags make the boundary unambiguous. Especially worth it when targeting Claude specifically.
When to avoid it
Skip it for short, simple prompts with nothing worth separating, or for models that don't specifically benefit from tag-based structure.
Advantages
- Makes section boundaries completely unambiguous, more so than a line break or heading alone
- Particularly effective with Claude models specifically
- Easy to nest for more complex structures (examples within instructions, etc.)
Disadvantages
- Adds visible markup overhead to the prompt text
- The specific benefit is strongest with Claude — less pronounced with every model
Examples
<instructions>Summarize the following support ticket in 2 sentences, and classify its urgency as low/medium/high.</instructions> <input>Customer reports the app crashes every time they try to export a report, blocking their end-of-month workflow.</input>
Pairs well with
Try it
Fill in the placeholders below and see the compiled prompt update live.
What you want to achieve.
The material to work from.
- 2
- Words
- 67
- Characters
- 0/2
- Placeholders filled
- 1 min
- Reading time
- Completeness0
- Clarity0
- Context0
- Specificity0
- Constraints0
- Format0
- Output0
- Constraints note0
- Success criteria0
- Scope focus100
- Verification step0
- Negative example0
- Confidence0
- Placeholder syntax100
- Markdown structure0
- Fill in the remaining placeholders.
- Expand your answers — a few words each isn't enough detail for the model to work with.
- Add background context so the model understands the situation.