Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Heuristic:Anthropics Anthropic sdk python Adaptive Thinking Over Enabled

From Leeroopedia
Knowledge Sources
Domains Optimization, LLMs
Last Updated 2026-02-15 12:00 GMT

Overview

For Claude Opus 4.6 models, use thinking.type=adaptive instead of thinking.type=enabled for better model performance.

Description

The SDK explicitly warns when thinking.type=enabled is used with Claude Opus 4.6 (claude-opus-4-6). Anthropic's internal testing shows that adaptive thinking, which allows the model to decide when and how much to think, produces better results than always-on thinking for this model. The SDK issues a UserWarning at runtime to guide developers toward the optimal configuration.

Usage

Apply this heuristic whenever configuring extended thinking for Claude Opus 4.6 or newer models. Replace {"type": "enabled", "budget_tokens": N} with {"type": "adaptive"} in the thinking configuration parameter.

The Insight (Rule of Thumb)

  • Action: Set thinking={"type": "adaptive"} instead of thinking={"type": "enabled", "budget_tokens": N} when using Claude Opus 4.6.
  • Value: Better model performance with adaptive thinking (per Anthropic's testing).
  • Trade-off: With adaptive thinking, you cannot control the exact thinking budget. The model decides how much reasoning to perform per request. If you need deterministic thinking behavior, enabled still works but may produce suboptimal results.

Reasoning

Adaptive thinking allows the model to allocate reasoning effort proportional to the complexity of the task. Simple queries skip extended thinking entirely, while complex problems receive deeper reasoning. This dynamic allocation produces better overall results than a fixed thinking budget, which may under-allocate for hard problems and waste tokens on easy ones.

Code Evidence

Warning trigger from messages.py:74:

MODELS_TO_WARN_WITH_THINKING_ENABLED = ["claude-opus-4-6"]

Warning logic from messages.py:965-970:

if model in MODELS_TO_WARN_WITH_THINKING_ENABLED and thinking and thinking["type"] == "enabled":
    warnings.warn(
        f"Using Claude with {model} and 'thinking.type=enabled' is deprecated. "
        f"Use 'thinking.type=adaptive' instead which results in better model "
        f"performance in our testing: "
        f"https://platform.claude.com/docs/en/build-with-claude/adaptive-thinking",
        UserWarning,
        stacklevel=3,
    )

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment