Subagent model IDs use hyphen notation (claude-sonnet-4-6) instead of dot notation (claude-sonnet-4.6)
Resolved 💬 2 comments Opened Mar 20, 2026 by blundell Closed Mar 20, 2026
Bug Report
Description
When spawning subagents using the Agent tool with model: "sonnet", Claude Code internally resolves the model to claude-sonnet-4-6 (using hyphens). However, some API deployments require the dot notation claude-sonnet-4.6.
Error
API Error: 400 {"error":{"message":"400: Invalid model name passed in model=claude-sonnet-4-6. Call /v1/models to view available models for your key."}}
Expected Behavior
The model shorthand "sonnet" should resolve to claude-sonnet-4.6 (dot notation), or Claude Code should respect the ANTHROPIC_MODEL environment variable when resolving subagent model IDs.
Actual Behavior
The model shorthand "sonnet" resolves to claude-sonnet-4-6 (hyphen notation), which is rejected by some API deployments.
Workaround
None currently available. The ANTHROPIC_MODEL env var in settings.json only affects the main model, not subagents spawned via the Agent tool.
Environment
- Platform: macOS
- Shell: zsh
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗