Effective Prompts for Extended Thinking
Keep prompts simple, avoid step-by-step instructions, trust the model to reason.
Effective Prompts for Extended Thinking is a free AI Prompt Engineering lesson on CoddyKit — lesson 2 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the AI Prompt Engineering learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
Prompting Reasoning Models Is Different
The prompting intuitions you built for standard models — chain-of-thought, step-by-step instructions, few-shot examples — often work against you with reasoning models.
Reasoning models are already doing sophisticated internal reasoning. Telling them exactly how to think can interfere with that process. The best prompts for reasoning models are simpler and more direct than prompts for standard models.
Don't Instruct Step-by-Step
With standard models, you write: "Think step by step. First consider X, then consider Y, finally conclude Z." This scaffolding helps because standard models don't do this automatically.
With reasoning models, this scaffolding can constrain the model's internal reasoning into a suboptimal path. Instead, state the problem clearly and let the model determine how to reason about it.
# Standard model: needs scaffolding
STANDARD_PROMPT = (
'Let us think step by step.\n'
'First, identify the variables.\n'
'Then, set up the equation.\n'
'Then, solve for x.\n'
'Finally, verify your answer.\n\n'
'Problem: If 3x + 7 = 22, what is x?'
)
# Reasoning model: just state the problem clearly
REASONING_PROMPT = (
'Solve: If 3x + 7 = 22, what is x?'
# The model handles the step-by-step internally
)
# Both produce correct answers; the reasoning model prompt is simpler
print('Reasoning model prefers the cleaner prompt')State the Problem Clearly and Completely
While you should simplify how you instruct reasoning, you should be thorough about what you're asking. Provide all context, constraints, and requirements upfront — the model will use them during its internal reasoning.
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-...')
# Poor: vague problem statement
BAD_PROMPT = 'Write me a good sorting algorithm.'
# Good: clear, complete problem specification
GOOD_PROMPT = (
'Write a Python sorting algorithm with these requirements:\n'
'- Must sort a list of integers in ascending order\n'
'- Must work correctly on empty lists, single-element lists, and lists with duplicates\n'
'- Target time complexity: O(n log n) average case\n'
'- Must not use Python built-in sort() or sorted()\n'
'- Include a brief docstring and 3 test cases\n\n'
'Return only the code, no explanation.'
)
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=8000,
thinking={'type': 'enabled', 'budget_tokens': 5000},
messages=[{'role': 'user', 'content': GOOD_PROMPT}]
)
print(next(b.text for b in response.content if b.type == 'text')[:300])Setting budget_tokens Appropriately
budget_tokens controls the maximum thinking tokens. Setting it correctly is the main tuning knob for reasoning models:
- 1,000-2,000: Simple problems, quick calculations
- 5,000-10,000: Medium complexity coding, analysis
- 16,000+: Hardest math, complex system design, research-level problems
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-...')
def reasoning_call(prompt, budget_tokens=5000):
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=budget_tokens + 2048, # max_tokens must exceed budget_tokens
thinking={
'type': 'enabled',
'budget_tokens': budget_tokens
},
messages=[{'role': 'user', 'content': prompt}]
)
answer = next((b.text for b in response.content if b.type == 'text'), '')
thinking_blocks = [b for b in response.content if b.type == 'thinking']
print(f'Thinking blocks: {len(thinking_blocks)}')
return answer
# Simple problem: small budget
reasoning_call('What is 17 * 23?', budget_tokens=1000)
# Complex problem: larger budget
reasoning_call(
'Design a distributed rate limiter that handles 100k requests/second.',
budget_tokens=10000
)Minimal System Prompts
For reasoning models, keep system prompts minimal. The model's internal reasoning is its main capability — don't over-constrain it with lengthy behavioral instructions.
Good system prompts for reasoning models: set the role, define output format, specify constraints. That's all.
# Over-engineered system prompt (hurts reasoning models)
BAD_SYSTEM = (
'You are an expert Python developer. '
'Always think step by step. '
'First understand the problem. '
'Then plan your approach. '
'Then implement step by step. '
'Check each step before proceeding. '
'Finally review your solution. '
'Format all code with comments. '
'Add error handling to every function. '
'...'
)
# Minimal system prompt (helps reasoning models)
GOOD_SYSTEM = (
'You are an expert Python developer. '
'Return only code unless explanation is explicitly requested. '
'Use type hints and docstrings.'
)
# The model's internal reasoning handles the restOutput Format Instructions Still Matter
While you shouldn't instruct how to reason, you should clearly specify the desired output format. This is distinct from reasoning instructions — it tells the model what to return, not how to think.
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-...')
# Clear output format instructions are still important
prompt = (
'Analyze the time and space complexity of this Python function:\n\n'
'def bubble_sort(arr):\n'
' n = len(arr)\n'
' for i in range(n):\n'
' for j in range(0, n-i-1):\n'
' if arr[j] > arr[j+1]:\n'
' arr[j], arr[j+1] = arr[j+1], arr[j]\n\n'
'Return your answer as JSON with keys: '
'time_complexity, space_complexity, explanation (2 sentences max).'
)
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=5000,
thinking={'type': 'enabled', 'budget_tokens': 3000},
messages=[{'role': 'user', 'content': prompt}]
)
print(next(b.text for b in response.content if b.type == 'text'))Fewer Few-Shot Examples
Standard models benefit greatly from 3-5 few-shot examples. Reasoning models benefit less, and too many examples can actually hurt by filling the context window with content that interferes with internal reasoning.
For reasoning models: 0-1 examples is often optimal. Use examples only when the output format is unusual or ambiguous.
# Standard model: 3 few-shot examples improve performance significantly
STANDARD_FEW_SHOT = (
'Q: 2 + 2 = ?\nA: 4\n\n'
'Q: 5 * 6 = ?\nA: 30\n\n'
'Q: 100 / 4 = ?\nA: 25\n\n'
'Q: 17 + 38 = ?\nA:'
)
# Reasoning model: 0 examples is fine; 1 is enough if format is unclear
REASONING_DIRECT = 'What is 17 + 38?'
# The reasoning model already knows math — examples are overhead, not signal
# Only use 1 example when the output format needs clarification:
REASONING_FORMAT_EXAMPLE = (
'Answer math questions returning only the number.\n'
'Example: Q: 2 + 2 A: 4\n\n'
'Q: 17 + 38'
)Handling Uncertainty in Reasoning Model Outputs
Reasoning models are more likely to express genuine uncertainty than standard models (because they actually thought about it). Build your applications to handle hedged responses gracefully.
import anthropic
import re
client = anthropic.Anthropic(api_key='sk-ant-...')
def reasoning_with_confidence(question):
prompt = (
f'{question}\n\n'
f'At the end of your answer, include a confidence statement: '
f'Confidence: [HIGH/MEDIUM/LOW] — [one sentence why]'
)
response = client.messages.create(
model='claude-opus-4-5',
max_tokens=8000,
thinking={'type': 'enabled', 'budget_tokens': 5000},
messages=[{'role': 'user', 'content': prompt}]
)
text = next(b.text for b in response.content if b.type == 'text')
# Parse confidence
match = re.search(r'Confidence: (HIGH|MEDIUM|LOW)', text)
confidence = match.group(1) if match else 'UNKNOWN'
print(f'Confidence: {confidence}')
return text, confidence
answer, conf = reasoning_with_confidence(
'What will AI capabilities look like in 2030?'
)Caching Reasoning Model Outputs
Reasoning model calls are expensive and slow. Cache results for queries that are repeated or predictable. Since thinking tokens can be very long, caching avoids re-paying the latency and cost on repeat calls.
import hashlib
import json
import os
cache_dir = '/tmp/reasoning_cache'
os.makedirs(cache_dir, exist_ok=True)
def cached_reasoning_call(prompt, budget_tokens=5000):
# Create cache key from prompt
key = hashlib.sha256(f'{prompt}:{budget_tokens}'.encode()).hexdigest()
cache_file = os.path.join(cache_dir, f'{key}.json')
if os.path.exists(cache_file):
with open(cache_file) as f:
cached = json.load(f)
print('Cache hit!')
return cached['answer']
# Cache miss: call the model
answer = reasoning_call(prompt, budget_tokens)
with open(cache_file, 'w') as f:
json.dump({'prompt': prompt, 'answer': answer}, f)
return answerVerifying Reasoning Model Outputs
Reasoning models make fewer errors, but they're not infallible — especially on domain-specific facts or cutting-edge topics. Always verify outputs that will be acted upon in high-stakes contexts.
import anthropic
client = anthropic.Anthropic(api_key='sk-ant-...')
def reasoning_with_verification(question):
# Step 1: Get reasoning model answer
r1 = client.messages.create(
model='claude-opus-4-5',
max_tokens=10000,
thinking={'type': 'enabled', 'budget_tokens': 8000},
messages=[{'role': 'user', 'content': question}]
)
answer = next(b.text for b in r1.content if b.type == 'text')
# Step 2: Independent verification call
verify_prompt = (
f'Question: {question}\n\n'
f'Proposed answer: {answer}\n\n'
f'Is this answer correct? Respond with CORRECT, INCORRECT, or UNCERTAIN, '
f'followed by a brief explanation.'
)
r2 = client.messages.create(
model='claude-opus-4-5',
max_tokens=256,
messages=[{'role': 'user', 'content': verify_prompt}]
)
verification = r2.content[0].text
print(f'Verification: {verification[:100]}')
return answer, verificationPractical Checklist for Reasoning Model Prompts
When writing prompts for reasoning models, follow this checklist:
- State the problem clearly and completely
- Do NOT include step-by-step reasoning instructions
- Keep the system prompt short (role + format + constraints only)
- Use 0-1 few-shot examples maximum
- Specify the output format explicitly
- Set
budget_tokensproportional to problem complexity - Plan for 10-60 second response latency
Knowledge Check: Reasoning Model Prompting
Why is it recommended to use simpler prompts with reasoning models compared to standard models?
Recap: Effective Prompts for Extended Thinking
Reasoning models need simpler, more direct prompts than standard models. Don't instruct how to reason — state the problem clearly and completely, then let the model's internal deliberation handle the strategy. Keep system prompts minimal: role, output format, and constraints only. Use 0-1 few-shot examples. Set budget_tokens to match problem complexity (1K for simple, 10K+ for hard). Plan for significant latency and cache results when possible. Specify output format explicitly — that's the one area where detailed instructions still help.
Frequently asked questions
Is the “Effective Prompts for Extended Thinking” lesson free?
Yes — the full text of “Effective Prompts for Extended Thinking” is free to read here on the web, and the AI Prompt Engineering course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the AI Prompt Engineering course, upgrade to CoddyKit PRO.
What will I learn in “Effective Prompts for Extended Thinking”?
Keep prompts simple, avoid step-by-step instructions, trust the model to reason. You practise AI Prompt Engineering with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start AI Prompt Engineering?
No prior experience is required. AI Prompt Engineering on CoddyKit is structured for beginners through advanced learners; this is — lesson 2 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Effective Prompts for Extended Thinking” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this AI Prompt Engineering lesson?
Yes. Every AI Prompt Engineering lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- How Reasoning Models Differ
- Effective Prompts for Extended Thinking
- When to Use Reasoning vs Standard Models
- Cost and Latency Tradeoffs