Subagents fail with 400 when using Azure Foundry: effort parameter not supported

Resolved 💬 1 comment Opened May 27, 2026 by AlexanderLanin Closed Jun 27, 2026

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

  1. 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"
``

  1. Start Claude Code (claude)
  2. Trigger any subagent (e.g. via the Agent tool or a skill that spawns one)
  3. 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_EFFORT in 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.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗