ANTHROPIC_DEFAULT_OPUS_MODEL env var not honored when selecting Opus 4.5 from /model list
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 9 comments · opened Jan 12, 2026 · closed Feb 19, 2026
Bug Description
When specifying the ANTHROPIC_DEFAULT_OPUS_MODEL environment variable pointing to Claude Opus 4.5 (via AWS Bedrock), selecting "Opus 4.5" from the /model list does not honor the environment variable. Instead, it results in an AWS Bedrock error.
However, when selecting "Opus 4.1" from the /model list, Claude Opus 4.5 is correctly used (as specified in the env var).
Steps to Reproduce
- Set
ANTHROPIC_DEFAULT_OPUS_MODELenvironment variable to a Claude Opus 4.5 Bedrock inference profile ARN - Start Claude Code
- Run
/modeland select "Opus 4.5" - Observe: AWS Bedrock error occurs (env var not honored)
Expected Behavior
Selecting "Opus 4.5" from the /model list should use the model specified in ANTHROPIC_DEFAULT_OPUS_MODEL environment variable.
Actual Behavior
- Selecting "Opus 4.5" ignores the
ANTHROPIC_DEFAULT_OPUS_MODELenv var and causes an error - Selecting "Opus 4.1" correctly uses the Opus 4.5 model specified in the env var
Environment
- Using AWS Bedrock as the model provider
ANTHROPIC_DEFAULT_OPUS_MODELset to Opus 4.5 inference profile ARN
9 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Confirming this bug + Binary Analysis
I can confirm this exact issue on Claude Code 2.1.19 with AWS Bedrock on macOS.
Binary Analysis Findings
I analyzed the Claude Code binary (
~/.local/share/claude/versions/2.1.19) and found evidence that confirms this is a wiring bug:1. Only ONE Opus environment variable exists:
2. Display name mapping logic in binary:
3. Current environment:
The model ID clearly indicates version 4.5:
claude-opus-**4-5**-20251101The Bug
The menu options are wired backwards:
ANTHROPIC_DEFAULT_OPUS_MODEL✓ (but shouldn't)ANTHROPIC_DEFAULT_OPUS_MODEL✗ (but should read it)Impact
ANTHROPIC_DEFAULT_OPUS_MODELsuggests it should be for the latest/default Opus model (4.5), not 4.1Suggested Fix
Swap the environment variable usage so that:
ANTHROPIC_DEFAULT_OPUS_MODELANTHROPIC_OPUS_4_1_MODEL) or hardcoded model IDI found my here as we use application inference profiles to attach cost allocation tags which provide usage attribution. While tracing down a significant portion of Bedrock spent that wasn't properly attributed, I discovered this
/modelselection ofOpus 4.1(really our Opus 4.5 application inference profile) vsOpus 4.5.Confirming: Short model names in custom agent frontmatter also affected on Bedrock
Environment: Claude Code 2.1.31, AWS Bedrock, macOS
Issue: Custom agents defined in
.claude/agents/*.mdwithmodel: opusin frontmatter spawn as Opus 4.1 instead of Opus 4.5, even when the main session is correctly using Opus 4.5 via full Bedrock ARN insettings.json.Configuration:
Evidence: TUI displays "Opus 4.1" when spawning custom agents that specify
model: opus, despite parent session running Opus 4.5.~~Workaround: Use full Bedrock ARN in agent frontmatter:~~
~~This confirms the short name → model ID resolution bug extends beyond the
/modelmenu to custom agent frontmatter on Bedrock.~~Correction: Custom agent frontmatter model field non-functional on Bedrock
My previous comment was incorrect. After testing multiple approaches, none work for custom agents on Bedrock:
| Frontmatter Value | Result |
|-------------------|--------|
|
model: opus| Spawns as Opus 4.1 ❌ ||
model: us.anthropic.claude-opus-4-5-20251101-v1:0(Bedrock ARN) | Spawns as Opus 4.1 ❌ ||
model: claude-opus-4-5-20251101(Anthropic-style ID) | Spawns as Opus 4.1 ❌ |Environment: Claude Code 2.1.31, AWS Bedrock, macOS, main session correctly running Opus 4.5
IMO this situation is now even more annoying with Opus 4.6 as there are now two 4.6 options:
Opus 4.6 - Opus 4.6 · Most capable for complex work
Opus (1M context) - Opus 4.6 for long sessions
Very confusing for my users, as they will now see 3x models for Opus in
/model, whereOpus 4.1is actually the Opus 4.6 provided through my application inference profile in Bedrock that they should use.. 😮💨I believe this is now fixed. Since I have
ANTHROPIC_DEFAULT_OPUS_MODEL,ANTHROPIC_DEFAULT_SONNET_MODEL, &ANTHROPIC_DEFAULT_HAIKU_MODELset those are the only models that I see when I type/modelnow. Not sure if that's the best way to handle it, but 🤷 .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.