Claude prompting guide: how to prompt Claude so it does what you mean

TL;DR: To prompt Claude well, write clear, direct instructions and explain why they matter. Give it the context it can't know, show three to five examples, separate parts with XML tags, put long documents before your question, and say what to do rather than what not to do. Recent Claude models follow instructions closely, so ask for exactly what you want.

How Claude reads your prompt

Claude takes your words at face value. Anthropic's own prompting guide says Claude responds well to clear, explicit instructions, and that if you want more than the task strictly requires, you should ask for it rather than hope it infers it. Recent models are trained for precise instruction following, so a vague request gets a careful, minimal answer to the vague request.

Anthropic suggests a picture that helps: treat Claude as a brilliant but new employee who doesn't know your norms or workflows. It is capable, but it has never seen your company, your customers or your last three drafts. Everything it needs has to be in the prompt, or in files you give it.

The guide also gives a quick test you can run before you hit send: show the prompt to a colleague who knows little about the task. If they would be confused, Claude will be too.

This page covers what is specific to Claude. For the general method that works in any chatbot, see how to write a prompt.

1. Be clear and direct

Say what you want, for whom, in what shape. Specify the format and the limits. When order matters, write the steps as a numbered list. And use verbs that match the outcome you want, because Claude reads the difference between asking for advice and asking for action.

Vague prompts and clearer rewrites
Instead ofWriteWhy it is better
Can you suggest some changes to this paragraph?Rewrite this paragraph so it is under 60 words and keeps both numbers."Suggest" gets suggestions. Anthropic's docs note that Claude will sometimes only suggest, even when you wanted the change made.
Write something about our new pricing.Write a 120-word email to existing customers explaining that the Team plan rises from $20 to $24 on 1 March. Lead with what they keep.Names the reader, the facts, the length and the angle.
Make a landing page.Make a landing page for [product]. Include a pricing table, an FAQ and a signup form. Go beyond a basic layout.If you want the fuller version, Claude needs to be told. It won't assume you want extras.
Summarize this.Summarize this report in five bullet points for a CFO who has two minutes. End with the one decision it asks for.Gives the reader, the format and the point of the summary.

2. Explain why, not just what

Give the reason behind an instruction and Claude applies it more intelligently. Anthropic's example is a rule about ellipses: "NEVER use ellipses" works less well than explaining that the response will be read aloud by a text-to-speech engine that can't pronounce them. The docs add that Claude can generalize from the explanation, so it also avoids other things a speech engine would stumble on.

An instruction with its reasons attached
Write the product update for our changelog. Keep it under 150 words and avoid internal code names, because customers read this page and the names mean nothing to them. Lead with what they can now do, because most readers only see the first line in the email preview.

Each "because" does real work. Without it, Claude follows the letter of the rule. With it, Claude can handle the cases your rule didn't name.

3. Show examples

Examples are one of the most reliable ways to steer Claude's format, tone and structure. Anthropic recommends three to five, and asks that they be relevant (close to your real task), diverse (so Claude doesn't copy an accidental pattern, like every example starting with the same word) and clearly marked, by wrapping each in <example> tags inside an <examples> block.

Few-shot prompt with tagged examples
Write a one-line release note for each change below, in the same style as the examples.

<examples>
<example>Change: added CSV export to reports
Note: You can now export any report to CSV from the Share menu.</example>
<example>Change: fixed timezone bug in reminders
Note: Reminders now arrive at the right time if you travel across time zones.</example>
<example>Change: faster dashboard loading
Note: Dashboards with many charts now open noticeably faster.</example>
</examples>

Changes:
[paste your list]

The technique has a name, few-shot prompting, and it works with Claude's thinking too: worked examples shape how Claude reasons about similar problems, not just how it formats the answer.

4. Use XML tags to separate the parts

When a prompt mixes instructions, background, examples and pasted material, Claude can lose track of which is which. Anthropic's fix is simple: wrap each kind of content in its own tag, such as <instructions>, <context> and <input>. There are no magic tag names. Pick descriptive ones, use them the same way every time, and nest them when content has a natural hierarchy.

A prompt structured with XML tags
<context>
We are a 12-person accounting firm. Our clients are small businesses in [region]. Tone: plain, warm, no jargon.
</context>

<instructions>
Write a reply to the client email in <email>. Answer their question in the first sentence. If the answer depends on a fact you don't have, say what you need instead of guessing. Under 120 words.
</instructions>

<email>
[paste the client's email]
</email>

Tags also help on the way out. Ask Claude to put its answer inside a tag, say <reply>, and the part you need is easy to find, or to pull out with code if you use the API.

5. Put long documents first, and ask for quotes

With long inputs (Anthropic's docs talk about 20,000 tokens and up), where you put things matters. Place the documents at the top of the prompt and your question and instructions at the end. Anthropic reports that putting the query at the end improved response quality by up to 30 percent in its tests, especially with several documents.

Two more habits from the same guide. Wrap each document in its own tag with its source, so Claude can tell them apart and say which one a claim came from. And for long-document tasks, ask Claude to pull out the relevant quotes first, then answer from those quotes. That keeps it focused on what the documents actually say.

Long-document prompt: documents first, quotes, then the answer
<documents>
<document index="1">
<source>[file name, for example: q3-board-report.pdf]</source>
<document_content>
[paste document 1]
</document_content>
</document>
<document index="2">
<source>[file name]</source>
<document_content>
[paste document 2]
</document_content>
</document>
</documents>

First, find the passages in these documents that are relevant to [your question] and copy them into <quotes> tags, with the document number for each. Then answer the question using only those quotes, in <answer> tags. If the documents don't answer it, say so.

If you upload files in the Claude apps instead of pasting them, the same idea holds: attach first, then write a question that names the files and asks for quotes.

6. Let Claude think, then ask it to check

Current Claude models can reason before they answer. Anthropic's docs describe this as adaptive thinking: Claude decides when and how much to think based on how hard the question is and on an effort setting. In the API and in Claude Code, that effort setting is the main control for depth, not the wording of your prompt.

That changes two old habits. First, you rarely need to script the reasoning. Anthropic notes that a general instruction such as "think thoroughly" often produces better reasoning than a hand-written step-by-step plan, because Claude's own approach frequently goes beyond what you would prescribe. Second, on some of the newest models, asking Claude to write its reasoning out in <thinking> tags in the reply can be declined. Let the built-in thinking do that job.

One instruction still pays off: ask for a self-check against criteria you name.

Ask Claude to verify its own work
Before you give me the final answer, check it against these points: [criteria, for example: every figure matches the spreadsheet, the total adds up, no client is named]. Fix anything that fails, then give me the answer and one line saying what you checked.

Anthropic says this catches errors reliably, especially in code and maths. There is one documented exception: Claude Opus 5 already checks its work well, and the docs advise removing extra verification instructions for that model because they add tokens and time without making the answer better.

7. Control the format the positive way

Tell Claude what you want, not what you don't. Anthropic's example: instead of "Do not use markdown in your response", write "Your response should be composed of smoothly flowing prose paragraphs." A list of don'ts leaves Claude guessing what you do want.

  • Match your prompt to the output. The style of your prompt rubs off. A prompt full of headings and bullets invites a reply full of them; a prompt in plain paragraphs gets fewer.
  • Name the container. "Put the summary in <summary> tags" or "return a table with these columns" is easier to hit than "make it neat".
  • State length in units. "Three sentences" or "under 200 words" beats "brief".
  • Kill the preamble directly. Write "Respond directly without preamble. Do not start with phrases like 'Here is'." This is the replacement Anthropic now recommends for an old trick, below.

Prefill is gone on recent models. Developers used to start Claude's reply for it (for example with an opening brace to force JSON). Starting with the Claude 4.6 models, a prefilled last assistant turn returns an error in the API. Anthropic's suggested replacements are plain instructions, XML tags, tool calls or the structured outputs feature for strict schemas.

What has changed in recent Claude models

Most prompting advice for Claude was written for older models. Anthropic's current guide flags several habits worth dropping. As of November 2026, its lineup is Claude Fable 5.2, Claude Opus 5.5, Claude Sonnet 5.5 and Claude Haiku 5.5, and its models page suggests starting with Opus 5.5 for most work. Anthropic also keeps a prompting page for each recent model, which is worth reading if you build on one in particular.

Old Claude prompting habits and what to do now
Old habitWhat to do nowWhy
CRITICAL: You MUST use this tool when...Use this tool when...Anthropic notes newer models are more responsive to instructions, so shouting makes them over-apply a rule.
Prefill the reply to force a formatAsk for the format, use tags, or use structured outputsPrefilling the last assistant turn is not supported from the Claude 4.6 models on.
Write out a step-by-step reasoning scriptAsk it to think the problem through, and set effort if you canGeneral instructions often beat a prescribed plan, and effort controls depth.
Ask it to show its reasoning in &lt;thinking&gt; tagsRely on built-in thinkingSome recent models may decline to write reasoning into the reply.
"If in doubt, use the tool" and other nudgesDescribe when the tool helpsTools that were under-used by older models now tend to trigger when they should; nudges cause overuse.
Expect long summaries after every stepAsk for a summary if you want oneRecent models are more concise and may skip recaps unless asked.

A full before and after

Here is a typical work request, first as most people type it, then rebuilt with the techniques above.

Before
Can you look at these customer interviews and tell me what people think?
After
<interviews>
[paste the transcripts, each in its own <interview> tag with the customer's role and company size]
</interviews>

<context>
We sell scheduling software to clinics. I am preparing a one-page brief for our product team, who will use it to pick next quarter's top three features. They trust direct customer words more than summaries.
</context>

<instructions>
1. Find every complaint or request about a missing feature, and quote it with the interview it came from.
2. Group the quotes into themes. Rank the themes by how many different customers raised them, not by how often a theme came up.
3. Write the brief: one sentence per theme, the count, and the strongest quote.
4. List anything that contradicts the main themes.
Write in plain prose with the brief as a numbered list. Under 400 words.
</instructions>

What changed: the interviews come first and are tagged, the context says who reads the result and why they prefer quotes, the steps are numbered because order matters, the ranking rule is explicit, and the length and format are stated. Claude no longer has to guess any of it.

When Claude still gets it wrong

  1. Too generic: add the context only you know, or ask Claude to ask you three questions before it answers.
  2. Did less than you hoped: say so plainly. "Include edge cases" or "go beyond the basics" tells Claude the scope you had in mind.
  3. Ignored a rule: check whether another line contradicts it, then add the reason behind the rule rather than capital letters.
  4. Wrong format: show one example of the exact output you want.
  5. Mixed up your materials: put each document or input in its own tag and refer to the tags by name.
  6. Too big for one prompt: split it into steps and check each result. Anthropic still recommends this when you need to inspect the work in between; it's called prompt chaining.

If you use the same instructions in every chat, move them out of the prompt: a Project's instructions in the Claude apps, or the system field in the API. Our guide to the Claude system prompt shows how to write one.

Let the right experts write your prompt

Prompt Expert is an AI prompt generator that brings the right experts to every job. They ask a few questions, read your website and files, and write the prompt for ChatGPT, Claude or Gemini with your real facts, working together when a job needs more than one.

See how it works

Questions

How do I prompt Claude effectively?

Give clear, direct instructions with the reason behind them, and include the context Claude can't know. Add a few examples of the output you want, separate the parts of the prompt with XML tags, and put long documents before your question.

Does Claude work better with XML tags?

Yes, for prompts with several parts. Anthropic recommends wrapping instructions, context, examples and pasted material in their own tags so Claude doesn't confuse them. Any clear tag names work, as long as you use them consistently.

Is prompting Claude different from prompting ChatGPT?

The basics are the same: clear instructions, context, examples and a stated format. What is specific to Claude is Anthropic's guidance on XML tags, putting long documents before the question, and the fact that recent models follow instructions very literally.

Should I tell Claude to think step by step?

Usually not in so many words. Current Claude models reason on their own, and Anthropic notes that a general instruction to think it through often works better than a scripted plan. In the API and Claude Code, the effort setting is the real control for how much it thinks.

Can I still prefill Claude's response?

Not on recent models through the API. From the Claude 4.6 models on, a prefilled last assistant turn returns an error. Use a direct instruction, XML tags or structured outputs instead.

Where should I put a long document in a Claude prompt?

At the top, before your question and instructions. Anthropic's tests found that putting the question at the end improved answer quality, by up to 30 percent with complex, multi-document inputs.

Sources