Claude system prompt patterns cheatsheet (Anthropic best practices, 2026)
High-leverage system prompt patterns for Claude 4.6 Sonnet: role + objective + constraints + format, XML tagging, refusal phrasing, extended thinking, tool routing.
Skeleton
Anthropic's recommended structure: role + capabilities + constraints + format + examples (in user turns).
| Item | Description | Example |
|---|---|---|
Role | One sentence: who Claude is in this session. | You are a senior product lawyer reviewing SaaS terms. |
Objective | What success looks like for this conversation. | Flag every clause that materially shifts liability. |
Constraints | Hard rules. Phrase as positive 'always' / negative 'never'. | Always cite the section number. Never speculate beyond the document. |
Format | Output schema: markdown, JSON, XML, custom. | Reply as a markdown table: section | risk | suggestion. |
XML tagging
Claude is trained to respect XML tags. Use them to delimit document, examples, scratchpad.
| Item | Description | Example |
|---|---|---|
<document>…</document> | Wrap source material the model must read. | |
<example>…</example> | Wrap few-shot examples in user-turn messages. | |
<thinking>…</thinking> | Reserved scratchpad for Claude's reasoning — used by extended thinking automatically. | |
<output>…</output> | Force the final answer into a tag so downstream code can extract. | |
Refusal phrasing
| Item | Description | Example |
|---|---|---|
Use 'I can't' not 'I won't' | Reduces user frustration in chat UIs. Keeps the model from sounding obstinate. | |
Explain + offer | When refusing, give one-line reason + one alternative path the user can take. | |
Extended thinking
| Item | Description | Example |
|---|---|---|
thinking: { type: 'enabled', budget_tokens: 8000 } | Enable extended thinking for hard reasoning. Higher budget = more internal CoT, more cost. | 8000-16000 tokens for code/math, 2000-4000 for planning. |
Do not add explicit 'think step by step' | Redundant — extended thinking does it natively and prompting it externally can degrade quality. | |
Tool routing
| Item | Description | Example |
|---|---|---|
Describe each tool in 1-2 sentences | Claude uses the description as documentation. Be specific about what NOT to use it for. | |
Keep tool count under ~30 | Above that, mis-routing rates climb. Split agents into sub-agents instead. | |
FAQ
Should I use Markdown or XML to structure prompts for Claude?
XML for structural delimitation (document boundaries, examples, scratchpad). Markdown for human-readable output. They compose well together.
Does Claude need 'think step by step' in 2026?
No. Modern Claude — and especially extended-thinking mode — handles reasoning natively. Explicit chain-of-thought instructions usually do nothing or slightly hurt.
Where do few-shot examples go in a Claude prompt?
Inside user-turn messages, wrapped in <example>...</example> tags. Putting examples in the system prompt works but is more expensive per turn.
Last updated: 2026-06-01.