How to Write Better Prompts for Claude: A Checklist From Anthropic's Docs
If Claude keeps giving you answers that are close but not quite right, the fix is usually in the prompt. This guide shows you how to write better prompts for Claude using the advice Anthropic publishes in its own prompting best practices. Every item on the checklist comes from that guide, and we checked each one against the live docs on 2026-10-31.
Short answer: To write better prompts for Claude, say exactly what you want and why, give the context Claude cannot guess, show an example of good output, separate the parts of your prompt with XML tags, and give Claude a role. Anthropic's own test is simple: if a colleague with no background would be confused by your prompt, Claude will be too.
Why Claude needs more than you think
Anthropic's guide describes Claude as "a brilliant but new employee who lacks context on your norms and workflows." That framing explains most disappointing answers. A new hire who gets the note "write a reply to the angry customer" will write something polite and generic, because nobody told them the order number, the delay, your refund policy or how your brand sounds.
You carry all that context in your head, so a short prompt feels complete to you. To Claude it is a puzzle with missing pieces, and it fills them with safe, average choices.
How to write better prompts for Claude: the checklist
Work through these in order. You will not need all of them for every prompt, but the first three apply almost every time.
1. Be clear and direct
Anthropic's first principle is to be specific about the output you want, including format and constraints. If you want Claude to go beyond the bare task, ask for it. The guide's example compares "Create an analytics dashboard" with a version that asks Claude to include as many relevant features and interactions as possible. Anthropic's point is that the second prompt says what "good" means.
Use the colleague test from the docs: show your prompt to someone who knows nothing about the task. If they would ask "for whom?" or "how long?", add those answers to the prompt.
When the order of steps matters, write them as a numbered list. Anthropic recommends sequential steps for exactly that case.
2. Explain the reason behind each instruction
The guide's section on adding context makes a point many people miss: give Claude the reason behind an instruction. Anthropic's example replaces "NEVER use ellipses" with an instruction that explains the text will be read aloud by a text-to-speech engine, which cannot pronounce ellipses. With the reason, Claude can apply the rule to cases you did not list.
In your own prompts, this looks like "Keep it under 100 words because it goes in a mobile push notification" instead of "Keep it short."
3. Give the facts Claude cannot know
Names, numbers, dates, your audience, your product, the customer's situation. Claude cannot look these up in your head. A prompt that says "our new product" leaves Claude to invent or skip the product. A prompt that names the product and its one key benefit gives Claude something real to write about.
4. Show an example of good output
Anthropic calls examples "one of the most reliable ways to steer Claude's output format, tone, and structure." The docs ask for examples that are:
- Relevant: close to your real use case.
- Diverse: covering edge cases, so Claude does not copy one pattern too closely.
- Structured: wrapped in
<example>tags, or several inside<examples>, so Claude can tell them apart from your instructions.
One good example can show what a paragraph of description struggles to explain. If you have a past email that hit the right tone, paste it in.
5. Use XML tags to separate the parts of your prompt
When a prompt mixes instructions, background and pasted material, Claude can lose track of which is which. Anthropic recommends wrapping each type of content in its own tag, such as <instructions>, <context> and <input>, to reduce misinterpretation. Tag names are up to you; the docs ask only that you use consistent, descriptive names and nest tags when content has a natural hierarchy.
This matters most when you paste in a long document. Put the document in <document> tags and your request outside them, so Claude never mistakes a sentence in the document for an instruction from you.
6. Give Claude a role
The docs say that setting a role focuses Claude's behavior and tone, and that "even a single sentence makes a difference." In the API, the role goes in the system prompt. In the claude.ai chat, you can open your message with it: "You are a customer support lead at an online furniture store."
Pick a role that carries the knowledge you need. "You are a senior Python developer who reviews code for performance" tells Claude which standards to apply to a slow loop.
7. Put long documents first
For long inputs, Anthropic's guide says to place documents near the top of the prompt, above your question, instructions and examples, and reports that this "improves performance across all models." Paste the report first, then ask your question at the end.
8. Tell Claude what to do instead of what to avoid
The docs suggest telling Claude what to do instead of what not to do. Their example swaps "Do not use markdown in your response" for "Your response should be composed of smoothly flowing prose paragraphs." The same guide notes that the style of your prompt can influence the style of the reply, so a prompt full of bullet points tends to get bullet points back.
9. Split big tasks into steps
Anthropic still recommends breaking a task into a chain of prompts when you want to check the work between stages. The most common pattern in the docs is self-correction: Claude drafts, then reviews the draft against your criteria, then refines it. In a chat, you can do this by hand across three messages.
What about prefill?
Older prompting guides tell you to "prefill" Claude's answer by writing its first few words yourself. Anthropic's current docs say prefilled responses on the last assistant turn are no longer supported starting with Claude 4.6 models, and requests that use them return an error (migrating away from prefill, checked 2026-10-31). The docs suggest direct instructions instead, such as "Respond directly without preamble." If a guide you are reading still recommends prefill, it was written for older models.
Anthropic also retired its Console prompt improver along with the legacy Workbench on August 17, 2026, according to its release notes. If you followed an older tutorial that sends you there, the checklist above covers the same ground by hand.
A worked example
Here is an everyday prompt, run through the check behind our free prompt grader. The grader uses Jev, a classifier from TypeSafe. For four items (Who it's for, Format and length, Your details, and What a good result looks like) it asks two questions: does this task need it, and does the prompt state it? An item is flagged as missing only when the task needs it and the prompt leaves it out. Items close to that line show as "could add". We ran each prompt at least twice on 2026-11-03, and results near the line can shift slightly between runs. These results come from Jev 1.14, checked on 2026-11-03, and can change when TypeSafe releases a newer version.
Before:
reply to a customer who is angry their order is late
Task type: writing for people. Missing: What a good result looks like. Missing or could add, depending on the run: Format and length, which came back missing in 10 of 18 runs and as "could add" in the other 8. Your details sits on the line: some runs showed it as "could add", others as not needed.
Claude is not told how long the reply should be, what it should achieve, or anything about the order and what you can offer.
Here is the same request rewritten by hand with the checklist. In our final run the check found nothing missing and nothing to add:
You are a customer support lead at an online furniture store. Our tone is warm and plain-spoken, never defensive.
<context>
Order #48213, a dining table, was due on 24 October. It is now due on 6 November because of a supplier delay. We can offer free delivery on the next order or a 10% refund.
</context>
<customer_message>
[paste the customer's email here]
</customer_message>
<instructions>
Write a reply under 150 words, because most of our customers read support email on their phone. Apologize once, give the new date, and offer both options so the customer can choose. If anything in the customer's message changes what we should offer, tell me before you draft.
</instructions>
This version uses a role (item 6), the facts Claude cannot know (item 3), XML tags to separate context, input and instructions (item 5), a reason-backed length limit (item 2) and a goal Claude can aim for: the customer gets the new date and a choice of two offers.
One more from the same set, a coding question:
why is my python code so slow? it loops through a big list and checks stuff
Task type: factual question. The check flags nothing here. It reads "loops through a big list" as a stated detail, and a question like this needs no audience or format. That is a limit of any automated check: it can tell whether you gave details, but not whether they are enough. Claude still has no code to read, no list size and no idea what "checks stuff" means. Paste the loop inside <code> tags, say how many items the list holds and how long it takes now, and ask for the answer as a ranked list of fixes. Each of those additions maps to an item above.
When the checklist is overkill
You do not need XML tags to ask Claude for a synonym. The checklist pays off on tasks where a wrong answer costs you time, such as a customer email or code you plan to ship. For a quick question, a clear sentence is enough.
If your prompt already names the audience, the format and the facts, a rewrite has little left to add. Run it through the prompt grader first. If nothing comes back missing and you know the details are enough, send it as is.
Do this inside Claude
Writing every prompt this way takes practice. Two tools can help while you build the habit:
- The prompt grader shows which of the four items your prompt is missing, free and with no account.
- The ChatGPT prompt generator builds a structured prompt from a short task description. The output works in Claude too.
If you want the rewrite without switching tabs, the PromptMagicPro Chrome extension enhances your prompt in place inside claude.ai, and also in ChatGPT. You can also try it on the web app: 3 enhancements every 30 days need no account, and a free account gives you 25 a month.