CLAUDE_CODE_USE_FOUNDRY (Azure Foundry) no longer works in desktop app since recent update
Description
The Claude Code desktop app stopped routing API requests through Azure Foundry after a recent update (currently on v2.1.87). The terminal CLI continues to work correctly with Foundry.
Root Cause (diagnosed)
When the desktop app spawns the Claude CLI subprocess, it injects the following env vars that override all Foundry configuration:
- \
CLAUDE_CODE_PROVIDER_MANAGED_BY_HOST=1\— tells the CLI the host owns the provider - \
ANTHROPIC_BASE_URL=https://api.anthropic.com\— explicitly hardcodes the regular Anthropic API - \
CLAUDE_CODE_OAUTH_TOKEN\— uses OAuth instead of the configured Foundry API key
As a result, \CLAUDE_CODE_USE_FOUNDRY=1\ in \~/.claude/settings.json\ (and the \env\ block containing \ANTHROPIC_FOUNDRY_BASE_URL\, \ANTHROPIC_FOUNDRY_API_KEY\) is completely ignored.
Expected Behavior
\CLAUDE_CODE_USE_FOUNDRY=1\ in \~/.claude/settings.json\ should work in the desktop app, routing requests to the configured Azure Foundry endpoint — the same way it works in the terminal CLI.
Actual Behavior
All requests from the desktop app go to \https://api.anthropic.com\ regardless of Foundry configuration.
Environment
- Claude Code desktop app: v1.1.9669 (Electron)
- Claude Code CLI: v2.1.87
- OS: macOS 25.4.0 (Darwin)
- Azure Foundry base URL: configured in \
~/.claude/settings.json\env block
Steps to Reproduce
- Configure \
~/.claude/settings.json\with \CLAUDE_CODE_USE_FOUNDRY=1\, \ANTHROPIC_FOUNDRY_BASE_URL\, and \ANTHROPIC_FOUNDRY_API_KEY\ - Open the Claude Code desktop app
- Observe that requests go to \
api.anthropic.com\instead of the Foundry endpoint
Workaround
Use the terminal CLI (\claude\) which correctly respects the Foundry settings.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗