File: extended-thinking-tips.md | Updated: 11/15/2025
Agent Skills are now available! Learn more about extending Claude's capabilities with Agent Skills .
English
Search...
Ctrl K
Search...
Navigation
Prompt engineering
Extended thinking tips
Home Developer Guide API Reference Model Context Protocol (MCP) Resources Release Notes
On this page
Use general instructions first, then troubleshoot with more step-by-step instructions
Using extended thinking to debug and steer Claude’s behavior
Have Claude reflect on and check its work for improved consistency and error handling
This guide provides advanced strategies and techniques for getting the most out of Claude’s extended thinking features. Extended thinking allows Claude to work through complex problems step-by-step, improving performance on difficult tasks. See Extended thinking models for guidance on deciding when to use extended thinking.
This guide presumes that you have already decided to use extended thinking mode and have reviewed our basic steps on how to get started with extended thinking as well as our extended thinking implementation guide .
Technical considerations for extended thinking
<thinking>). See chain of thought prompting
.Use general instructions first, then troubleshoot with more step-by-step instructions
Claude often performs better with high level instructions to just think deeply about a task rather than step-by-step prescriptive guidance. The model’s creativity in approaching problems may exceed a human’s ability to prescribe the optimal thinking process. For example, instead of:
User
Copy
Think through this math problem step by step:
1. First, identify the variables
2. Then, set up the equation
3. Next, solve for x
...
Consider:
User
Copy
Please think about this math problem thoroughly and in great detail.
Consider multiple approaches and show your complete reasoning.
Try different methods if your first approach doesn't work.
That said, Claude can still effectively follow complex structured execution steps when needed. The model can handle even longer lists with more complex instructions than previous versions. We recommend that you start with more generalized instructions, then read Claude’s thinking output and iterate to provide more specific instructions to steer its thinking from there.
Multishot prompting with extended thinking
Multishot prompting
works well with extended thinking. When you provide Claude examples of how to think through problems, it will follow similar reasoning patterns within its extended thinking blocks. You can include few-shot examples in your prompt in extended thinking scenarios by using XML tags like <thinking> or <scratchpad> to indicate canonical patterns of extended thinking in those examples. Claude will generalize the pattern to the formal extended thinking process. However, it’s possible you’ll get better results by giving Claude free rein to think in the way it deems best. Example:
User
Copy
I'm going to show you how to solve a math problem, then I want you to solve a similar one.
Problem 1: What is 15% of 80?
<thinking>
To find 15% of 80:
1. Convert 15% to a decimal: 15% = 0.15
2. Multiply: 0.15 × 80 = 12
</thinking>
The answer is 12.
Now solve this one:
Problem 2: What is 35% of 240?
Maximizing instruction following with extended thinking
Claude shows significantly improved instruction following when extended thinking is enabled. The model typically:
To maximize instruction following:
Using extended thinking to debug and steer Claude’s behavior
You can use Claude’s thinking output to debug Claude’s logic, although this method is not always perfectly reliable. To make the best use of this methodology, we recommend the following tips:
When extended thinking is turned off, standard assistant response text prefill
is still allowed.
Sometimes Claude may repeat its extended thinking in the assistant output text. If you want a clean response, instruct Claude not to repeat its extended thinking and to only output the answer.
Making the best of long outputs and longform thinking
For dataset generation use cases, try prompts such as “Please create an extremely detailed table of…” for generating comprehensive datasets. For use cases such as detailed content generation where you may want to generate longer extended thinking blocks and more detailed responses, try these tips:
We do not recommend that you push Claude to output more tokens for outputting tokens’ sake. Rather, we encourage you to start with a small thinking budget and increase as needed to find the optimal settings for your use case.
Here are example use cases where Claude excels due to longer extended thinking:
Complex STEM problems
Complex STEM problems require Claude to build mental models, apply specialized knowledge, and work through sequential logical steps—processes that benefit from longer reasoning time.
User
Copy
Write a python script for a bouncing yellow ball within a square,
make sure to handle collision detection properly.
Make the square slowly rotate.
This simpler task typically results in only about a few seconds of thinking time.
Constraint optimization problems
Constraint optimization challenges Claude to satisfy multiple competing requirements simultaneously, which is best accomplished when allowing for long extended thinking time so that the model can methodically address each constraint.
User
Copy
Plan a week-long vacation to Japan.
This open-ended request typically results in only about a few seconds of thinking time.
Thinking frameworks
Structured thinking frameworks give Claude an explicit methodology to follow, which may work best when Claude is given long extended thinking space to follow each step.
User
Copy
Develop a comprehensive strategy for Microsoft
entering the personalized medicine market by 2027.
This broad strategic question typically results in only about a few seconds of thinking time.
Have Claude reflect on and check its work for improved consistency and error handling
You can use simple natural language prompting to improve consistency and reduce errors:
Example:
User
Copy
Write a function to calculate the factorial of a number.
Before you finish, please verify your solution with test cases for:
- n=0
- n=1
- n=5
- n=10
And fix any issues you find.
Extended thinking cookbook
--------------------------
Explore practical examples of extended thinking in our cookbook.
Extended thinking guide
-----------------------
See complete technical documentation for implementing extended thinking.
Was this page helpful?
YesNo
Long context tips Define success criteria
Assistant
Responses are generated using AI and may contain mistakes.