Deep Thinking Techniques
Thinking trigger phrases like `think harder` and `ultrathink` push Claude Code into extended reasoning without switching models.
Problem: Hard work, shallow answers. You needed root cause. You got a surface patch.
Quick Win: Put a thinking trigger phrase on your next Claude Code prompt:
claude "think harder about this: Analyze this codebase and suggest architectural improvements"think harder, ultrathink, and think step by step tell Claude to burn more test-time compute before answering.
What is Deep Thinking?
Deep thinking is what a trigger phrase activates. Drop think harder, ultrathink, or think step by step into the prompt, and Claude spends more test-time compute on the problem before the reply lands.
These aren't CLI commands. They're plain English cues that flip extended thinking on. Regular prompts come back fast. Trigger-phrase prompts come back thoughtful.
The Performance Stack
Level 1: Enhanced Thinking
Start with a thinking trigger phrase for any complex task:
claude "think step by step: Optimize this React component for performance"Extended thinking fires without changing models. The three phrases are interchangeable.
Level 2: Planning Mode + Deep Thinking
Combine a thinking phrase with planning for structured analysis:
claude "think harder + plan mode: Create a migration strategy from JavaScript to TypeScript"You get extended reasoning AND a structured plan.
Level 3: The Revision Engine
Use multiple critique rounds to push performance further:
claude "ultrathink + plan mode: Create deployment strategy. Then critique your plan for edge cases and improvements."Each round sharpens the answer. Trigger phrase plus self-critique squeezes the most out of test-time compute.
Real-World Applications
Debugging Complex Issues
Weak: "Why isn't this working?"
Strong: "think harder: Analyze this error stack trace and provide root cause analysis with multiple potential solutions."
Architecture Decisions
Weak: "What's the best database for this?"
Strong: "think step by step + plan mode: Evaluate database options for a real-time chat application with 100K users."
Code Reviews
Weak: "Review this code"
Strong: "ultrathink: Perform comprehensive code review focusing on performance, security, and maintainability."
Persistent Thinking Configuration
If deep thinking runs through most of your day, turn it on by default rather than prefixing each prompt.
Always-On Extended Thinking
Add alwaysThinkingEnabled to your settings.json to activate extended thinking for every response:
// ~/.claude/settings.json
{
"alwaysThinkingEnabled": true
}Extended thinking then runs on every prompt, no think harder needed. A good fit when most sessions demand that depth by default.
Controlling the Thinking Budget
The MAX_THINKING_TOKENS environment variable controls how many tokens Claude can spend on its internal reasoning process:
# Set a custom thinking budget (default is 31,999)
export MAX_THINKING_TOKENS=31999
# Disable extended thinking entirely
export MAX_THINKING_TOKENS=0Push the number up and Claude gets more room to reason, but latency and tokens climb with it. Push it down and reasoning stays tight. 0 turns extended thinking off, handy when speed beats depth.
Prompt Caching and Extended Thinking
Extended thinking collides with prompt caching. Thinking tokens travel with the response and don't get cached for later turns. For repetitive work, say the same refactor across many files, throughput is often better with extended thinking off and a sharp prompt doing the work.
Cost vs Performance Trade-offs
Before reaching for a pricier model like Claude Opus, squeeze more out of the one you're already on:
- Thinking phrases.
think harder,ultrathink, orthink step by stepclose most of the smarts gap - Planning mode. Adds structure to the extended reasoning
- Revision cycles. More critiques, tighter answers
- Sub-agents. Fresh angles on the same hard problem
This combo delivers about 80% of Opus quality at 20% of the cost. Test-time compute pays off more per dollar than switching models.
Common Deep Thinking Patterns
The Systematic Approach
claude "think step by step + plan mode:
1. Analyze the current system
2. Identify bottlenecks
3. Propose solutions
4. Create implementation plan
5. Critique the plan for missing elements"The Multi-Perspective Analysis
claude "think harder: Analyze this API design from the perspectives of:
- Performance engineer
- Security auditor
- Frontend developer
- DevOps engineer"The Iterative Refinement
claude "ultrathink + plan mode: Design a caching strategy.
Then critique it for edge cases and suggest improvements."When Deep Thinking Falls Short
When trigger phrases, planning, and revision rounds still fall short:
- Bring in sub-agents for different specialist angles
- Split the problem into smaller, sharper tasks
- Reach for Claude Opus on the truly complex work
- Pull in MCP extensions tuned for the domain
Success Indicators
The trigger phrases are landing when Claude:
- Hands you more than one solution
- Catches edge cases you hadn't spotted
- Walks through the trade-offs it weighed
- Sketches how to ship each option
- Flags improvements worth making
Next Actions
Immediate: Put think harder: on your next hard prompt and compare the reply.
Advanced: Learn planning mode strategies that shape extended thinking.
Optimization: Look at model selection to balance cost against depth.
Scaling: Stand up custom agents for specialized thinking tasks.
Troubleshooting: Read the performance optimization guide if deep thinking feels slow.
Without trigger phrases, Claude hands you the first answer that works. With them, it hands you the best one it can build. The phrases cost nothing to add.
Stop configuring. Start building.
Claude Code Pricing and Token Usage
Cut Claude Code costs by 40-70% with the right model per task, ccusage tracking, and a few environment variables most people never set.
Speed Optimization
Model selection, context size, and prompt specificity are the three levers that decide how fast Claude Code answers.