MCPInstall

extended-thinking

Extended thinking (ultrathink) configuration for Claude API. Activate for complex reasoning tasks, deep analysis, multi-step problem solving, and tasks requiring careful deliberation. Enables Claude's internal reasoning with configurable thinking budgets.

Installs
69
Last 24h
—
Trending rank
—
Security
Not audited

Install

Works with every agent the skills CLI supports.

npx skills add https://github.com/thelobbi/claude --skill extended-thinking
  1. 01

    Install

    Run the command in your project. The CLI asks which agents to install for.

  2. 02

    Describe the task

    Ask your agent for something this skill covers. It loads extended-thinking automatically when relevant.

  3. 03

    Review the result

    The agent follows the SKILL.md steps, scripts and references bundled with the skill.

SKILL.md

The instructions your agent reads when the skill is triggered.

Extended Thinking (Ultrathink) Skill

Enable Claude's extended thinking capabilities for complex reasoning tasks that benefit from internal deliberation before responding.

When to Use

  • Complex problem solving requiring multi-step reasoning
  • Code architecture decisions with multiple trade-offs
  • Debugging complex issues needing systematic analysis
  • Strategic planning with many variables
  • Mathematical or logical proofs
  • Security analysis requiring threat modeling
  • Performance optimization with multiple factors

Supported Models

ModelThinking configuration
Claude Fable 5 (claude-fable-5)Always on — omit the thinking param (or {"type": "adaptive"}); {"type": "disabled"} returns 400
Claude Opus 4.8 / 4.7 (claude-opus-4-8){"type": "adaptive"} (off when omitted); budget_tokens removed — returns 400
Claude Sonnet 5 (claude-sonnet-5)Adaptive by default when thinking omitted; budget_tokens removed — returns 400
Claude Opus 4.6 / Sonnet 4.6{"type": "adaptive"} recommended; budget_tokens deprecated (transitional only)
Older models (Sonnet 4.5, Haiku 4.5, ...){"type": "enabled", "budget_tokens": N} — the manual budget mechanism below

API Configuration

Adaptive Thinking — current models (Python)

On current models (Opus 4.6+, Sonnet 5, Fable 5), adaptive thinking replaces manual budgets: Claude decides when and how much to think, and output_config.effort controls depth.

import anthropic

client = anthropic.Anthropic()

response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=16000,
    thinking={"type": "adaptive"},
    output_config={"effort": "high"},  # low | medium | high | xhigh | max
    messages=[{
        "role": "user",
        "content": "Analyze this complex architecture decision..."
    }]
)

# Access thinking and response
for block in response.content:
    if block.type == "thinking":
        print(f"Thinking: {block.thinking}")
    elif block.type == "text":
        print(f"Response: {block.text}")

TypeScript Configuration

import Anthropic from "@anthropic-ai/sdk";

const client = new Anthropic();

const response = await client.messages.create({
  model: "claude-sonnet-5",
  max_tokens: 16000,
  thinking: { type: "adaptive" },
  output_config: { effort: "high" },
  messages: [
    {
      role: "user",
      content: "Analyze this complex architecture decision...",
    },
  ],
});

Manual Budgets — older models only (budget_tokens)

On older models (Sonnet 4.5 / Haiku 4.5 era), extended thinking is enabled with a fixed token budget. budget_tokens must be >= 1,024 and < max_tokens. Do not use this shape on current models — budget_tokens is removed on Opus 4.7+, Sonnet 5, and Fable 5 and returns a 400 error (deprecated but still functional on Opus 4.6 / Sonnet 4.6).

response = client.messages.create(
    model="claude-sonnet-4-5",  # older model — manual budget still applies
    max_tokens=16000,
    thinking={
        "type": "enabled",
        "budget_tokens": 10000  # Minimum 1,024
    },
    messages=[{"role": "user", "content": "..."}]
)

Streaming (Required for large max_tokens)

with client.messages.stream(
    model="claude-sonnet-5",
    max_tokens=32000,
    thinking={"type": "adaptive"},
    output_config={"effort": "high"},
    messages=[{"role": "user", "content": prompt}]
) as stream:
    for event in stream:
        if event.type == "content_block_delta":
            if hasattr(event.delta, "thinking"):
                print(event.delta.thinking, end="", flush=True)
            elif hasattr(event.delta, "text"):
                print(event.delta.text, end="", flush=True)

Thinking Depth Recommendations

Current models — effort levels (output_config: {"effort": ...})

EffortUse Case
lowSimple clarifications, latency-sensitive tasks, subagents
mediumCode review, debugging, design decisions (good cost balance)
high (default)Architecture planning, security audits, intelligence-sensitive work
xhighThe hardest coding and agentic tasks (Opus 4.7+, Sonnet 5, Fable 5)
maxCorrectness matters more than cost; can be prone to overthinking

Older models — budget_tokens

Task ComplexityBudget TokensUse Case
Light1,024 - 4,000Simple clarifications, basic analysis
Medium4,000 - 10,000Code review, debugging, design decisions
Heavy10,000 - 20,000Architecture planning, security audits
Complex20,000 - 32,000Multi-system analysis, comprehensive reviews
Maximum32,000+Use batch API for budgets exceeding 32k

Tool Use with Extended Thinking

CRITICAL: When using tools with extended thinking, you MUST preserve thinking blocks in the conversation history.

# Initial request with thinking
response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=16000,
    thinking={"type": "adaptive"},
    tools=[{
        "name": "analyze_code",
        "description": "Analyze code for issues",
        "input_schema": {
            "type": "object",
            "properties": {"code": {"type": "string"}},
            "required": ["code"]
        }
    }],
    messages=[{"role": "user", "content": "Analyze this code..."}]
)

# MUST include ALL content blocks including thinking
tool_use_block = next(b for b in response.content if b.type == "tool_use")
tool_result = execute_tool(tool_use_block)

# Continue with thinking blocks preserved
follow_up = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=16000,
    thinking={"type": "adaptive"},
    tools=[...],
    messages=[
        {"role": "user", "content": "Analyze this code..."},
        {"role": "assistant", "content": response.content},  # Includes thinking!
        {"role": "user", "content": [{
            "type": "tool_result",
            "tool_use_id": tool_use_block.id,
            "content": tool_result
        }]}
    ]
)

Interleaved Thinking

On current models (Opus 4.6+, Sonnet 5, Fable 5), adaptive thinking automatically interleaves thinking between tool calls — no beta header needed:

response = client.messages.create(
    model="claude-sonnet-5",
    max_tokens=16000,
    thinking={"type": "adaptive"},
    messages=[...]
)

On older Claude 4 models using manual budget_tokens, interleaved thinking requires the interleaved-thinking-2025-05-14 beta header.

Constraints

  • Current models (Opus 4.7+, Sonnet 5, Fable 5): budget_tokens, temperature, top_p, and top_k are all removed — sending any of them returns 400
  • Older models: minimum budget_tokens is 1,024 and must be < max_tokens; temperature must be 1 (default); top_k cannot be used with extended thinking
  • Maximum output: 128k tokens (thinking + response); Haiku 4.5 caps at 64k
  • Streaming required: For large max_tokens (above ~16k, to avoid SDK HTTP timeouts)
  • System prompts: Fully compatible

Best Practices

  1. Start conservative: Begin with lower budgets, increase as needed
  2. Monitor actual usage: Track thinking_tokens in response usage
  3. Use streaming: For better UX and larger outputs
  4. Preserve thinking blocks: Critical for multi-turn tool use
  5. Batch for heavy workloads: Use batch API for budgets > 32k tokens
  6. Match budget to task: Don't over-allocate for simple tasks

Integration with Claude Code

When using Claude Code CLI with extended thinking models:

# The CLI automatically handles extended thinking for supported models
# Use opus or sonnet models for complex tasks

claude --model claude-opus-4-8 "Analyze this codebase architecture"

See Also

  • [[complex-reasoning]] - Multi-step reasoning patterns
  • [[deep-analysis]] - Analytical thinking templates
  • [[llm-integration]] - General LLM API patterns

FAQ

What does the extended-thinking skill do?

Extended thinking (ultrathink) configuration for Claude API. Activate for complex reasoning tasks, deep analysis, multi-step problem solving, and tasks requiring careful deliberation. Enables Claude's internal reasoning with configurable thinking budgets.

How do I install extended-thinking?

Run npx skills add https://github.com/thelobbi/claude --skill extended-thinking in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/extended-thinking/ (personal) or .claude/skills/extended-thinking/ (project).

Which AI agents can use extended-thinking?

Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.

Is extended-thinking safe to install?

No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.

Who maintains extended-thinking?

It is published by thelobbi in thelobbi/claude. It has 69 recorded installs.

More from thelobbi/claude

View all →

vision-multimodal

thelobbi/claude

Vision and multimodal capabilities for Claude including image analysis, PDF processing, and document understanding. Activate for image input, base64 encoding, multiple images, and visual analysis.

Media & Creative551 installs

complex-reasoning

thelobbi/claude

Multi-step reasoning patterns and frameworks for systematic problem solving. Activate for Chain-of-Thought, Tree-of-Thought, hypothesis-driven debugging, and structured analytical approaches that leverage extended thinking.

design-system

thelobbi/claude

Open the skill to read its SKILL.md instructions.

Frontend & Design135 installs

keycloak

thelobbi/claude

Keycloak identity and access management including realms, clients, authentication flows, themes, and user federation. Activate for OAuth2, OIDC, SAML, SSO, identity providers, and authentication configuration.

84 installs

kanban

thelobbi/claude

Kanban methodology including boards, WIP limits, flow metrics, and continuous delivery. Activate for Kanban boards, workflow visualization, and lean project management.

gcp

thelobbi/claude

Open the skill to read its SKILL.md instructions.

DevOps & Cloud81 installs

Popular backend & apis skills

View category →

find-skills

vercel-labs/skills

Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.

OfficialBackend & APIs4.1M installs

entra-app-registration

microsoft/azure-skills

Guides Microsoft Entra ID app registration, OAuth 2.0 authentication, and MSAL integration. USE FOR: create app registration, register Azure AD app, configure OAuth, set up authentication, add API permissions, generate service principal, MSAL example, console app auth, Entra ID setup, Azure AD authentication. DO NOT USE FOR: Key Vault secrets (use azure-keyvault-expiration-audit), general Azure resource security guidance.

OfficialBackend & APIs566.7K installs

This skill should be used when the user wants to "write agent code", "build an agent with ADK", "add a tool", "create a callback", "define an agent", "use state management" — in a project that needs ADK (Agent Development Kit) API patterns and code examples. It provides a quick reference for agent types, tool definitions, orchestration patterns, callbacks, state management, the graph Workflow API, and reference recipes to study. Do NOT use for scaffolding (use google-agents-cli-scaffold) or deployment (use google-agents-cli-deploy).

Backend & APIs514.8K installs

embedded-captions

heygen-com/hyperframes

Add captions or subtitles to an existing single-subject talking-head video without editing the footage. Use for plain verbatim captions, cinematic captions embedded behind the subject, VFX captions, “炸/特效/酷炫字幕,” or a named identity from the 35-style catalog. Route by visual identity, not by backend engine. The quiet anchor rail is the default; embed every word only when the user explicitly wants a fully cinematic treatment. The workflow runs locally end to end, including transcription and subject matting; split multi-shot footage before applying it.

Backend & APIs453.3K installs

entra-agent-id

microsoft/azure-skills

Provision Microsoft Entra Agent Identity Blueprints, BlueprintPrincipals, and per-instance Agent Identities via Microsoft Graph, and configure OAuth 2.0 token exchange (fmipath, OBO, cross-tenant) including the Microsoft Entra SDK for AgentID sidecar. USE FOR: Agent Identity Blueprint, BlueprintPrincipal, agent OAuth, fmipath token exchange, agent OBO, Workload Identity Federation for agents, polyglot agent auth, Microsoft.Identity.Web.AgentIdentities. DO NOT USE FOR: standard Entra app registration (use entra-app-registration), Microsoft Foundry agent authoring (use microsoft-foundry).

OfficialBackend & APIs336.6K installs

neon

neondatabase/agent-skills

Overview of Neon, a complete set of cloud backend primitives around Lakebase Postgres: Auth, Object Storage, Functions, the AI Gateway, and Realtime. Start here to choose Neon for undecided login, files, APIs, and LLM calls, set up the CLI or MCP server, and follow the branch-first workflow. Use when building an app or backend on Neon, or when "Neon" or "Lakebase Postgres" is mentioned. Child skill neon-postgres wins for an existing DATABASEURL, SQL, schema, inspect, or search. Child skill neon-auth wins for login, users, sessions, identity routing, and Managed Better Auth setup. Child skill neon-realtime wins for live queries in reactive apps and agents. Also use for object storage, S3, buckets, serverless functions, function triggers, cron, AI gateway, LLM calls, realtime, logs, Loki, Grafana, observability, postgres, database, backend, Claimable Neon, neon.new, or a no-signup database.

Backend & APIs237.1K installs