Claude Prompts: How to Write Them, with a Template
How to write Claude prompts that work: Anthropic's official principles, XML tags, long-document order, a before/after example and a template to copy.
The key to writing good Claude prompts is simple: treat Claude as a brilliant new hire who knows nothing about your company, and tell it everything it needs. Anthropic's official prompting guide opens with the same analogy. Add the reason behind each instruction, examples, XML tags to separate sections, and a clear role, and the same question returns a far more useful answer. This post turns the official guide's principles into a working method and gives you a template you can copy right away.
Why Claude gives off-target answers
Send only "Analyze our competitors" and Claude does not know which competitors, who the analysis is for, or how deep to go. So it gives you an average answer. The official guide says to think of Claude as a brilliant new employee who lacks context on your norms and workflows. The more precisely you explain what you want, the better the result.
The guide's check is just as simple: show your prompt to a colleague who knows little about the task and ask them to follow it. If they would be confused, Claude will be too. And if you want more than the task strictly requires, ask for it explicitly instead of hoping Claude will guess.
Five principles from Anthropic's official guide
Group the guide's general principles into five boxes for everyday work, and you get this.
- Be clear. Spell out the output format and constraints you want, and when order matters, give the steps as a numbered list.
- Explain why. The guide explains that "Don't use ellipses" works less well than "Don't use ellipses, because this text will be read by a text-to-speech engine that can't pronounce them." Claude generalizes rules from the explanation.
- Give examples. Examples are one of the most reliable ways to steer format, tone and structure. The best ones resemble the real task, vary from one another, and sit inside <example> tags.
- Separate sections with XML tags. When instructions, context, examples and input material are mixed, wrapping each in its own tag leaves less room for misreading.
- Assign a role. The official guide says that even a single sentence setting a role in the system prompt changes Claude's behavior and tone.
XML tags and long material
XML tags are the most distinctly "Claude" habit in prompt writing. There are no required tag names; just use names that are consistent and self-explanatory. With several documents, nest them: one <document> per file inside a <documents> tag.
| Tag | What goes in it | Effect |
|---|---|---|
| <context> | Background, reader, purpose | Tells Claude why the work matters |
| <instructions> | The task and its steps | Instructions don't get buried in material |
| <example> | A sample of the result you want | Locks in format and tone |
| <document> | Pasted source text and its source | Material isn't confused with instructions |
When the material is long (about 20,000 tokens or more, by the guide's measure), placement matters. The official guide recommends putting long documents at the top of the prompt, with the question and instructions below. It also explains that asking Claude to quote the relevant parts first, before the main task, helps it focus on what matters and filter out the rest.
BEFORE / AFTER: same request, different prompt
The AFTER version follows the official guide's principles directly. It puts the material on top, states the role and purpose, asks for quotes first, and separates sections with tags. It looks long, but most of it is filling in blanks, so it takes a few minutes.
A Claude prompt template you can copy
Before you send it, run the colleague check mentioned above. If someone unfamiliar with the task could read it and know what to deliver and in what shape, it is good enough. If the result falls short, another method the guide describes is to have Claude review its first draft against your criteria, then revise based on that review.
If filling in the boxes every time is a chore
SharPrompt takes a question written the way it came to mind and rewrites it as a brief with role, purpose, deliverable, constraints and evaluation criteria. It never invents missing facts; it leaves them as [brackets] and shows a "What changed" list explaining each edit and why. Paste the rewritten prompt into Claude and add the tag structure from the template above.
Turn a rough request into a strategist's brief
SharPrompt rewrites quick questions into structured prompts and builds conclusion-first slide decks.
Talk to us about your team
For team or company rollout, training or custom templates, email us at the address below.
Get new posts by email
We'll email you when a new guide, template or worked example goes up. Unsubscribe any time with one click at the bottom of any email.



