<thinking> — when and how to use it in Claude prompts
Tell Claude to think inside
Scratchpad region where Claude is asked to reason step-by-step before producing the final answer.
When to use <thinking>
- Any non-trivial reasoning task — math, multi-step logic, planning, ambiguous classification.
- When you want to inspect the model's reasoning during debugging.
When not to use it
- Trivial classification or lookup tasks — adds latency for no gain.
- When using Claude's native extended-thinking feature via the API — that uses its own mechanism; you don't also need a
<thinking>tag in the prompt.
Minimal example
<instructions>
Think step by step inside <thinking> tags, then give your answer inside <answer> tags.
</instructions>
What is 17 * 23?
Full example
<instructions>
You will be given a logic puzzle. First, think through the constraints inside
<thinking> tags. List what you know, what you can deduce, and any dead ends.
Then give the final answer inside <answer> tags. The answer should be one sentence.
</instructions>
<puzzle>
Three friends — Alex, Blair, and Casey — each ordered a different drink:
coffee, tea, or juice. Alex didn't order coffee. Blair didn't order tea.
Casey ordered tea. What did each person order?
</puzzle>
Common mistakes
- Forgetting to also specify
<answer>— without it, the user-facing reply may contain the entire scratchpad. - Reading
<thinking>output as ground truth. It's a reasoning aid, not a verified log.
Cite this page
<thinking> — When and How to Use in Claude Prompts. claudexml.com. https://claudexml.com/tags/thinking/