[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)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗