Build This Now
Build This Now
What Is Claude Code?Claude Code InstallationClaude Code Native InstallerYour First Claude Code Project
Deep Thinking TechniquesSpeed OptimizationClaude Code Fast ModeEfficiency Patterns
Get Build This Now
speedy_devvkoen_salo
Blog/Handbook/Performance/Deep Thinking Techniques

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=0

Push 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:

  1. Thinking phrases. think harder, ultrathink, or think step by step close most of the smarts gap
  2. Planning mode. Adds structure to the extended reasoning
  3. Revision cycles. More critiques, tighter answers
  4. 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:

  1. Bring in sub-agents for different specialist angles
  2. Split the problem into smaller, sharper tasks
  3. Reach for Claude Opus on the truly complex work
  4. 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.

More in this guide

  • Agent Fundamentals
    Five ways to build specialized agents in Claude Code, from sub-agents to .claude/agents/ definitions to perspective prompts.
  • Agent Patterns
    Orchestrator, fan-out, validation chain, specialist routing, progressive refinement, and watchdog. Six ways to wire sub-agents in Claude Code.
  • Agent Teams Best Practices
    Battle-tested patterns for Claude Code agent teams. Troubleshooting, limitations, plan mode quirks, and fixes shipped from v2.1.33 through v2.1.45.
  • Agent Teams Controls
    Stop your agent team lead from grabbing implementation work. Configure delegate mode, plan approval, hooks, and CLAUDE.md for teams.
  • Agent Teams Prompt Templates
    Ten tested Agent Teams prompts for Claude Code. Code review, debugging, feature builds, architecture calls, and campaign research. Paste and go.

Stop configuring. Start building.

SaaS builder templates with AI orchestration.

Get Build This Now

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.

On this page

What is Deep Thinking?
The Performance Stack
Level 1: Enhanced Thinking
Level 2: Planning Mode + Deep Thinking
Level 3: The Revision Engine
Real-World Applications
Debugging Complex Issues
Architecture Decisions
Code Reviews
Persistent Thinking Configuration
Always-On Extended Thinking
Controlling the Thinking Budget
Prompt Caching and Extended Thinking
Cost vs Performance Trade-offs
Common Deep Thinking Patterns
The Systematic Approach
The Multi-Perspective Analysis
The Iterative Refinement
When Deep Thinking Falls Short
Success Indicators
Next Actions

Stop configuring. Start building.

SaaS builder templates with AI orchestration.

Get Build This Now