Skip to content

UltraThink and Deep Reasoning

Force Claude into extended thinking for architecture, debugging, or security analysis. When brute-force reasoning beats clever prompting.

Some problems don't respond to clever prompting. You rewrite your instructions ten different ways and still get a shallow answer. The issue isn't what you asked. The model just didn't spend enough time reasoning before it started talking.

Extended thinking fixes that. It gives Claude Code a scratchpad to work through complex problems before producing a visible response. Brute-force reasoning. Sometimes that's exactly what you need.

How Extended Thinking Works

When enabled (on by default), Claude Code reasons internally before generating its response. Like a developer sketching on a whiteboard before writing code. Exploring possibilities, evaluating tradeoffs, catching its own mistakes, building a plan. All before the first word of the response appears.

Switch to verbose mode with Ctrl+O and you can watch this in real time. Thinking tokens stream alongside the response. Genuinely useful for understanding why Claude Code made certain decisions, and sometimes entertaining.

The important bit: Opus 4.6 uses adaptive reasoning. It dynamically allocates thinking effort (low, medium, or high) based on problem complexity. Simple rename? Minimal thinking. Complex refactor? Deep analysis. Other models use a fixed budget up to 31,999 tokens regardless of what you ask.

The Ultrathink Keyword

Here's where it gets interesting. Include the word "ultrathink" anywhere in your prompt and it forces the effort level to high for that turn. Works on both Opus 4.6 and Sonnet 4.6. Not a flag. Not a setting. Just a word in your message.

claude "ultrathink: Review this authentication flow for security vulnerabilities. Check token handling, session management, and input validation across all routes."

That single word tells the model to allocate maximum reasoning tokens. Placement doesn't matter. Beginning, middle, end of your prompt.

Don't confuse this with phrases like "think hard" or "think step by step." Those are just prompt instructions. The model might or might not change its behavior. "ultrathink" is a recognized keyword that directly controls token allocation. One's a suggestion, the other's a mechanism.

Configuring Thinking Behavior

Several knobs here.

Effort level controls the baseline. Set it with /model during a session, or the CLAUDE_CODE_EFFORT_LEVEL environment variable before starting one. Toggle on the fly with Alt+T (Windows/Linux) or Option+T (macOS). Change the global default through /config.

Hard limits: set MAX_THINKING_TOKENS as an environment variable to cap reasoning tokens. Set it to zero to disable thinking entirely, which makes sense for simple tasks where you want speed and low cost.

Disable adaptive reasoning: CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING=1 reverts Opus 4.6 to a fixed budget. Useful if you want consistent thinking behavior regardless of task complexity.

When Deep Reasoning Actually Helps

Extended thinking isn't free. Every thinking token costs money, and high-effort responses can burn significantly more than low-effort ones. So where does it actually pay off?

Architecture decisions. You want Claude Code to design a caching layer with invalidation, replication, and fallback strategies. A shallow response sounds reasonable but falls apart under edge cases. Deep reasoning catches those during the thinking phase, before you've built anything.

Gnarly bugs. The stack trace points to line 47 but the real problem is three files away in a race condition. Extended thinking lets the model trace execution paths, hold multiple hypotheses, and eliminate them systematically. This is where it really shines.

Multi-step planning. Migrating REST to GraphQL across a large codebase? You want it thinking about dependency order, breaking changes, backwards compatibility, rollback strategies. Not a task for minimal reasoning.

Security analysis. Reviewing auth flows, input validation, access control. You want the model to be paranoid. Ultrathink gives it the budget to check every path, not just the obvious ones.

For renaming a variable or fixing a typo? Overkill. Adaptive reasoning handles that fine. If you're manually cranking effort to high for everything, you're wasting money.

Try It

Pick a file in your project that handles authentication, data validation, or any security-sensitive logic. Run a normal review first, then compare it with ultrathink:

claude "Review lib/auth.ts for security issues"

Then run the same review with ultrathink:

claude "ultrathink: Review lib/auth.ts for security issues. Check for token expiry handling, CSRF protection, injection vectors, and privilege escalation paths."

Compare the two responses. The ultrathink version should be noticeably more thorough, covering edge cases and attack vectors that the first response glossed over. If you've got verbose mode on (Ctrl+O), watch the thinking process to see how much more reasoning happens.

Ultrathink in Skills and CLAUDE.md

You can embed "ultrathink" in skill content so specific workflows always get deep reasoning. Security review skill? Put ultrathink in its instructions. Every invocation gets maximum thinking without anyone needing to remember.

Same goes for CLAUDE.md. If your team wants security reviews or architecture decisions to always get the full treatment, include ultrathink in those sections of your project instructions. Set it once, forget about it.

What Matters

  • Extended thinking is on by default, giving Claude Code a reasoning scratchpad before responding
  • Opus 4.6 adapts thinking effort to problem complexity; other models use a fixed budget
  • "ultrathink" is a keyword that forces maximum reasoning, not a suggestion
  • "Think hard" and "think step by step" are just prompt text with no guaranteed effect
  • Best for architecture, debugging, planning, and security; overkill for simple tasks

Mastering Claude Code

Lesson 53 of 70