Subagents fail with 400 when using Azure Foundry: effort parameter not supported
Summary
When using Claude Code with Azure OpenAI Foundry (CLAUDE_CODE_USE_FOUNDRY=1), all subagents (spawned via the Agent tool) immediately fail with:
API Error: 400 This model does not support the effort parameter.
The main session works fine. Only subagents are affected.
Root Cause
Claude Code sets CLAUDE_EFFORT=high in its own process environment after startup (it is not present in the user's shell before launching Claude). Subagent processes inherit this environment variable and translate it into an effort API parameter. Azure Foundry deployments do not support this parameter, causing every subagent call to fail immediately.
Verified via ! env | grep CLAUDE_EFFORT inside a running session — the variable is present with value high, but is absent in a fresh shell before Claude starts.
Steps to Reproduce
- Configure Azure Foundry in
.bashrc:
``bash``
export CLAUDE_CODE_USE_FOUNDRY=1
export ANTHROPIC_FOUNDRY_RESOURCE="<resource>"
export ANTHROPIC_FOUNDRY_API_KEY="<key>"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet"
- Start Claude Code (
claude) - Trigger any subagent (e.g. via the
Agenttool or a skill that spawns one) - Subagent exits immediately with
API Error: 400 This model does not support the effort parameter
Expected Behavior
Claude Code should not pass the effort parameter to the API when the Foundry backend does not support it. Either:
- Detect Foundry mode and suppress
effort, or - Do not set
CLAUDE_EFFORTin the process environment so subagents don't inherit it
Environment
- Claude Code version: 2.1.152
- OS: Ubuntu (WSL2)
- Backend: Azure OpenAI Foundry (
CLAUDE_CODE_USE_FOUNDRY=1) - Model aliases:
claude-sonnet,claude-haiku,claude-opus
Workaround
None known. Unsetting CLAUDE_EFFORT before launching Claude has no effect because Claude sets it itself after startup.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗