All insights

Coding agents

Claude Code Thinking: How to Set Effort and Configure the API

Learn how Claude Code effort controls work, when to consider more reasoning for coding, and how production API settings differ.

Illustration for Claude code thinking

Claude Code thinking: the short answer

In Claude Code, “thinking” is best understood as how much reasoning effort Claude applies—not as a separate coding mode with a universal token budget. Use /effort to adjust a session’s effort. For a one-off difficult request, Anthropic documents ultrathink as a prompt keyword that requests deeper reasoning on that turn without changing the session’s effort setting.

Production API requests use the selected model’s supported request configuration. For models that support it, the Messages API uses output_config.effort. A Claude Code control or prompt phrase is not itself an API request setting, so check the model documentation before choosing an API configuration.

How to adjust thinking effort in Claude Code

In an interactive Claude Code session, run /effort and choose an effort level using the displayed control. Available levels depend on the model. To request more reasoning for just one prompt, include ultrathink; Anthropic describes this as a one-turn request that does not change the session’s effort setting.

For a routine task, such as renaming a function and running relevant tests, the default effort may be enough. For a harder task—such as tracing a race condition across files—you could consider raising effort for the session or using ultrathink for that request. Review proposed changes and run tests either way: effort is a control, not a guarantee of correct code.

A third-party article claims that Tab toggles thinking and that think, megathink, and ultrathink map to fixed token budgets. The official documentation cited here does not establish those budget figures or the Tab instruction. Prefer the documented /effort control and ultrathink behavior over those unverified claims.

When should you use more effort for coding?

Consider higher effort when a task is ambiguous or needs several reasoning steps—for example, diagnosing a subtle bug, planning a risky refactor, or weighing architectural options. For a small, clearly specified edit, the default may be sufficient. This is a practical selection rule, not a claim that higher effort has been proven to improve every coding result.

Anthropic describes thinking as adaptive: the model evaluates each request and decides whether and how much to think. Its guidance identifies tricky debugging as the kind of task that may trigger deeper reasoning, while a simple factual request may not produce a thinking block.

Effort has a documented resource trade-off: Anthropic describes it as controlling how many tokens Claude uses when responding, balancing response thoroughness against token efficiency. The documentation does not establish a fixed token increase or a guaranteed latency change for every request, so evaluate representative work with your chosen model rather than assuming a specific cost or speed outcome.

Claude Code controls versus production API settings

Claude Code offers interactive controls for a coding session. A production Messages API request has its own model identifier and request configuration. For supported models, Anthropic documents output_config.effort as the API setting; available options and defaults depend on the model. Check the selected model’s documentation rather than assuming every model accepts the same values.

Anthropic identifies claude-opus-5-5 as the Messages API model ID and documents medium as its default effort. The API documentation describes output_config.effort for supported models, but the model-specific effort values are not listed here. If you need a non-default setting, confirm its availability for your chosen model before adding it to a request.

A minimal request shape, without an unverified non-default effort value, is:

{
  "model": "claude-opus-5-5",
  "max_tokens": 4096,
  "messages": [
    { "role": "user", "content": "Review this change for concurrency bugs." }
  ]
}

For Opus 5.5, adaptive thinking is always on; the documentation says to omit the thinking field or set it to { "type": "adaptive" }. At the default display setting, thinking-block text is empty. Do not assume every response includes a thinking block.

Bottom line: use /effort to steer a Claude Code session, ultrathink to request deeper reasoning for one turn, and the chosen model’s documented API settings for production requests. Effort trades token efficiency against response thoroughness; it does not promise better code or a fixed token budget.

Sources

Model configuration — Claude Code Docs

Effort — Claude Platform Docs

Steering thinking — Claude Platform Docs

Claude Opus 5.5 — Claude Platform Docs

What’s new in Claude Opus 5.5 — Claude Platform Docs

Contact us