[BUG][Bedrock] Agent Teams teammates spawned with non-Bedrock model ID via --model flag, causing 400 errors

Status Fixed / completed
Maintainer reply ✓ Yes — ashwin-ant
Activity 14 comments · opened Feb 6, 2026 · closed Feb 16, 2026
💡 Likely answer: A maintainer (ashwin-ant, collaborator) responded on this thread — see the highlighted reply below.

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-6 explicitly
  • The child process shows claude-opus-4-6 · API Usage Billing (not Bedrock) despite CLAUDE_CODE_USE_BEDROCK=1 being available in the tmux global environment
  • Setting tmux global environment variables (tmux set-environment -g) does not help because the --model CLI 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:

  1. Store the Bedrock-qualified model ID in the team config (e.g., us.anthropic.claude-opus-4-6-v1 instead of claude-opus-4-6)
  2. OR map the model alias (e.g., opus) to the Bedrock model ID using ANTHROPIC_DEFAULT_OPUS_MODEL when generating the --model flag for the spawn command
  3. OR ensure the child process respects CLAUDE_CODE_USE_BEDROCK=1 from the environment even when --model is 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

  1. 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"
}
  1. Create a team with TeamCreate
  2. Spawn a teammate using the Task tool with team_name parameter
  3. Observe the teammate's tmux pane showing claude-opus-4-6 · API Usage Billing and 400 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-process mode 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).

View original on GitHub ↗

14 Comments

github-actions[bot] · 6 months ago

Found 2 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/22742
  2. https://github.com/anthropics/claude-code/issues/22587

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

yhan1-godaddy · 6 months ago

Same issue, and also even if parent is 4.5, the children are using --model claude-opus-4-6

This 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.

Ahacad · 6 months ago

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, replace XvA=aA1.firstParty with XvA="opus", the variable name could be very different on your machine but that's a hint.

cjpeterein · 6 months ago

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.

christianvuerings · 6 months ago

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:

  • macOS, iTerm2 with Python API enabled
  • tmux installed via Homebrew
  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • Using AWS Bedrock via a custom proxy (ANTHROPIC_BEDROCK_BASE_URL, CLAUDE_CODE_USE_BEDROCK=1, etc.)

What I observed:

The spawned teammate command looks like this:

cd /Users/.../project && \
CLAUDECODE=1 \
CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 \
/path/to/bin/claude_code_latest \
  --agent-id infra-inspector@tech-debt-investigation \
  --agent-name infra-inspector \
  --team-name tech-debt-investigation \
  --agent-color orange \
  --parent-session-id ... \
  --agent-type general-purpose \
  --settings /private/var/folders/.../claude-settings-....json \
  --model claude-opus-4-6

Note that:

  1. --model claude-opus-4-6 is the Anthropic API format, not the Bedrock model ID
  2. CLAUDE_CODE_USE_BEDROCK, ANTHROPIC_BEDROCK_BASE_URL, and ANTHROPIC_AUTH_TOKEN are missing from the spawned process environment — only CLAUDECODE=1 and CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1 are set

This 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=1 is active.

jasonaden · 6 months ago

Confirming this is also an issue for me. Would appreciate a fix ASAP.

jasonaden · 6 months ago

> 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 since
the 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!

iploooox · 6 months ago

Confirming this reproduces with a custom API proxy as well (not just Bedrock).

Setup:

  • macOS, Claude Code latest
  • Custom proxy via ANTHROPIC_BASE_URL + ANTHROPIC_AUTH_TOKEN
  • CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS=1
  • CLAUDE_CODE_SUBAGENT_MODEL=claude-sonnet-4-5 in settings.json env
  • model set to claude-opus-4-6 in settings.json

What 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:

API Error: 401 key not allowed to access model. Tried to access claude-sonnet-4-5-20250929

As @cjpeterein noted — ANTHROPIC_DEFAULT_*_MODEL and CLAUDE_CODE_SUBAGENT_MODEL env vars are all ignored by the agent teams spawn path. The --model flag on the spawned process overrides everything.

This blocks agent teams usage for anyone behind a proxy that doesn't recognize the dated model identifiers.

amc40 · 6 months ago

FYI possible workaround in this comment on another issue that worked for me

ashwin-ant collaborator · 6 months ago

Fix coming in the next release

m2de · 6 months ago

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.44

vladskiy · 6 months ago

Still observing the same issue on version 2.1.45 where it's supposed to be fixed. Quick debug session with CC:

Root Cause The bug is NOT fixed in v2.1.45 for EU Bedrock cross-region inference profiles. The v2.1.45 fix addressed part of the original issue (#23561) — it now propagates CLAUDE_CODE_USE_BEDROCK=1 in the tmux spawn env — but the model ID resolution is still broken for non-US regions. What happens 1. The lead runs with ANTHROPIC_MODEL=arn:aws:bedrock:eu-west-1:...:inference-profile/eu.anthropic.claude-opus-4-6-v1 (correct EU ARN) 2. When spawning a teammate, Claude Code maps the model to its internal lookup table: Ki = { firstParty: "claude-opus-4-6", bedrock: "us.anthropic.claude-opus-4-6-v1", ... } 3. The spawn command uses[ --model us.anthropic.claude-opus-4-6-v1](url) — hardcoded us. prefix 4. Bedrock in eu-west-1 rejects us.anthropic.* model IDs with HTTP 400 Why it fails - The internal model table only has us. prefixed Bedrock IDs — no EU/AP variants - The --model CLI flag overrides ANTHROPIC_MODEL env var, so even though the correct ARN is in the tmux global env, it's ignored - ANTHROPIC_MODEL is not included in the env prefix of the spawn command The fix needed (in Claude Code source) Either: 1. Propagate ANTHROPIC_MODEL in the spawn env prefix AND don't pass --model (let the env var control it), OR 2. Use the lead's actual model ID (from ANTHROPIC_MODEL or the resolved ARN) instead of the lookup table when constructing the --model flag for teammate
YounesAkh · 6 months ago

@vladskiy : same, I'm on Foundry and this has not been fixed in 2.1.45 FYI @ashwin-ant

github-actions[bot] · 6 months ago

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.