The fastest way to get a bad answer is to prompt as if the model already knows what you know. It does not. Anthropic’s prompting guide frames every current model (Fable 5, Opus 4.8, Sonnet 5, and the rest) as a brilliant new employee: sharp, fast, capable of excellent work, and holding zero context on your job, your conventions, or what “good” means here. The golden rule falls straight out of that. If a colleague with minimal context would be confused by your prompt, Claude will be too. This is the first course in prompting, and it teaches the parts that do not change when the model does. (OpenAI’s guidance points the same way; the overlap is mapped in Claude and OpenAI, one prompting playbook.)
01Say the quiet part
Vague prompts fail because the model cannot infer what you never stated. If you want the above-and-beyond version, ask for it. If you have a format in mind, describe it. The colleague test catches most of this before you hit send: read your prompt as someone who just joined and knows nothing about the task, and every place they would stop and ask a question is a place Claude will guess. The test takes 30 seconds and pays for itself on the first prompt.
“If a colleague with minimal context would be confused by your prompt, Claude will be too.”
The sharper move is to give the reason behind a rule, not just the rule. “NEVER use ellipses” is a bare ban that covers one symbol and nothing else. “Your output will be read aloud by a text-to-speech engine, so avoid anything that does not read cleanly when spoken” is a motivation, and the model generalizes from it, dropping the ellipses, yes, but also the emoji, the stray markdown, and the table that would come out as noise. State the why and Claude extends the rule to cases you never listed. That single habit does more work than 10 times as many bans. If your prompts already lean hard on forceful bans and the model over-corrects, Stop shouting at the model shows how to dial that language back.
02Show, tag, and give the model a role
Three techniques carry across every model. First, examples. Wrap three to five in
<example> tags inside an <examples> block, and make them relevant and diverse rather than
five near-copies. The model learns your desired output far better from demonstrations than from
description, and diversity is what stops it latching onto one shape.
Second, tags. When a prompt mixes instructions, context, and the thing to act on, XML tags stop
Claude from confusing one for another. Name them for what they hold (<instructions>,
<context>, <input>), keep the names consistent, and nest for hierarchy. The tags are cheap
and the separation is real: a document that contains its own instructions will not get
mistaken for yours if it sits inside <input>.
Third, a role. One sentence in the system parameter, “You are a helpful coding assistant specializing in Python”, measurably focuses tone and behavior. The system parameter is the right home for standing character; the user turn is for the task.
03Order the docs, mean every word
For inputs past 20k tokens, put the longform documents at the top
and the query at the very end. Anthropic reports end-placed queries improved response quality by
up to 30 percent on complex multidocument tests, which is a large return for 5 minutes of
rearranging text you already have. Give each document its own <document> tag with <document_content> and <source>
subtags, and for work that leans on pulling facts from sources, ask Claude to pull relevant quotes into <quotes> tags
before it answers. That lets the model trace each conclusion back to its source.
The last fundamental is the one people trip over most: the latest models do what you literally say. “Can you suggest some changes” returns suggestions, not edits, because that is what you asked for. Want the edit made? Use the imperative: “Change this function to handle the null case.” The same literalness governs formatting, and it steers best when you say what to do rather than what to avoid. “Write in flowing prose paragraphs” beats “don’t use bullet points,” and if you want less markdown in the output, strip the markdown from your own prompt, because the model matches the style it is handed. Tell it the target, not the sin.
“Write in flowing prose paragraphs beats don’t use bullet points: say what to do, not what to avoid.”
The fundamentals, side by side:
| Fundamental | The move | Why it holds |
|---|---|---|
| Colleague test | Read the prompt as a context-free coworker | Every unasked question becomes a guess |
| Motivation | State the why behind each rule | The model generalizes past the named case |
| Examples | 3 to 5 diverse, tagged demonstrations | Demonstrations beat description |
| Ordering | Documents on top, query at the end | Up to 30 percent better on multidocument tests |
| Literalness | Imperative phrasing, positive steering | The model does what you literally say |
Further reading
- Anthropic · Claude prompting best practices, the guide this course distills
- Anthropic · prompt engineering overview, the wider technique catalogue
- OpenAI · prompt engineering guide, the other vendor’s version of the same fundamentals
- Brown et al. · “Language Models are Few-Shot Learners” (arXiv), why examples work at all
- Wikipedia · prompt engineering, the survey view