Claude Prompt Engineering Cheatsheet (Anthropic Claude)

Master Claude's prompting quirks with this reference

Ad placeholder (leaderboard)

Why Claude prompting is a little different

Claude follows instructions closely and rewards structure and clarity. Anthropic has documented that Claude works especially well with XML-style tags, explicit system prompts that assign a role, and prompts that clearly separate your instructions from the content it should act on. Get those habits right and Claude is reliable and steerable; ignore them and you get vague or inconsistent output. This cheatsheet collects the techniques that move the needle most, plus the anti-patterns to avoid.

Structure: XML tags and system prompts

Use XML tags to delimit sections. Wrap inputs and instructions in named tags so Claude never confuses them:

<instructions>Summarise the document in 3 bullet points.</instructions>
<document>{paste text here}</document>

You can then reference sections by name (“using the text in <document>”) to keep Claude focused. Put role and durable rules in the system prompt — “You are a senior legal analyst. Always cite the clause number.” The system prompt sets behaviour; the user turn carries the specific task. Order matters on long prompts: place big context first, then your instruction near the end, so the ask is fresh when Claude starts answering.

Techniques that improve output

Give examples (multishot). For any non-obvious format, show one to three worked examples inside <example> tags — examples beat description for teaching a format. Let it reason. For hard problems, ask Claude to think first, ideally inside a <thinking> block before the final answer, or enable extended-thinking mode where available; this lifts accuracy on multi-step tasks. Prefill the response. Seed the assistant turn with the opening characters to force a format — begin with { to lock JSON, or with a heading to enforce structure and skip preamble. Be explicit about output. State the exact format, length, and what to do when information is missing (return null, say “not stated”) so Claude does not guess.

Anti-patterns to avoid

Avoid vagueness — Claude takes instructions literally, so specify format, length, and tone rather than hoping. Don’t bury the instruction beneath a wall of context; keep the ask prominent and, on long prompts, near the end. Don’t mix instructions and data without tags, which invites the model to treat injected content as commands. Avoid piling on conflicting rules (“be concise but include every detail”), and never skip examples for a custom output shape. Finally, always verify factual claims — clear prompting reduces error but does not remove your responsibility to check.

Ad placeholder (rectangle)