ANTHROPIC_MODEL environment variable ignored on Bedrock - hardcoded to anthropic.claude-3-5-sonnet-20240620-v1:0

Resolved 💬 3 comments Opened Dec 12, 2025 by tela Closed Dec 15, 2025

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?

Bug Description

Claude Code v2.0.67 is ignoring the ANTHROPIC_MODEL environment variable when using AWS Bedrock, causing all main model calls to fail.

Environment

  • Claude Code version: 2.0.67
  • Platform: macOS
  • Provider: AWS Bedrock (us-west-2)
  • Installation method: Homebrew

Configuration

export CLAUDE_CODE_USE_BEDROCK=1
export AWS_REGION=us-west-2
export ANTHROPIC_MODEL=us.anthropic.claude-sonnet-4-20250514-v1:0
export ANTHROPIC_SMALL_FAST_MODEL=us.anthropic.claude-haiku-4-5-20251001-v1:0

Expected Behavior

Claude Code should use the model specified in ANTHROPIC_MODEL (Sonnet 4 inference profile)

What Should Happen?

Actual Behavior

Claude Code ignores ANTHROPIC_MODEL and is hardcoded to use anthropic.claude-3-5-sonnet-20240620-v1:0, which results in ValidationException errors because this model requires an inference profile for on-demand invocation.

Evidence

  • CloudWatch logs show Claude Code attempting to invoke anthropic.claude-3-5-sonnet-20240620-v1:0 (direct model ID) instead of the configured inference profile
  • All main model calls return ValidationException
  • ANTHROPIC_SMALL_FAST_MODEL environment variable IS being respected (Haiku 4.5 calls succeed)
  • AWS CLI can successfully invoke models using the same credentials and inference profiles

Impact

This bug completely blocks AWS Bedrock users from using Claude Code, making it impossible to leverage AWS startup credits or enterprise Bedrock deployments.

Workaround

None currently available. The ANTHROPIC_MODEL variable appears to be completely ignored for the main model.

Error Messages/Logs

Steps to Reproduce

Steps to Reproduce

  1. Install Claude Code v2.0.67
  2. Configure AWS Bedrock with valid credentials:
   aws configure
  1. Set environment variables in ~/.zshrc (or ~/.bashrc):
   export CLAUDE_CODE_USE_BEDROCK=1
   export AWS_REGION=us-west-2
   export ANTHROPIC_MODEL=us.anthropic.claude-sonnet-4-20250514-v1:0
   export ANTHROPIC_SMALL_FAST_MODEL=us.anthropic.claude-haiku-4-5-20251001-v1:0
  1. Reload shell: source ~/.zshrc
  2. Verify environment variables are set: env | grep ANTHROPIC_MODEL
  3. Launch Claude Code: claude
  4. Send any message: hello

Expected: Claude Code uses Sonnet 4 inference profile
Actual: API Error 400 - Claude Code attempts to use anthropic.claude-3-5-sonnet-20240620-v1:0 instead of configured model

Additional verification:

  • Enable AWS Bedrock CloudWatch logging
  • Monitor logs with: aws logs tail /aws/bedrock/modelinvocations --follow --region us-west-2
  • Logs show anthropic.claude-3-5-sonnet-20240620-v1:0 being invoked despite env var configuration

Claude Model

Sonnet (default)

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.0.67

Platform

AWS Bedrock

Operating System

macOS

Terminal/Shell

Warp

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗