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