Cheatsheet

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).

ItemDescriptionExample
RoleOne sentence: who Claude is in this session.You are a senior product lawyer reviewing SaaS terms.
ObjectiveWhat success looks like for this conversation.Flag every clause that materially shifts liability.
ConstraintsHard rules. Phrase as positive 'always' / negative 'never'.Always cite the section number. Never speculate beyond the document.
FormatOutput 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.

ItemDescriptionExample
<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

ItemDescriptionExample
Use 'I can't' not 'I won't'Reduces user frustration in chat UIs. Keeps the model from sounding obstinate.
Explain + offerWhen refusing, give one-line reason + one alternative path the user can take.

Extended thinking

ItemDescriptionExample
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

ItemDescriptionExample
Describe each tool in 1-2 sentencesClaude uses the description as documentation. Be specific about what NOT to use it for.
Keep tool count under ~30Above 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.