Claude · Basics

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.

Claude prompt basics

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.

Frequently asked
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.