[BUG] CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 bypasses model capability checks, breaks Haiku subagents
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] 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
- Set the env var: export CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1
- Start claude
- Trigger any subagent that uses Haiku (Explore agent is the easiest)
- Subagent fails: 0 tool uses, 0 tokens, 0s. API rejects the effort parameter.
- Unset the env var: unset CLAUDE_CODE_ALWAYS_ENABLE_EFFORT
- 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)
5 Comments
Tested directly against the older binary with CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1 set. Same error. This is not a regression - the env var has always bypassed model capability checks. Updated regression status to "No."
This is really frustrating because forcing effort not only breaks Explore agents but Claude instead then opts to do the exploration in the main context :(
Confirming the same root-cause on a different setup — adding repro weight.
Environment
2.1.140(also repro'd on2.1.138from a prior session)claude-opus-4-7Explore(Haiku 4.5 backed)Trigger:
CLAUDE_CODE_ALWAYS_ENABLE_EFFORT=1set in~/.bashrcAND Windows User env (originally added per #13532 to fix the extended-thinking regression).Repro (deterministic):
Every Explore call dies before invocation. Claude often surfaces this to users as "Explore agent unavailable," which obscures the real cause.
Workaround applied: unset
CLAUDE_CODE_ALWAYS_ENABLE_EFFORT(and the now-inertCLAUDE_CODE_EFFORT_LEVEL) at both shell-profile and Windows-User-env layers. Explore works again immediately.Trade-off this forces on power users: those of us who set the env var per #13532 to force max effort on the main thread are now choosing between (a) deeper main-thread thinking but no Haiku subagents, or (b) working subagents but losing forced-max effort. The fix proposed in this issue (model-capability guard takes precedence over the env var) would resolve both — eager for it to ship.
This issue was fixed as of version 2.1.154.
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.