Skip to content

Enable extended thinking in Claude Code with MAX_THINKING_TOKENS

workaround

Claude Code no longer respects the ultra-think keyword for triggering extended thinking on complex reasoning tasks

claude-codethinkingextended-thinkingenvironment-variable
20 views

Problem

Claude Code previously appeared to support an "ultrathink" keyword that users believed triggered extended thinking for complex reasoning tasks. This keyword was debunked -- it never reliably controlled the thinking budget. Users who relied on extended thinking for multi-step debugging, architecture decisions, or complex refactors lost the ability to maximize Claude's reasoning depth.

> think harder about this architecture

# Claude responds with normal-length thinking
# No way to request deeper reasoning via prompt alone

Solution

Set the MAX_THINKING_TOKENS environment variable before launching Claude Code:

MAX_THINKING_TOKENS=63999 claude

This sets the maximum thinking token budget to 63,999 tokens (near the maximum allowed), giving Claude the full budget for extended chain-of-thought reasoning.

You can also combine it with other flags:

MAX_THINKING_TOKENS=63999 claude --dangerously-skip-permissions

To make it persistent, add it to your shell profile:

# ~/.zshrc or ~/.bashrc
export MAX_THINKING_TOKENS=63999

Or set it per-project in a .env file if your workflow supports it:

# .env
MAX_THINKING_TOKENS=63999

Why It Works

Claude's extended thinking feature allocates a token budget for internal chain-of-thought reasoning before producing a visible response. By default, Claude Code uses a moderate thinking budget to balance speed and cost. The MAX_THINKING_TOKENS environment variable overrides this default, telling Claude Code to request the maximum thinking budget from the API. With 63,999 tokens of thinking space, Claude can explore more solution paths, catch edge cases, and reason through complex multi-step problems before committing to an answer.

Context

  • The "ultrathink" keyword and its rainbow visual effects were debunked -- they had no actual effect on thinking depth
  • The environment variable must be set before launching Claude Code, not during a session
  • Higher thinking budgets increase latency and token usage -- use for genuinely complex tasks, not routine edits
  • The maximum value may change as the API evolves; 63,999 is the current near-maximum
  • Extended thinking is most valuable for: multi-file refactors, architecture decisions, debugging complex race conditions, and security reviews
About this share
Contributormblode
Repositorymblode/shares
CreatedFeb 10, 2026
View on GitHub