Claude Prompting Guide: The Official Framework from Anthropic’s Engineers

Table of Contents
There is no shortage of prompt engineering guides on the internet. Most of them were written by people who use Claude. This one is different. It came from the people who built it. Most of what follows applies to any large language model. But Claude has specific behaviours, particularly around XML tags and structured input, that make this framework especially effective here.
Anthropic’s own engineers put together a video breaking down exactly how to get better results from Claude, and we have turned it into a practical guide you can work through at your own pace. If you have ever wondered why your prompts work sometimes and not others, this is probably the clearest answer you will find.
This guide walks you through the 10-part Claude prompt structure applied across four versions, going from a hallucinated answer to a production-ready output you could plug into a real workflow. By the end, you’ll have a process you can apply to your own marketing campaigns, reporting automation, or internal Q&A tools right away.
To see why structure matters, start with what happens without it. The Anthropic team opened with a real example when they asked Claude to review a Swedish car insurance claim.

The Swedish accident form has 17 numbered checkboxes, alongside the driver’s hand-drawn sketch of how the crash happened. The prompt simply requested Claude to “review the claim” and nothing more. So Claude confidently describes a skiing accident with invented safety rules about uphill skiers.

Claude had no idea it was looking at a car insurance form, no instructions for interpreting the checkboxes, and no definition of what “review” meant. So it guessed. The sketch looked vaguely like a ski slope, and the rest of the response was built on top of that guess, including the fabricated rules. This is what hallucination looks like: AI generating something that sounds confident but isn’t true, filling gaps with plausible-sounding fiction whenever the prompt doesn’t give it enough to work with.
The 10-Part Claude Prompt Structure (Used by Anthropic’s Own Team)
Think of a Claude prompt the way you’d brief a new hire on their first day, covering the role, the tone, the reference material, and the expected output. If your intern keeps coming back with questions, the problem isn’t them, but the brief.

Here’s the 10-part structure outlined by Anthropic that gives every element of a good brief its own slot, from role and tone to examples and output formatting.
- Task context
- Who Claude is and what job it’s doing, like “you’re a customer support agent reviewing complaints.”
- Tone context
- How Claude should communicate, such as “stay professional and friendly, and never promise refunds without checking the order first.”
- Background data
- Reference material Claude needs to refer to, like a product catalogue, a style guide, or any document the job depends on.
- Detailed task description & rules
- The step-by-step of what to do plus any hard rules, like “read the email first, then categorise the issue, then draft a response.”
- Examples
- Sample outputs showing Claude what good work looks like, especially useful for tricky formats or edge cases.
- Conversation history
- The previous back-and-forth between Claude and the user, mostly relevant for chatbots that need to remember earlier messages.
- Immediate task
- The specific job you’re sending in right now, like “here’s the customer email I need you to handle today.”
- Thinking step by step
- Permission for Claude to slow down and reason carefully before answering, rather than jumping straight to a conclusion.
- Output formatting
- How the answer should look, such as “reply in three bullet points” or “wrap your response in response tags.”
- Prefilled response
- Writing the first word or two of Claude’s answer yourself so it continues in the right format, like starting with { to force JSON output.
Not every prompt needs all 10. For everyday work, focus on four as your minimum: task context, detailed task description and rules, immediate task, and output formatting. These four cover who Claude is, what to do, what you need right now, and how the reply should look.
The other six are force multipliers. Add a tone when brand voice matters, examples when the format is tricky, guardrails and step-by-step thinking when accuracy is critical, and prefilling when the output feeds into another system.
This structure was built for Claude, though the underlying principles i.e. role, context, task order, output format, transfer to other LLMs including ChatGPT and Gemini.
Claude Prompt Engineering Best Practices
Other tips include:
⭐️ Be specific about role and task: “help me with marketing” gets vague output. “You’re a marketing assistant writing short, punchy social media captions for a SaaS audience” gets sharp output.
⭐️ Give Claude the reference material it needs: paste the document, the data, the style guide, or the brief into the prompt itself. Anything you leave out, Claude will guess at, and that’s where hallucinations start.
⭐️ Spell out the task in detail: list the steps, the expected output, and the things to avoid. Vague briefs produce vague output, so the more precise your instructions, the more reliable the result.
⭐️ Show examples when the format is tricky: two or three sample outputs teach Claude more than a paragraph describing the format. Pick examples that cover the edges as well, not just the easy cases.
⭐️ Reinforce the most important rule at the end: Claude weighs the last instruction heavily. Close with the one rule you can’t afford to drop, like “keep every caption under 100 characters.”
Use the 10-part structure above as a reference checklist when building any serious prompt. If you want to see it applied in practice, the step-by-step walkthrough below shows how each addition changes Claude’s output in a real example.
How to Build a Claude Prompt Step-by-Step
Now to the application part. We’ll walk through each component in turn, showing what it fixes and how it changes the output.
- Set Claude’s Role and Tone: tell Claude who it is and how to communicate.
- Use XML Tags To Organise Information: Claude was trained heavily on XML-style tags and reads structured input far more reliably than plain headings or bullets.
- Order the task in numbered steps: break complex jobs into a sequence Claude works through one step at a time, rather than tackling everything at once.
- Stop Claude from Hallucinating using Task Order and Guardrails: give Claude permission to say “I don’t know,” require high confidence, and ask it to cite the source behind every claim.
- Format Claude’s Output for Consistent, Reusable Results: specify exactly how the reply should be structured, especially if it feeds into another system.
Here’s how to perform the above in detail:
1. Set Claude’s Role and Tone to Prevent Vague Output
(Components: Task context, Tone context)

⚙️ Prompt Structure Addition
The two smallest changes you can make are the biggest unlock. Telling Claude who it is and how to communicate transforms a vague “review this” instruction into a focused task.
The new instruction tells Claude: “You’re an AI assistant helping a Swedish claims adjuster review car accident reporting forms. Stay factual. Only commit to a fault verdict when you’re fully confident.”
✅ Result
With just the role and tone in place, Claude now:
- Correctly identifies the documents as a car accident report rather than a skiing incident
- Reads the marked boxes accurately, noting Vehicle A marked option 1 (was parking or stopping) and Vehicle B marked option 12 (turned off to the right)
- Refuses to assign fault when uncertain, signalling that the case needs a human adjuster
That refusal is exactly the behaviour the prompt asked for, and what a real insurance company would want from an AI system that knows when to escalate. Those two sentences are the entire fix, and they completely resolve the original hallucination problem.
3. Use XML Tags in Claude Prompts to Organise Information
(Components: Background data, Detailed task description and rules)

⚙️ Prompt Structure Addition
XML tags are angle-bracket labels like <example>…</example> that wrap a chunk of content the way section dividers work in a binder. Claude was trained heavily on this style and picks up structure more reliably from tags than from plain headings or bullets. You don’t need to know any XML to use them, because you’re just inventing your own labels based on what makes the structure obvious.
To apply this idea, we will wrap each chunk of background info in clear XML labels. The form has 17 rows, Column A is always Vehicle A, and Column B is always Vehicle B, so all of that context goes into the prompt in two labelled sections.

The system prompt now includes two labelled sections:
- <form_meaning>: explains what the form represents and how to interpret the two columns
- <form_interpretation>: adds notes on handling messy handwriting, crossed-out boxes, and ambiguous markings
✅ Result
Claude no longer has to figure out the form structure from scratch on every request. It confidently names Vehicle B as at fault, citing specific boxes as evidence.
3. Stop Claude from Hallucinating Using Task Order and Guardrails
(Components: Detailed task description and rules, Immediate task, Thinking step by step)
⚙️ Prompt Structure Addition
The next two additions numbered task ordering that keeps Claude from jumping to conclusions, and guardrails that stop it from making things up.
Task ordering means breaking a complex job into numbered steps that Claude works through in sequence, rather than letting it tackle everything at once. AI tends to jump to conclusions when given multiple inputs together, so forcing a sequence keeps reasoning grounded, mirrors how a human would approach the same task, and gives you control over what Claude considers before drawing any conclusion.
To prevent hallucinations, here are 4 tactics worth baking into every serious Claude prompting workflow:

- Give Claude permission to say “I don’t know”: most AI defaults to answering even when it shouldn’t, so tell it explicitly that deferring is acceptable
- Require high confidence: add a rule like “only commit to an answer when very confident”
- Make it think before answering: tell Claude to reason step by step rather than jump to a conclusion
- Demand evidence: every factual claim ties to a source such as a specific box, a direct quote, or a region of an image

Here’s how task ordering and anti-hallucination guardrails work together in practice. Each step is wrapped in a <task id> tag to enforce the sequence a human would follow:
- Task 1: examine every checkbox in both columns
- Task 2: summarise the form into an accident description
- Task 3: review the sketch with that summary in mind
- Task 4: deliver the final verdict
The guardrails section reinforces all four anti-hallucination tactics by telling Claude not to invent details, to cite the specific box behind every claim, and to refuse if the sketch is unreadable.
✅ Result
The two fixes change Claude’s behaviour in distinct ways.
- Task ordering forces Claude to work through the form one step at a time. No more jumping to a conclusion based on the first thing it noticed.
- The guardrails keep every claim grounded in the form itself. Claude cites the specific box behind each observation, defers when the sketch is unreadable, and refuses to invent details.
The trade-off is length. Methodical reasoning produces a longer output, easy to audit but slow to scan. Ask Claude to summarise the final verdict if you want something shorter.
4. Format Claude’s Output for Consistent, Reusable Results
(Components: Output formatting, Prefilled response)
⚙️ Prompt Structure Addition
The final piece is making Claude’s output easy for humans to understand, and also to feed into other systems.
Output formatting means specifying exactly how Claude should structure its reply, rather than letting it write in free-form prose. This matters whenever Claude’s output is meant to be processed automatically, like a database entry, a dashboard, an email automation, or any downstream tool that needs to extract specific fields from the answer.
Wrapping the results in a <final_verdict> label so downstream systems can pull it out cleanly, regardless of what Claude wrote around it. The output stays machine-readable without losing the human-readable analysis above it.

In the example above, Claude’s reply slot starts with already typed in. Claude picks up from that point and fills in the verdict directly, skipping any “Sure, here’s my analysis” preamble. The same trick works for JSON outputs: prefill with { and Claude jumps straight into the object without any chatter around it.
A pro tip: use prefilling to lock the format in. Prefilling means writing the opening of Claude’s reply yourself, so Claude continues from where you left off rather than starting from scratch. You get two wins at once: consistent formatting, and lower token costs on every run because Claude skips the preamble.

Advanced Claude Prompting Techniques: Few-Shot Examples and Extended Thinking Explained
Apart from the fixes covered above, here are two bonus techniques worth knowing if you want to push Claude’s output further.
Use Examples in Claude Prompts
The easiest way to get Claude to follow a specific format is often to show 2 to 3 examples instead of describing the format in words. New hires learn faster from past reports than from style guides, and Claude is similar.1

Aim for 3 to 5 diverse examples chosen to push the edges of what you’re testing, like the angry customer emails or the ambiguous ones that normally needed a human.
Examples become especially important when you have a brand guide or a strict tone of voice to follow. Describing your voice in words (like “friendly but professional, never salesy”) leaves too much room for interpretation, and Claude will fill the gaps with its own defaults. Showing 3 to 5 on-brand samples gives Claude a concrete target to match, so the output truly sounds like your brand.
Extended Thinking and When to Use it
Extended thinking is a Claude feature that lets the model reason through a problem before producing an answer, like showing your working on a maths problem.

The smart move: turn it on during development, read how Claude approached the task, then turn its reasoning into instructions. Whatever Claude did well on its own, write into the prompt so it does it. Two trade-offs you should know: it costs extra tokens to process and it’s less predictable, as the same prompt won’t give identical output every time.
How to Apply Claude Prompting to Your Daily Work
This guide was developed from prompting techniques used by Anthropic’s own engineers, but the value is not in copying a perfect prompt. It is in learning the structure behind reliable AI work.
Whether you are working with Claude, ChatGPT, or any other LLM, the fundamentals are the same: the model needs a role, context, ordered instructions, and a defined output. This guide covered how Anthropic’s own engineers apply that to Claude, but the structure transfers directly to any AI tool you use at work.
A clear role, labelled context, ordered steps, guardrails, and structured output can turn a vague response into something you can actually review, reuse, and deploy. Once you have a prompt that works, it becomes a repeatable workflow for next week’s emails, reports, content calendars, customer replies, or internal processes.
That is what Tribe Academy’s Generative AI courses are built around: practical AI skills you can apply directly to daily work, from better prompting to workflow. That is what Tribe Academy’s Generative AI courses are built around: practical AI skills you can apply directly to daily work, from better prompting to workflow automation and real business use cases. Built in collaboration with SMU Academy, the programmes are SWDA-eligible for Singapore mid-career professionals and delivered by industry practitioners working in the field.




