[BUG] when ANTHROPIC_BETA is set, Claude code does not respect ANTHROPIC_MODEL config
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?
When ANTHROPIC_BETA is set, Claude Code does not respect the ANTHROPIC_MODEL configuration, even when using AWS Bedrock with a specific application inference profile.
Environment:
• CLAUDE_CODE_USE_BEDROCK=1
• ANTHROPIC_MODEL configured with a Bedrock application inference profile for Sonnet 4.5
• ANTHROPIC_BETA is set
What Should Happen?
Claude Code should respect the ANTHROPIC_MODEL configuration and use the specified Bedrock application inference profile (Sonnet 4.5) regardless of whether ANTHROPIC_BETA is set.
Error Messages/Logs
Model is automatically changed to default Anthropic model, which leads to not enough budget error because I am using bedrock model with AWS auth, not Anthropic account.
Steps to Reproduce
Steps to Reproduce:
- Set CLAUDE_CODE_USE_BEDROCK=1
- Configure ANTHROPIC_MODEL with a Bedrock application inference profile for Sonnet 4.5
- Set ANTHROPIC_BETA environment variable
- Run Claude Code
- Observe that the configured model is not being used
Claude Model
Other
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.41
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
This appears to be a configuration precedence issue where the beta flag overrides the model selection configuration.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗