# MAX_THINKING_TOKENS

> It sets how many tokens Claude may spend thinking.

**Field:** Artificial Intelligence  
**Category:** Claude Code  
**Also known as:** MAX_THINKING_TOKENS=0

## Think of it like

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

## 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

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

## Example code

```bash
export MAX_THINKING_TOKENS=8000
claude
```

Give thinking a fixed budget.

## Why it matters

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

## Common mistake

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

## Three principles

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

## Related terms

- [CLAUDE_CODE_MAX_OUTPUT_TOKENS](https://learn.benibix.com/term/ai/claude-code-max-output-tokens-variable)
- [Reasoning Model](https://learn.benibix.com/term/ai/reasoning-model)
- [Claude Code Effort Level](https://learn.benibix.com/term/ai/claude-code-effort-level)

## Told apart from

- [CLAUDE_CODE_DISABLE_THINKING vs MAX_THINKING_TOKENS=0](https://learn.benibix.com/compare/claude-code-disable-thinking-variable-vs-max-thinking-tokens-variable): People think CLAUDE_CODE_DISABLE_THINKING turns thinking off. It does not. It only leaves the thinking field out of the request, for a proxy that rejects the field. A model that thinks by default may still think. MAX_THINKING_TOKENS=0 is the one that asks the Anthropic API for no thinking. On a cloud provider, both just leave the field out. Some new models cannot have thinking turned off at all.

---

Source: https://learn.benibix.com/term/ai/max-thinking-tokens-variable
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-16
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
