Skip to content
Claude

Claude Prompting Guide: Getting the Most from Claude

Claude rewards clear structure and context. Learn the techniques that work especially well with Anthropic's models, including XML tags and long-context tips.

Illustration of a structured prompt tailored for Claude

Claude tends to reward writers who stay organized. Hand it a wall of mixed instructions and raw text, and it will still try to help, but you get sharper, more reliable results when you treat your prompt like a short brief rather than a stream of consciousness. The model follows a plan well when it can actually see the plan. That idea sits underneath every technique below.

Give Claude a shape to follow

Before you type anything, decide what the pieces of your request are. Most prompts break into a few parts: the task, any background the model needs, the material it should work from, and the format you want back. When you keep those parts visually distinct, Claude spends its effort on the work instead of guessing which sentence was the real instruction.

A simple ordering that holds up well:

  • Context first, so the model knows the situation.
  • The source material or data it should use.
  • The specific task, phrased as a command.
  • The output format you expect.

You don't need fancy formatting to do this. Headings, numbered steps, and short labeled sections all work. A person skimming your prompt should be able to tell the instructions from the data in about two seconds. If you can, so can Claude. For a broader foundation on this way of thinking, the fundamentals of prompt engineering cover why structure beats cleverness almost every time.

Wrap your data in tags

Claude was trained on a lot of structured text, and it responds well to XML-style tags that mark where one thing ends and another begins. Tags like <document>, <instructions>, and <example> act as fences. They stop a quoted email from being read as a command, and they let you point back to a section by name later in the prompt.

Here is a support-reply task with the customer message fenced off from the instruction:

<instructions> Draft a reply to the customer message below. Be warm, apologize once, and offer a concrete next step. Keep it under 120 words. </instructions> <customer_message> I ordered the standing desk three weeks ago and it still hasn't shipped. Your tracking page just says "processing." I'm getting frustrated. </customer_message>

Because the message sits inside its own tag, Claude won't mistake "I'm getting frustrated" for part of your instructions. Tags also make few-shot examples cleaner, since you can label each demonstration:

<instructions> Classify each review as positive, negative, or mixed. Match the format of the examples exactly. </instructions> <example> Review: "Battery dies in an hour but the screen is gorgeous." Label: mixed </example> <example> Review: "Worked perfectly out of the box, no complaints." Label: positive </example> <review> Coffee maker leaks every time and support never answered. </review>

You can invent your own tag names. <transcript>, <policy>, and <draft> all work as long as you stay consistent. If you also need machine-readable output, describe the shape you want and reach for a JSON prompt builder to keep the structure tidy.

Tip: Reference your tags by name in the instruction itself. Saying "using only the facts in <document>, answer the <question>" nudges Claude to stay grounded in what you gave it instead of filling gaps from memory.

Put the long stuff first

When your prompt includes a big document, a transcript, or a batch of records, place that material near the top and put your question at the end. Claude does better when it has read the source before it reads what you are asking of it. Ending with the question also keeps the instruction fresh in the model's working attention.

<document> [ Paste the full 20-page contract here ] </document> Using only the contract above, answer these: 1. What is the termination notice period? 2. Are there any automatic renewal clauses? 3. Quote the exact sentence that covers late-payment penalties.

This ordering matters more as the input grows. For a two-line question it makes no difference, but for anything long, question-last is the safer habit.

Say what you mean, plainly

Claude follows direct instructions better than hinted ones. If you want three bullet points, ask for three bullet points. If you want the answer to skip a preamble, tell it not to restate the question. Vague asks produce vague output, and then you spend a second round correcting it.

A few swaps that tighten a prompt:

  • Instead of "maybe summarize this," write "summarize this in five sentences."
  • Instead of "make it professional," name the audience and tone: "write for a busy CFO, formal but not stiff."
  • Instead of "don't be too long," set a limit: "keep it under 200 words."
  • If a rule is firm, mark it: "You must cite a line number for every claim."

Spelling out edge cases helps too. Tell Claude what to do when the answer is not in the text ("if the contract is silent, say so rather than guessing"). Readers coming from other tools will find the same directness pays off, and the guide to ChatGPT prompts shows how much of this instinct carries across models. When you want a second pass on wording, a prompt optimizer can tighten a draft you have already written.

Set the ground rules with a system prompt

The system prompt is where you tell Claude who it is and how to behave for the whole conversation, separate from any single question. Use it for the role, the tone, the hard constraints, and anything that should hold across every turn. Keep the task-specific details in the regular message.

[System] You are a meticulous contracts analyst. You cite the exact clause for every claim, you never invent terms that aren't in the document, and when something is ambiguous you flag it instead of smoothing it over. Answer in plain English a non-lawyer can follow.

With the role fixed up front, your later messages can stay short. You ask the question; the behavior is already set. A system prompt generator helps if you would rather start from a template than a blank box.

Give Claude room to think

For anything that needs reasoning, such as math, multi-step logic, or weighing options, ask Claude to work through it before committing to an answer. Naming the steps out loud tends to improve the final result, because the model is not trying to leap straight to a conclusion.

<instructions> Decide whether this refund request qualifies under the policy. First, in a <reasoning> section, walk through each policy rule and whether the request meets it. Then give your verdict in a <verdict> section as one word: approve or deny. </instructions>

Splitting the reasoning and the verdict into separate tags gives you a bonus: you can show users only the verdict while keeping the reasoning for your own logs. If you want to push this further with structured chains and self-checking, advanced prompt engineering goes deeper.

Lean on the big context window

Claude can hold a large amount of text at once, which changes what you can attempt in a single prompt. Rather than summarizing a report before you feed it in, paste the whole thing and ask questions against it. A few uses that pay off:

  • Drop in an entire codebase file and ask for a targeted change.
  • Paste a long meeting transcript and pull out every action item with its owner.
  • Compare two contracts side by side, each in its own tag, and list the differences.
  • Give several samples of your writing so the reply matches your voice.

More context is not automatically better, though. Irrelevant filler can distract the model, so include what is genuinely useful and cut the rest. Label each big block with a tag so Claude can tell your three documents apart. Used well, the room to include real, complete source material is what separates a generic answer from one grounded in your actual work.

References

Put this into practice. Apply what you just read with our free tool: Prompt Optimizer →
By AI enthusiast & advanced user

Jordi Benitez has been using AI tools day to day for years. No researcher, no academic title — just an advanced user who has spent enough hours prompting ChatGPT, Claude, Gemini and image models to know what actually works, and built GetEasyPrompt to share it in plain language.

FAQ

Frequently asked questions

Claude responds especially well to clear structure, explicit context and XML-style tags that separate instructions from content. It also handles very long inputs, so you can give it more context than you might expect.
Often, yes. Wrapping content in tags like <document> or <instructions> helps Claude tell your data apart from your commands, which reduces mistakes on complex tasks.
Yes. A system prompt sets Claude's role and rules for the whole conversation. Our System Prompt Generator can help you write one.

Write your next prompt in seconds

Turn a rough idea into a clear, structured prompt any AI can follow. Free, private, and no account needed.

Open the Prompt OptimizerSee all tools