How to Write Better Claude Prompts: 7 Principles That Change Your Results

Not another copy-paste template pack — the principles behind prompts that actually work. Clarity, context, examples, roles, output format, step-by-step thinking, and XML separation, with good/bad examples, based on Anthropic's official guide.

1 views

The same question can produce very different answers depending on how you write it. Anthropic's official guide frames a good prompt as "narrowing the gap between your intent and the model's interpretation." When a prompt is vague, the model fills the blanks with its own guesses, so results come out inconsistent. Unlike a copy-paste template pack, this article focuses on why and how to write prompts that work.

Vague prompt vs precise prompt ✕ Vague prompt "Summarize this." → length / format / angle unclear → Claude fills the gaps by guessing Result: inconsistent each time ✓ Precise prompt "Summarize the text below for execs as 3 bullet points." → task, context, format are clear → little room to guess Result: consistent, predictable A good prompt narrows the gap between your intent and the model's interpretation. 4 ingredients of a precise prompt 1Taskwhat to do2Contextwho for · where used3Exampleshow a sample4Formatwhat shape The clearer these four, the more consistent the result.

First, the golden rule

The guide's core analogy: treat Claude like "a brilliant but brand-new employee who has no context." It doesn't know your norms, style, or preferences, so the more precisely you explain, the better the result. A simple check: if a colleague unfamiliar with the task would be confused by your prompt, Claude likely will be too.

Seven principles that change your results

The 7 principles at a glance 1Be clear & specific2Enough context & purpose3Show examples (few-shot)4Assign a role5Specify output format6Think step by step7Separate data (XML)

1. Be clear and specific

The single biggest improvement is stating exactly what you want done. Vague instructions produce vague output.

Bad: "Clean this up." → Good: "Summarize the text below for a non-expert as 3 bullet points, one sentence each."

2. Give enough context and purpose

Tell Claude who the output is for and where it will be used, and the tone and level fall into place. A single line like "for an exec summary," "explain it to a 10-year-old," or "as a blog intro" changes the result dramatically.

3. Show examples (few-shot)

Giving one or two input→output examples of the format and tone you want is often more accurate than a long description. You're showing the "like this" instead of describing it.

4. Assign a role

Specifying a professional role — "as a seasoned data analyst," "as a meticulous copy editor" — makes Claude answer with that perspective and vocabulary. Put it in the system prompt to apply it consistently across the whole conversation.

5. Specify the output format

State the shape you want: table, bullets, JSON, step-by-step. Constraints like "as a table," "JSON with keys name and price," or "under 300 characters" cut down on post-processing.

6. Let it think step by step

For complex reasoning or math, asking Claude to "think step by step before answering" tends to improve accuracy (so-called chain-of-thought) — have it lay out the reasoning first, then conclude.

7. Separate data from instructions (XML tags)

When handling long source text or data, separate the instructions from the data. Anthropic recommends wrapping content in XML tags like <document>...</document> to make the boundary explicit, so it's clear what is "the thing to process" versus "the instruction."

Summarize the text inside <article> in 3 sentences.

<article>
(paste the source text here)
</article>

Common mistakes

  • Vagueness: "just make it good" has no criteria, so you get a different result every time. Specify length, angle, and format.
  • Relying on tricks: odd formats or workarounds to squeeze out quality tend to break as models change. Principled, clear instructions are more stable.
  • Over-instructing: asking for features you didn't need blurs the focus. Keep it scoped to what's required.

Don't try to nail it in one shot

Prompts are refined — the loop 1Write2Run3Check result4Add what is missing↻ 다시 처음으로 Look at the output, add context / examples / format, and retry.

A prompt doesn't have to be perfect on the first try. The fastest path is to look at the result and refine — adding the missing context, examples, or format. For accuracy-critical tasks, allowing Claude to say "I don't know" when unsure also helps reduce hallucinations.

Wrap-up

In short, a good prompt reduces the room for the model to guess — a clear task, enough context, examples, a role, a format, step-by-step thinking, and data/instruction separation. For deeper techniques and model-specific guidance, see Anthropic's official docs (prompt engineering overview). If you want ready-made examples, see the prompt template pack too.

New here?: Prompt Basics for Beginners

Keep reading

Have a question or want to share how you use Claude?

Join the community to share tips with other users, or explore more guides.