You’re Prompting Claude Wrong: Anthropic’s Official Prompt Engineering Guide

“Be professional” leaves Claude guessing who will read the report and what it must contain. What changes when the prompt includes an example of an acceptable result?

You’re Prompting Claude Wrong: Anthropic’s Official Prompt Engineering Guide

If Claude keeps returning generic prose, specify who will use the answer, which evidence matters, what the result should contain and when the task is complete. “Analyze this deeply,” “be professional,” and “do your best” leave those requirements open, so Claude has to guess them.

Anthropic's own framing is useful: treat Claude like a highly capable new employee who does not know your workflow. If a colleague with little context could not execute your prompt consistently, neither can the model. Prompt engineering is therefore closer to writing a good brief than discovering magic words.

Which report requirements your prompt leaves undefined

Consider “Review this strategy and write a professional report.” It leaves the audience, business objective, permitted sources, decision criteria, length and structure undefined. Claude must choose all six for you, so a well-written report can still address the wrong audience or apply the wrong criteria.

THE COMMON FAILURE

When report requirements are missing, Claude has to guess them

Specify the audience, purpose, sources, criteria, length and structure when those choices matter. Adding words helps only if they clarify what Claude should produce.

10 prompt-engineering practices Anthropic recommends

1. Write the acceptance criteria, not “do your best”

Name the audience, deliverable, length, required elements and exclusions. If order matters, use numbered steps. Replace “summarize this” with “write five bullets for an executive who has two minutes; separate revenue impact from operational risk.”

2. Explain why a constraint exists

Context helps Claude generalize when the input does not match your happy path. “Use short sentences because this will be read on a phone during field work” carries more intent than “use short sentences.”

3. Use three to five relevant, varied examples

Examples are among the most dependable controls for format, tone and classification boundaries. Anthropic recommends examples that resemble the real task, cover meaningful edge cases and use a consistent structure. A single example can accidentally teach irrelevant quirks.

4. Separate instructions, sources and input with XML tags

When instructions, reference material, examples and live input share one block, their roles can blur. Descriptive tags such as <instructions>, <context>, <examples> and <input> make the boundaries explicit. The tag names matter less than using them consistently.

5. Define a role by its priorities

“You are a marketer” gives Claude little guidance about which results matter. “You optimize B2B SaaS acquisition for qualified pipeline and revenue, not raw clicks” tells it how to judge a marketing proposal. Put persistent role and behavior instructions in the system prompt when using the API.

6. Put long documents before the query

For data-rich prompts above roughly 20,000 tokens, Anthropic recommends placing the source documents near the top, followed by the query and instructions. Its documentation reports that moving the query to the end improved answer quality by up to 30% in tests involving complex, multi-document input.

7. Describe the output you want in positive terms

“Lead with the conclusion and limit supporting evidence to three bullets” is more actionable than “do not ramble.” Current Claude models also follow scope literally: if a format applies to every section, say so instead of assuming the model will generalize it.

8. Adjust the model’s effort setting for difficult tasks

Current Claude API models use adaptive thinking and model-specific effort controls. If Claude gives a difficult coding or agent task too little reasoning, try raising effort first. Repeating “think very deeply” cannot reliably compensate for a setting that prioritizes fast responses. Excessive instructions to verify the result can also waste tokens on capable models.

9. Tell Claude when tools are mandatory

Specify when Claude should use each available tool: search for current information, open a named file before answering, or check a calculation with code. For coding tasks, a rule can be as simple as: never make a claim about code you have not inspected.

10. Add a narrow verification step

Ask Claude to check the result against concrete criteria: source numbers, schema validity, test cases or omitted requirements. Avoid a generic instruction to verify everything repeatedly. Newer top-tier models can over-verify when old prompts keep pushing them to recheck work they already validated.

From vague request to executable brief

Weak prompt: “Analyze this material like an expert and write a great report. Do not make mistakes. Think deeply.”

“Expert,” “great,” and “deeply” do not define a result you can check. The following brief specifies the analyst’s priorities, the reader, the required calculations and the report format:

<role>
You are a strategy analyst reviewing B2B SaaS unit economics.
Prioritize cash flow and customer-acquisition efficiency over headline growth.
</role>

<context>
The CFO will use this in next quarter's budget meeting.
</context>

<instructions>
1. Separate source facts from your interpretation.
2. Calculate quarter-over-quarter changes.
3. Identify the three largest risks and a response to each.
4. Do not estimate numbers missing from the source.
</instructions>

<output_format>
Three-sentence conclusion, KPI table, risks and responses, missing information.
</output_format>

<source>
...source material...
</source>

Write the CFO briefing using the criteria above.

A reusable Claude prompt template

<role>
[Expert role and its decision priorities]
</role>

<goal>
[Who will use the output, and what decision will it support?]
</goal>

<context>
[Background, constraints, and definitions]
</context>

<instructions>
1. [Required action]
2. [Evidence rule]
3. [When to ask, stop, or exclude]
</instructions>

<examples>
[Three to five representative input/output examples]
</examples>

<output_format>
[Order, length, tables, fields, and voice]
</output_format>

<verification>
[Specific checks before completion]
</verification>

<input>
[Live task material]
</input>

Do not fill every block by habit. A one-line lookup does not need eight XML sections. Use structure where a boundary could be misunderstood or an important choice would otherwise be guessed.

Check the prompting guide for your Claude model

Anthropic now publishes model-specific prompting pages because initiative, literal instruction following, tool use, thinking defaults and self-verification change between releases. A prompt tuned to force an older model through every step may cause a newer model to expand scope or verify excessively.

Reuse the role, task, examples and output requirements across prompts. When changing models, retest effort, thinking, conditions for tool use and progress updates. Keeping these settings separate from the task instructions makes it easier to update the prompt without retaining every workaround for older models.

Specify the choices Claude should not have to guess

A useful prompt states who needs the result, what decision it supports, which evidence is allowed and what counts as complete. Examples show Claude an acceptable result; verification criteria let you judge whether it has produced one consistently.

Before adding “think harder,” check four things: Is the goal visible? Are source material and instructions separated? Have you shown a representative output? Can completion be tested? Most bad Claude prompts fail one of those checks.

Frequently asked questions

What is the best way to write a prompt for Claude?

Define the role, outcome, context, instructions, constraints, output format and verification criteria. Add three to five representative examples when consistency matters, and separate complex prompt sections with descriptive XML tags.

Does Claude work better with XML tags?

XML tags help when instructions, source material, examples and user input are mixed in one prompt. They are unnecessary for simple questions, but useful for making boundaries explicit in reusable production prompts.

Should I tell Claude to think step by step?

Do not hand-write a reasoning process unless the task requires a particular method. For current API models, start by choosing the appropriate effort and adaptive-thinking settings, then specify the goal and a concrete verification test.

Are longer Claude prompts more accurate?

Not automatically. Anthropic recommends including only the context needed to support the task. Long documents may be necessary, but repeated rules and irrelevant history use context without clarifying the outcome.