[BUG] Haiku agents do not work if MAX_THINKING_TOKENS is set.
Status Closed — not planned
Maintainer reply None cached
Activity 10 comments · opened Aug 1, 2025 · 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.
10 Comments
Found 1 possible duplicate issue:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I also encountered the same problem, please help!
I can confirm this using claude cmd line. I switched my model to haiku 3.5 and then asked a question, any question and since I have the MAX_THINKING_TOKENS env var set, no matter what I ask I get this error:
API Error: 400 claude-3-5-haiku-20241022 does not support thinking
I'm assuming that context compaction also uses haiku, which is why compaction takes significantly longer with MAX_THINKING_TOKENS set.
Confirming this also occurs with
alwaysThinkingEnabled: truein settings.json (not just MAX_THINKING_TOKENS env var).Specifically breaks the
/contextcommand with error:Using Vertex AI backend (
CLAUDE_CODE_USE_VERTEX=1).This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
still an issue with bedrock
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
This issue was closed incorrectly despite recent human comments. This behavior of the bot is reported at https://github.com/anthropics/claude-code/issues/16497. Please upvote that issue, so maybe it gets noticed.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.