[BUG] Claude is referring to global.anthropic.claude-opus-4-1-20250805-v1:0 even ANTHROPIC_MODEL env variable set to different model
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?
⏺ This isn't something we can configure. The model: opus keyword in agent frontmatter is an internal Claude Code alias, and it currently maps opus → claude-opus-4-1, not claude-opus-4-6. The Task tool only accepts three keywords (opus, sonnet, haiku) — you can't pass a full Bedrock model ID.
Your ANTHROPIC_MODEL env var sets the parent session model correctly to claude-opus-4-6-v1, but it doesn't change what the opus keyword resolves to for subagents.
What works today:
- Removing model: opus from agent frontmatter (done) → agents inherit parent session model (claude-opus-4-6-v1)
- Requires a new session since the current session cached the old agent definitions at startup
To use the fix: restart Claude Code. The three agents (backend-manager, backend-architect, backend-developer) will then inherit your parent model (Opus 4.6) instead of resolving via the broken keyword.
The opus → claude-opus-4-6 mapping is something that needs to be updated in Claude Code itself. You could report it at https://github.com/anthropics/claude-code/issues.
✻ Crunched for 1m 1s
❯ it should alway map to env value ANTHROPIC_MODEL not static value.
⏺ Agreed — that's the correct behavior. When ANTHROPIC_MODEL is set, the opus keyword should resolve to that value rather than a hardcoded model ID. This is a bug/missing feature in Claude Code's model resolution for subagents.
You should file this at https://github.com/anthropics/claude-code/issues with:
- Current behavior: model: opus in agent frontmatter resolves to hardcoded global.anthropic.claude-opus-4-1-20250805-v1:0, ignoring ANTHROPIC_MODEL
- Expected behavior: When ANTHROPIC_MODEL is set (e.g., global.anthropic.claude-opus-4-6-v1), the opus keyword should resolve to that env value
- Context: Bedrock setup with CLAUDE_CODE_USE_BEDROCK=1
For now, the workaround is what we've done — remove model: from the frontmatter so agents inherit the parent model. Restart the session to pick up the changes, and the backend-manager workflow should run on Opus 4.6.
Want me to proceed with the evaluation now using model: sonnet as a workaround for this session, or would you prefer to restart first?
What Should Happen?
It should pick model from ANTHROPIC_MODEL if exist.
Error Messages/Logs
✻ Churned for 42s
❯ model name opus should resolve claude-opus-4-6-v1 not claude-opus-4-1
⏺ This is a system-level model resolution issue — the keyword "opus" in Claude Code maps to claude-opus-4-1 by default, not the newer claude-opus-4-6 you have configured for the parent session via ANTHROPIC_MODEL.
Let me check if there's a way to configure this mapping.
⏺ Bash(echo "ANTHROPIC_MODEL=$ANTHROPIC_MODEL" && echo "CLAUDE_CODE_USE_BEDROCK=$CLAUDE_CODE_USE_BEDROCK" && echo "ANTHROPIC_SMALL_FAST_MODEL=${ANTHROPIC_SMALL_FAST_MO…)
⎿ ANTHROPIC_MODEL=global.anthropic.claude-opus-4-6-v1
CLAUDE_CODE_USE_BEDROCK=1
ANTHROPIC_SMALL_FAST_MODEL=us.anthropic.claude-haiku-4-5-20251001-v1:0
… +2 lines (ctrl+o to expand)
⏺ Searched for 2 patterns, read 2 files (ctrl+o to expand)
⏺ This isn't something we can configure. The model: opus keyword in agent frontmatter is an internal Claude Code alias, and it currently maps opus → claude-opus-4-1, not claude-opus-4-6. The Task tool only accepts three keywords (opus, sonnet, haiku) — you can't pass a full Bedrock model ID.
Your ANTHROPIC_MODEL env var sets the parent session model correctly to claude-opus-4-6-v1, but it doesn't change what the opus keyword resolves to for subagents.
What works today:
- Removing model: opus from agent frontmatter (done) → agents inherit parent session model (claude-opus-4-6-v1)
- Requires a new session since the current session cached the old agent definitions at startup
To use the fix: restart Claude Code. The three agents (backend-manager, backend-architect, backend-developer) will then inherit your parent model (Opus 4.6) instead of resolving via the broken keyword.
The opus → claude-opus-4-6 mapping is something that needs to be updated in Claude Code itself. You could report it at https://github.com/anthropics/claude-code/issues.
✻ Crunched for 1m 1s
❯ it should alway map to env value ANTHROPIC_MODEL not static value.
⏺ Agreed — that's the correct behavior. When ANTHROPIC_MODEL is set, the opus keyword should resolve to that value rather than a hardcoded model ID. This is a bug/missing feature in Claude Code's model resolution for subagents.
You should file this at https://github.com/anthropics/claude-code/issues with:
- Current behavior: model: opus in agent frontmatter resolves to hardcoded global.anthropic.claude-opus-4-1-20250805-v1:0, ignoring ANTHROPIC_MODEL
- Expected behavior: When ANTHROPIC_MODEL is set (e.g., global.anthropic.claude-opus-4-6-v1), the opus keyword should resolve to that env value
- Context: Bedrock setup with CLAUDE_CODE_USE_BEDROCK=1
Steps to Reproduce
export ANTHROPIC_MODEL=global.anthropic.claude-opus-4-6-v1 and try to run agent with opus model even on Claude CLI.
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.50
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗