Issue: anthropics/claude-code#25193
When using Claude Code with AWS Bedrock (CLAUDE_CODE_USE_BEDROCK=1), spawning team agent teammates fails because the Bedrock model identifier (e.g., us.anthropic.claude-opus-4-6-v1) gets normalized to the Anthropic API format (claude-opus-4-6), which Bedrock does not recognize.
This causes all teammate processes to fail with:
API Error (claude-opus-4-6): 400 The provided model identifier is invalid.
Claude Code's internal model ID normalization strips the Bedrock prefix (us.anthropic.) and suffix (-v1) when passing the model to teammate subprocesses.
We exploit an internal env var CLAUDE_CODE_TEAMMATE_COMMAND that overrides which executable is used when spawning teammates. By pointing it at a wrapper script that rewrites --model args, we intercept and fix the model ID before it reaches the teammate process.
cat > ~/.local/bin/claude-bedrock-wrapper << 'SCRIPT'
#!/bin/bash
# Wrapper that rewrites --model args to use the Bedrock model ID.
# Spawned teammates get a normalized model ID (e.g., claude-opus-4-6)
# which Bedrock doesn't recognize. This rewrites it to the full Bedrock ID.
#
# See: https://github.com/anthropics/claude-code/issues/25193
BEDROCK_MODEL="${CLAUDE_BEDROCK_MODEL_OVERRIDE:-us.anthropic.claude-opus-4-6-v1}"
REAL_BINARY="$(readlink -f "$HOME/.local/bin/claude")"
args=()
while [[ $# -gt 0 ]]; do
if [[ "$1" == "--model" ]]; then
args+=("--model" "$BEDROCK_MODEL")
shift 2 # skip the original model value
else
args+=("$1")
shift
fi
done
exec "$REAL_BINARY" "${args[@]}"
SCRIPT
chmod +x ~/.local/bin/claude-bedrock-wrapperAdd to your ~/.zshrc (or ~/.bashrc):
export CLAUDE_CODE_TEAMMATE_COMMAND="$HOME/.local/bin/claude-bedrock-wrapper"source ~/.zshrc- Claude Code checks
CLAUDE_CODE_TEAMMATE_COMMANDbefore usingprocess.execPathwhen spawning teammates - The wrapper intercepts
--model claude-opus-4-6(or any normalized model) and replaces it with the full Bedrock model ID - Since env vars propagate to child processes, the wrapper is used at every level of spawning — even if a teammate spawns sub-teammates
To use a different Bedrock model, either:
- Edit the
BEDROCK_MODELdefault in the wrapper script, or - Set
CLAUDE_BEDROCK_MODEL_OVERRIDEin your shell:export CLAUDE_BEDROCK_MODEL_OVERRIDE="us.anthropic.claude-sonnet-4-5-20250929-v1:0"
- The wrapper resolves the real binary dynamically via the
claudesymlink, so it survives Claude Code auto-updates - This only affects teammate/agent spawning — your main Claude Code session is unaffected
- Remove the env var to disable the workaround once the upstream fix ships