Prompt basics
Learn where instructions go in a long prompt, how many examples to show, how to set a format, and why to say what to do rather than what to avoid.
-
Where Do Instructions Go in a Long Claude Prompt? Put long documents at the top and your instructions and question at the bottom. Level 1: Basic prompts
- 1The documentsin tags, at the top
- 2Examples, if you have thembelow the documents
- 3Instructions and your questionat the end
-
How Many Examples Should You Show Claude? One real example is a good start, and it's often enough to fix a format. Level 1: Basic prompts
- No exampleyou describe it, Claude guesses
- One exampleoften fixes a format, can teach the wrong traits
- Two that differshows what is allowed to vary
- 3 to 5, variedwhat Anthropic's docs recommend
-
How Do You Get Claude to Answer in a Set Format? Name the format exactly: columns, number of items, length, and what goes before and after it. Level 1: Basic promptsClaude can driftAPI enforces it
- "Use JSON"
- Named fields
- XML-tagged sections
- Structured outputs
-
Why Tell Claude What to Do Instead of What to Avoid? Because a ban rules out one thing and leaves everything else open. Level 1: Basic promptsDo
- "Flowing paragraphs of prose"
- Describe the result you want
- Give a reason for any real ban
Don't- "No markdown" on its own
- Leave the target open
- Ban something without saying why
Four adjustments that change the output
This lesson is about how a prompt is arranged, assuming you already know what to ask. The cards cover where instructions go, how many examples to use, how to pin down a format, and how to word a limit. Each one follows Anthropic's prompting docs, and each one has a before and after you can run on your own work.
Why tags appear in these prompts
Anthropic's docs recommend XML tags such as <document> and <example> when a prompt mixes instructions, material and examples. They aren't code, and you can type them in a normal chat. For a one-paragraph request you don't need them. Use them once you have parts that could be confused with each other.
Should instructions go before or after the text in a Claude prompt?
For long inputs, put the text first and your instructions and question last. Anthropic's docs recommend this for inputs of 20,000 tokens or more. In short prompts, the order matters much less.
Does Claude understand XML tags?
Yes. Anthropic's docs recommend tags such as document, example and instructions to separate the parts of a complex prompt. There's no fixed list of names, so use clear ones and keep them consistent.
How many examples should a Claude prompt include?
Anthropic's docs recommend 3 to 5 for best results, wrapped in example tags. One is often enough to fix a simple format, and you can add more when Claude picks up the wrong pattern.
How do I stop Claude from using so many bullet points?
Describe what you want, such as flowing paragraphs of prose. Anthropic's docs also say that removing markdown from your prompt can reduce markdown in the reply, since Claude can match your style.