Skip to content
BENIBIX Learn

MAX_THINKING_TOKENS

AI⌨️ Claude CodeConfiguration

Also known as MAX_THINKING_TOKENS=0

It sets how many tokens Claude may spend thinking.

Think of it like

It is like you give a child a few minutes to think. Then they must speak.

Example

Lucy runs an older model through a gateway and wants short, cheap answers. She sets a small thinking budget, and replies come back faster.

Why it matters

Thinking costs tokens and time. A fixed budget keeps both in check on models that use one.

Definition

MAX_THINKING_TOKENS sets a fixed number of tokens Claude may spend thinking before it answers. It stays at least one token below the output limit, and never goes under 1,024. Models that pick their own depth ignore the number. Set to 0, it turns thinking off on the Anthropic API. The 5.5 models and Fable are the catch: their thinking cannot be turned off.

Example code

bash
export MAX_THINKING_TOKENS=8000
claude
Give thinking a fixed budget.

Common mistake

Setting it on a model that picks its own depth and expecting a change. The number is ignored there.

Key takeaways

  1. 1
    Fixed budget. Tokens to think.
  2. 2
    At least 1,024. Below the output cap.
  3. 3
    0 turns it off. Where allowed.

Compare