Build Claude prompts with clean XML structure

This Claude AI prompt generator turns your idea into a prompt where every part sits inside its own XML tag, such as <role>, <context> and <task>. Anthropic's prompting guide recommends this structure because it helps Claude separate instructions from background and examples. Choose a detail level and format, then open the result directly in Claude.

0/2000
Detail level
Recent prompts (saved in this browser)

    🔒 Runs in your browser. Your text is not stored on our servers.

    How to use it

    1. Describe what you need

      Write your request in plain words. The target is already set to Claude.

    2. Pick Simple, Advanced or Expert

      Simple wraps everything in one task tag; Advanced and Expert give each part its own tag, and Expert adds example and quality check tags.

    3. Set tone, format and language

      Choose the answer format, tone and reply language, or leave them on Auto.

    4. Add your material and open in Claude

      Fill in the context tag, paste any long document you need analyzed, and use the Open in Claude link or copy the prompt.

    Why XML tags work so well with Claude

    A prompt often mixes very different things: instructions, background, a document to analyze, an example of the style you like. In plain text, Claude has to guess where each one starts and ends. Tags remove the guesswork. Anthropic's own documentation explains that wrapping each type of content in its own tag reduces misinterpretation, especially when a prompt combines instructions, context, examples and inputs. The tag names are not magic keywords; what matters is that they are descriptive and used consistently.

    An Advanced-level prompt from this page looks like this:

    <role>
    You are a meticulous research assistant.
    </role>
    
    <context>
    I am preparing a briefing for our board on remote work policies.
    </context>
    
    <task>
    Summarize the attached survey results and highlight risks.
    </task>
    
    <requirements>
    - Separate facts from opinions
    - Summarize key points first, details after
    - Flag anything that should be verified with a primary source
    </requirements>
    
    <output_format>
    A bullet list, one idea per bullet.
    </output_format>

    Working with long documents

    Claude is often used for reading long material: contracts, reports, transcripts, codebases. Anthropic's guidance for long inputs is specific: put the long documents near the top of the prompt, above your instructions and question, and wrap each one in its own tag with its source. For example, paste a report inside <document> tags before the generated prompt, then keep the task and requirements at the end.

    A second technique from the same guide is to ask Claude to first pull out the relevant quotes, inside <quotes> tags, and only then answer based on them. This keeps the answer anchored to what the document actually says, which matters for summaries you will forward to others.

    Explain the why, and say what to do

    Claude responds well to reasons. "Keep each point under 20 words" works; "keep each point under 20 words because the summary will be read on a phone" works better, because Claude can apply the same reasoning to cases your rule did not cover. Add reasons to the <context> tag or next to a requirement.

    Phrase rules as what to do rather than what to avoid. "Write in flowing paragraphs" is clearer than "do not use bullet points". In Expert mode, the <example> tag is where a short sample of your preferred style goes; Anthropic notes that examples are one of the most reliable ways to steer format and tone, and that several varied examples work better than one.

    Projects, system prompts and reusing your structure

    If you repeat the same kind of task, move the stable parts into project instructions or a system prompt and keep only the task in each message. The system prompt generator also outputs XML tags when you choose Claude as the target. Want to compare formats? The same idea becomes Markdown headings on the ChatGPT prompt generator and labeled sections on the Gemini prompt generator.

    Pro tips

    • Keep tag names consistent across prompts (<context>, <document>, <example>) so you can refer to them: "using the data in <document>…".
    • Ask Claude to put its answer inside a tag, like <summary>, when you need to copy only the final part.
    • Place long pasted text at the top and your question at the bottom of the prompt.
    • Give several short, varied examples rather than one long one, each in its own <example> tag.
    • If Claude is too cautious or too brief, explain the purpose of the task in the context tag; it usually adjusts.

    Frequently asked questions

    Do I have to use XML tags with Claude?

    No, Claude understands plain text. Tags simply make complex prompts clearer and more reliable, especially when you mix instructions with documents or examples. For quick questions, Simple mode is enough.

    Are there special tag names Claude requires?

    No. There are no reserved tag names; choose descriptive names and use them consistently. The generator uses role, context, task, requirements, output_format, example and quality_check.

    Does this Claude prompt generator work with the API?

    Yes. Paste the result as the user message, or move the role and rules into the system parameter and keep the task in the message.

    Is this tool made by Anthropic?

    No. It is an independent free tool. Claude is a product of Anthropic.

    Why does Simple mode only use one tag?

    Short prompts do not need several sections, so Simple mode wraps the role, request and key requirements in a single task tag to keep it compact.

    Related tools

    Updated: