[BUG] Haiku agents do not work if MAX_THINKING_TOKENS is set.
Resolved 💬 10 comments Opened Aug 1, 2025 by webhead2oo9 Closed Feb 7, 2026
Environment
- Platform (select one):
- [X] Anthropic API (Max Subscription)
- Claude CLI version: 1.0.65 (Claude Code)
- Operating System: Windows 11
- Terminal: WSL (Powershell - Ubuntu 22.04)
Bug Description
When MAX_THINKING_TOKENS is set in the environment, Haiku does not work as an agent due to thinking.budget_tokens being defined on the API request.
Steps to Reproduce
- Set MAX_THINKING_TOKENS as an environment variable in settings, or your console.
- Confirm it is enabled when loading Claude Code
- Create any agent using Haiku and attempt to use the agent.
Expected Behavior
Agent should respond as expected, and provide output ignoring the "Thinking" tokens variable, as this model does not support thinking.
Actual Behavior
Sonnet/Opus will respond stating that it received an error about max_tokens and thinking.budget_tokens when invoking the Haiku agent.
This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗