[BUG][Bedrock] Agent Teams teammates spawned with non-Bedrock model ID via --model flag, causing 400 errors
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 using Agent Teams with AWS Bedrock, teammates spawned via the Task tool always fail with 400 The provided model identifier is invalid.
The root cause: Claude Code spawns teammates in tmux panes with --model claude-opus-4-6 (Anthropic API format) instead of the Bedrock-qualified model ID us.anthropic.claude-opus-4-6-v1. The --model CLI flag is hardcoded from the team config's model field, which stores the API-format name regardless of the Bedrock environment.
Key observations:
- The parent/lead process correctly uses Bedrock with
ANTHROPIC_MODEL=us.anthropic.claude-opus-4-6-v1 - The team config stores
"model": "claude-opus-4-6"(API format) for each teammate - The spawn command passes
--model claude-opus-4-6explicitly - The child process shows
claude-opus-4-6 · API Usage Billing(not Bedrock) despiteCLAUDE_CODE_USE_BEDROCK=1being available in the tmux global environment - Setting tmux global environment variables (
tmux set-environment -g) does not help because the--modelCLI flag appears to take precedence over env vars
Note: The similar issue for regular Task subagents (#15907, #21235) was fixed, but Agent Teams uses a different code path for spawning teammates that still has this problem.
What Should Happen?
When CLAUDE_CODE_USE_BEDROCK=1 is set, Agent Teams should:
- Store the Bedrock-qualified model ID in the team config (e.g.,
us.anthropic.claude-opus-4-6-v1instead ofclaude-opus-4-6) - OR map the model alias (e.g.,
opus) to the Bedrock model ID usingANTHROPIC_DEFAULT_OPUS_MODELwhen generating the--modelflag for the spawn command - OR ensure the child process respects
CLAUDE_CODE_USE_BEDROCK=1from the environment even when--modelis provided with an API-format name
Error Messages/Logs
API Error (claude-opus-4-6): 400 The provided model identifier is invalid.
Spawn command observed in tmux pane:
cd /path/to/repo && CLAUDECODE=1 CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
/path/to/claude \
--agent-id anime-otaku@team-name \
--agent-name anime-otaku \
--team-name team-name \
--agent-color blue \
--parent-session-id <uuid> \
--agent-type general-purpose \
--permission-mode acceptEdits \
--model claude-opus-4-6
Team config showing API-format model:
{
"agentId": "anime-otaku@team-name",
"name": "anime-otaku",
"model": "claude-opus-4-6",
"backendType": "tmux"
}
Steps to Reproduce
- Configure Claude Code for AWS Bedrock:
{
"env": {
"CLAUDE_CODE_USE_BEDROCK": "1",
"AWS_REGION": "us-west-2",
"ANTHROPIC_MODEL": "us.anthropic.claude-opus-4-6-v1",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "us.anthropic.claude-opus-4-6-v1",
"AWS_PROFILE": "claude",
"CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1"
},
"teammateMode": "tmux"
}
- Create a team with
TeamCreate - Spawn a teammate using the
Tasktool withteam_nameparameter - Observe the teammate's tmux pane showing
claude-opus-4-6 · API Usage Billingand400 The provided model identifier is invalid
Related Issues
- #15907 (closed) - Same model ID issue for regular Task subagents (fixed, but fix not applied to Agent Teams path)
- #21235 (closed) - Task tool ignores model config on Bedrock (fixed, but not for Agent Teams)
- #23437 (open) -
in-processmode ignored when running from tmux (blocks the workaround) - #23499 (open) - Bedrock model ID issue with
[1m]suffix
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
v2.1.33
Platform
AWS Bedrock
Operating System
macOS
Terminal/Shell
Other
Additional Information
The in-process teammate mode workaround is also blocked by #23437 (in-process setting is ignored when running from tmux, always falls back to tmux panes).
14 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Same issue, and also even if parent is 4.5, the children are using
--model claude-opus-4-6This only happens when you are in tmux and the children are another tmux pane. If you run them within parent (without tmux, etc), then no issues.
It's a bug you can patch yourself, I asked claude code to fix itself and it did, for me needed to:
file:
@anthropic-ai/claude-code/cli.js, replaceXvA=aA1.firstPartywithXvA="opus", the variable name could be very different on your machine but that's a hint.Not specific to CLAUDE_CODE_USE_BEDROCK=1. The same issue happens when ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN are set. The team agents don't respect the ANTHROPIC_DEFAULT_OPUS_MODEL value.
Reproducing this with Agent Teams split panes via tmux + iTerm2 on macOS
I'm hitting a similar issue. When Agent Teams spawns teammates in tmux panes, the Bedrock-related environment variables are not propagated, causing teammates to fail with
Not logged in · Please run /login.Setup:
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1ANTHROPIC_BEDROCK_BASE_URL,CLAUDE_CODE_USE_BEDROCK=1, etc.)What I observed:
The spawned teammate command looks like this:
Note that:
--model claude-opus-4-6is the Anthropic API format, not the Bedrock model IDCLAUDE_CODE_USE_BEDROCK,ANTHROPIC_BEDROCK_BASE_URL, andANTHROPIC_AUTH_TOKENare missing from the spawned process environment — onlyCLAUDECODE=1andCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1are setThis results in every teammate pane showing "Not logged in" since the child process has no way to authenticate against Bedrock without those env vars.
Expected behavior: All authentication-related environment variables from the parent session should be propagated to spawned teammate processes, and the model ID should be resolved to the Bedrock-qualified format when
CLAUDE_CODE_USE_BEDROCK=1is active.Confirming this is also an issue for me. Would appreciate a fix ASAP.
> Create a 2 agent team. Attempt to do a small amount of work using the us.anthropic.claude-opus-4-6-v1 model in the agent team members.Results in:
I can see both agents are running and processing. They defaulted to Opus 4.1 rather than 4.6 sincethe opus model alias resolves to 4.1 in the team agent context. Let me wait for them to finish
their work and send messages back.
And confirm the agents are using 4.1. Need a workaround here!
Confirming this reproduces with a custom API proxy as well (not just Bedrock).
Setup:
ANTHROPIC_BASE_URL+ANTHROPIC_AUTH_TOKENCLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1CLAUDE_CODE_SUBAGENT_MODEL=claude-sonnet-4-5in settings.json envmodelset toclaude-opus-4-6in settings.jsonWhat happens:
Teammates are spawned with
--model claude-sonnet-4-5-20250929(dated version), but the proxy only accepts base model names (claude-sonnet-4-5). This results in:As @cjpeterein noted —
ANTHROPIC_DEFAULT_*_MODELandCLAUDE_CODE_SUBAGENT_MODELenv vars are all ignored by the agent teams spawn path. The--modelflag on the spawned process overrides everything.This blocks agent teams usage for anyone behind a proxy that doesn't recognize the dated model identifiers.
FYI possible workaround in this comment on another issue that worked for me
Fix coming in the next release
This is still an issue for me after upgrading to the latest release this morning. Exactly as per the original issue description, bedrock, iterm, tmux. I have implemented the workaround mentioned which fixes things for me, but by default it still doesn't work.
v2.1.44Still observing the same issue on version 2.1.45 where it's supposed to be fixed. Quick debug session with CC:
@vladskiy : same, I'm on Foundry and this has not been fixed in 2.1.45 FYI @ashwin-ant
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.