Unlock Claude Code’s most powerful capability: extended thinking for deep reasoning. This guide teaches you when and how to use thinking modes to solve complex architectural problems, debug intricate issues, and make better technical decisions.
What is Extended Thinking?
Extended thinking gives Claude additional computational time to thoroughly analyze problems before responding. Think of it as the difference between a quick answer and a carefully considered solution.
When activated, Claude will:
Explore multiple approaches and trade-offs
Consider edge cases and potential issues
Evaluate architectural implications
Generate more robust solutions
Claude Code offers four levels of thinking depth, each allocating progressively more computational budget:
Thinking Levels
Command Token Budget Best For Time think
~5,000 Quick planning, simple refactoring 5-10s think hard
~10,000 Feature design, debugging 10-20s think harder
~50,000 Architecture decisions, complex bugs 30-60s ultrathink
~128,000-500,000 System design, major refactoring 1-3min
Use for everyday development tasks that benefit from a bit more consideration:
> I need to add error handling to our payment processor. Think about the best approach.
Perfect for:
Planning small features
Refactoring single modules
Debugging straightforward issues
API endpoint design
Database query optimization
For tasks requiring careful analysis of interactions and dependencies:
> We need to implement rate limiting across our microservices. Think hard about potential edge cases and the best implementation strategy.
Ideal for:
Cross-service feature implementation
Performance optimization strategies
Security vulnerability analysis
Complex bug investigation
Integration planning
When facing architectural decisions with significant implications:
> Our monolith is hitting scaling limits. Think harder about how we should approach breaking it into microservices while maintaining backward compatibility.
Best suited for:
Microservices decomposition
Database architecture redesign
Major refactoring planning
Complex state management solutions
Multi-tenant architecture design
Reserve for your most complex challenges requiring exhaustive analysis:
> We need to migrate from REST to GraphQL while supporting both APIs during transition. Ultrathink about the migration strategy, potential issues, and implementation phases.
Essential for:
Complete system redesigns
Technology stack migrations
Distributed system architecture
Complex data pipeline design
Enterprise integration patterns
Provide Clear Context
> We have a Node.js API with 50k daily users experiencing intermittent
> timeouts. Database queries are optimized. Think hard about what could
> be causing this and how to diagnose it.
Specify Constraints
> Design a caching strategy for our e-commerce platform. We have 1TB
> of product data, need under 100ms response times, and limited to $500 /month
> infrastructure budget. Think harder about the optimal approach.
Request Trade-off Analysis
> Compare using Kubernetes vs. Docker Swarm for our deployment needs.
> We have 15 microservices, a small ops team, and need high availability.
> Think hard about the trade-offs.
Iterate on Thinking
> think harder about the security implications of that approach
> think more about how this affects our CI/CD pipeline
> ultrathink about long-term maintainability
> Our Node.js service memory usage grows continuously over 24 hours
> until it crashes. Standard profiling shows no obvious leaks. Think
> harder about potential causes and diagnostic approaches.
Claude will analyze:
Event listener accumulation
Closure reference patterns
Third-party library issues
Global variable pollution
Stream handling problems
> We need to version our REST API from v1 to v2 with breaking changes.
> 5000+ clients use v1. Ultrathink about the migration strategy to
> minimize disruption while maintaining both versions for 6 months.
Claude considers:
Versioning approaches (URL, header, content-type)
Database schema evolution
Code organization patterns
Client migration tooling
Monitoring and deprecation
> Our React app ' s initial load takes 8 seconds. Bundle is 5MB after
> optimization. Think hard about architectural changes to achieve
Claude explores:
Code splitting strategies
SSR/SSG implementation
Progressive enhancement
Service worker caching
CDN architecture
For maximum effectiveness on complex problems:
> Use subagents to analyze our codebase structure, then ultrathink
> about how to implement a plugin architecture that maintains
> backward compatibility.
Start light and escalate based on initial results:
> How should we handle user sessions in our distributed system ?
> # After initial response:
> think harder about the edge cases you mentioned
> ultrathink about a complete implementation plan
Direct thinking toward specific aspects:
> think hard about database consistency in that approach
> think more about failure recovery scenarios
> think harder about the cost implications at scale
Token Usage by Thinking Level
Extended thinking uses additional tokens that count toward your usage:
Basic thinking : ~$0.15-0.30 per use
Deep thinking : ~$0.30-0.60 per use
Intensive thinking : ~$1.50-3.00 per use
Maximum thinking : ~$3.00-10.00 per use
Costs based on Claude Opus 4 pricing as of 2025
Don’t use ultrathink
for simple tasks - it wastes tokens and time. Conversely, don’t under-think critical decisions.
The quality of thinking depends on context. Include:
Current architecture
Constraints and requirements
Performance targets
Team capabilities
Budget limitations
Instead of running ultrathink
twice, start with think hard
and refine specific aspects.
Save particularly insightful thinking outputs to your CLAUDE.md or documentation:
> Add the architectural decisions from your thinking to architecture.md
Extended thinking provides the most value during planning, not implementation.
Thinking Command Cheatsheet
think about implementing user authentication
think hard about database sharding strategy
# Complex problem solving
think harder about migrating to event sourcing
ultrathink about redesigning for 100x scale
# Refine previous thinking
think more about the security aspects
think harder about edge cases
Now that you understand deep reasoning, learn how to:
MCP Setup Connect powerful tools for enhanced development
Remember: Extended thinking is like having a senior architect review your plans. Use it wisely, and it will help you build better systems with fewer mistakes.