[BUG] Teams not using the ANTHROPIC_MODEL or other env vars.
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?
In my environment we use AWS Bedrock for our Anthropic models and they are set via ENVVAR ANTHROPIC_MODEL
❯ /model
─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
Select model
Switch between Claude models. Applies to this session and future Claude Code sessions. For other/previous model names, specify with --model.
1. Default (recommended) Use the default model (currently arn:aws:bedro
ck:us-east-2:654654581330:inference-profile/gl
obal.anthropic.claude-sonnet-4-20250514-v1:0)
2. arn:aws:bedrock:us-east-2:654654581330:inference-profile/global.anthropic.claude-sonnet-4-20250514-v1:0 Custom Sonnet model
3. arn:aws:bedrock:us-east-2:654654581330:inference-profile/global.anthropic.claude-opus-4-6-v1 Custom Opus model
4. arn:aws:bedrock:us-east-2:654654581330:inference-profile/global.anthropic.claude-haiku-4-5-20251001-v1:0 Custom Haiku model
❯ 5. Opus 4.6 ✔ arn:aws:bedrock:us-east-2:654654581330:inferen
ce-profile/global.anthropic.claude-opus-4-6-v1
▌▌▌ Medium effort (default) ← → to adjust
When I try to have Claude Code create a team to do a task the main agent works fine but all of the sub agents throw the error in the provided error message.
What Should Happen?
When I start a team they should default to using the ANTHROPIC_MODEL or the orchestrating agent should understand to start the subagents with that model or whatever else is configured. This would be similar to subagents.
Error Messages/Logs
@team-lead❯ Architecture exploration for TODO CLI
⎿ API Error (claude-opus-4-6): 400 The provided model identifier is invalid.. Try /model to switch to us.anthropic.claude-opus-4-1-20250805-v1:0.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ │
│ Task #3 assigned by team-lead │
│ │
│ Technical architecture for TODO tracker CLI │
│ │
│ Explore the technical architecture for a CLI tool that tracks TODO comments across a codebase. Consider: language/runtime choice (Rust, Go, Node, Python), │
│ parsing strategy (regex vs AST vs treesitter), performance at scale (large monorepos), caching and incremental scanning, output formats (JSON, SARIF, plain │
│ text), configuration file design (.todorc, package.json field), plugin/extension system, integration points (git hooks, CI/CD, LSP). Produce a structured │
│ report with architecture diagrams (text-based), trade-off analysis, and concrete technology recommendations. │
│ │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
⎿ API Error (claude-opus-4-6): 400 The provided model identifier is invalid.. Try /model to switch to us.anthropic.claude-opus-4-1-20250805-v1:0.
Steps to Reproduce
I was able to reproduce by being an environment where anthropic claude is blocked or you are not logged in.
Configure the ANTHROPIC_MODEL to use a AWS Bedrock model
Open Claude code
I followed the steps and prompts from the documentation here https://code.claude.com/docs/en/agent-teams
Check the other teammates and see they are failing because the model isn't available. The main agent works fine because it is using the proper model
Claude Model
Opus
Is this a regression?
No, this never worked
Last Working Version
_No response_
Claude Code Version
2.1.70
Platform
AWS Bedrock
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗