claude-code - 💡(How to fix) Fix [BUG] CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 bypasses model capability checks, breaks Haiku subagents [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#47175Fetched 2026-04-13 05:39:27
View on GitHub
Comments
1
Participants
1
Timeline
9
Reactions
0
Participants
Timeline (top)
labeled ×7commented ×1unlabeled ×1

Error Message

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"This model does not support the effort parameter."},"request_id":"req_011Ca11Jz7wdaZH9TaWS5sSw"}

Code Example

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"This model does not support the effort parameter."},"request_id":"req_011Ca11Jz7wdaZH9TaWS5sSw"}
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

Setting CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 as a shell environment variable causes all subagents that use Haiku 4.5 (e.g., Explore agent) to fail with an API error indicating the effort parameter is not supported for the current model configuration.

The env var appears to force the effort parameter onto every API call unconditionally, including calls to models that don't support it. The model-specific capability check that would normally prevent sending effort to Haiku is bypassed entirely when this env var is set.

What Should Happen?

The env var should enable effort only for models that support it (Opus 4.6, Sonnet 4.6, etc.), not override model capability checks. The model guard should take precedence so that Haiku subagents never receive the effort parameter regardless of env var state.

Error Messages/Logs

API Error: 400 {"type":"error","error":{"type":"invalid_request_error","message":"This model does not support the effort parameter."},"request_id":"req_011Ca11Jz7wdaZH9TaWS5sSw"}

Steps to Reproduce

  1. Set the env var: export CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1
  2. Start claude
  3. Trigger any subagent that uses Haiku (Explore agent is the easiest)
  4. Subagent fails: 0 tool uses, 0 tokens, 0s. API rejects the effort parameter.
  5. Unset the env var: unset CLAUDE_CODE_ALWAYS_ENABLE_EFFORT
  6. Restart claude, trigger same subagent. Works normally.

Claude Model

Opus

Is this a regression?

No

Claude Code Version

2.1.104

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

Other

Additional Information

Other effort-related env vars (MAX_THINKING_TOKENS, CLAUDE_CODE_DISABLE_ADAPTIVE_THINKING, CLAUDE_CODE_EFFORT_LEVEL) do not cause this issue. Isolated through one-by-one elimination testing. Only CLAUDE_CODE_ALWAYS_ENABLE_EFFORT triggers the failure.

Related: #30795 (same error when effort was sent to an unsupported model on Bedrock, fixed after 2.1.68)

extent analysis

TL;DR

The issue can be fixed by modifying the code to check the model's capability before sending the effort parameter when the CLAUDE_CODE_ALWAYS_ENABLE_EFFORT environment variable is set.

Guidance

  • Review the code that handles the CLAUDE_CODE_ALWAYS_ENABLE_EFFORT environment variable to ensure it checks the model's capability before sending the effort parameter.
  • Verify that the model-specific capability check is not being bypassed when the environment variable is set.
  • Consider adding a conditional statement to only send the effort parameter if the model supports it, regardless of the environment variable's state.
  • Test the fix by setting the CLAUDE_CODE_ALWAYS_ENABLE_EFFORT environment variable and triggering a subagent that uses Haiku to ensure it no longer fails with an API error.

Example

if model_supports_effort and (os.environ.get('CLAUDE_CODE_ALWAYS_ENABLE_EFFORT') == '1'):
    # Send effort parameter

Notes

The issue seems to be specific to the CLAUDE_CODE_ALWAYS_ENABLE_EFFORT environment variable and its interaction with the model capability check. The fix should focus on ensuring that the model's capability is checked before sending the effort parameter.

Recommendation

Apply a workaround by modifying the code to check the model's capability before sending the effort parameter when the CLAUDE_CODE_ALWAYS_ENABLE_EFFORT environment variable is set, as this will ensure that the effort parameter is only sent to models that support it.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING