[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

  1. Set MAX_THINKING_TOKENS as an environment variable in settings, or your console.
  2. Confirm it is enabled when loading Claude Code
  3. 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.

View original on GitHub ↗

10 Comments

github-actions[bot] · 1 year ago

Found 1 possible duplicate issue:

  1. https://github.com/anthropics/claude-code/issues/658

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

Cyberbolt · 1 year ago

I also encountered the same problem, please help!

rrogers-machinify · 1 year ago

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

PazerOP · 1 year ago

I'm assuming that context compaction also uses haiku, which is why compaction takes significantly longer with MAX_THINKING_TOKENS set.

grantcarthew · 11 months ago

Confirming this also occurs with alwaysThinkingEnabled: true in settings.json (not just MAX_THINKING_TOKENS env var).

Specifically breaks the /context command with error:

Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"'claude-3-5-haiku-20241022' does not support thinking."}}

Using Vertex AI backend (CLAUDE_CODE_USE_VERTEX=1).

github-actions[bot] · 10 months ago

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.

ShravanSunder · 9 months ago

still an issue with bedrock

github-actions[bot] · 8 months ago

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.

marcindulak · 8 months ago

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.

github-actions[bot] · 8 months ago

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.