Summary
When Claude Code is launched via the proxy (tray Run Claude Code or the manual snippet), the CLI prints two startup warnings:
‼ Both claude.ai and ANTHROPIC_API_KEY set · auth may not work as expected
· to use claude.ai: Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.
· to use ANTHROPIC_API_KEY: claude /logout to sign out of claude.ai.
⚠ claude.ai connectors are disabled because ANTHROPIC_API_KEY or another auth source is set and takes precedence over your claude.ai login · Unset it to…
This happens because the proxy must set ANTHROPIC_API_KEY=proxy-managed (dummy value — the real upstream key is injected by the proxy at request time), while many users also have an active claude.ai OAuth session from prior standalone use.
Steps to reproduce
- Configure an endpoint with the Messages API (
/messages).
- Set an upstream API key in the proxy settings.
- Fill all required Claude Code model slots.
- Ensure you are logged into claude.ai in Claude Code (
claude used outside the proxy at least once).
- Launch Claude Code from the tray (Run Claude Code) or paste the manual snippet from settings.
Expected behavior
Claude Code starts cleanly against the proxy with no misleading auth warnings — the dummy ANTHROPIC_API_KEY is intentional and routing goes through ANTHROPIC_BASE_URL.
Actual behavior
Both warnings above appear on every launch. They suggest unsetting ANTHROPIC_API_KEY or logging out of claude.ai — neither is desirable for proxy users who rely on the env var + base URL pattern (same approach as Codex with CODEX_PROXY_KEY=proxy-managed).
The connectors warning additionally tells users that claude.ai connectors (MCP integrations tied to the OAuth session) are disabled while the dummy API key is present — even though proxy mode is intentional, not a misconfiguration.
Root cause
spawn_agent / manual_command always set:
$env:ANTHROPIC_BASE_URL="http://127.0.0.1:<port>"
$env:ANTHROPIC_API_KEY="proxy-managed" # dummy — proxy injects real key
Claude Code treats a non-empty ANTHROPIC_API_KEY as API-key auth mode and conflicts that with an existing claude.ai OAuth session. The connectors warning is a downstream effect of the same precedence rule: API-key auth wins over claude.ai login.
Relevant code: src-tauri/src/commands.rs (ANTHROPIC_API_KEY_VALUE = "proxy-managed").
Impact
- Noisy, confusing UX on every proxy launch (two warnings).
- Users may
/logout or unset the env var and break proxy routing.
- Unclear whether auth actually fails or the warnings are benign when
ANTHROPIC_BASE_URL points at the proxy.
- claude.ai connectors are unavailable in proxy-launched sessions — may surprise users who expect OAuth-only features (connectors) to keep working alongside custom upstream routing.
Possible directions
Environment
- App: copilot-cli-custom-proxy (Claude Code / Messages API support)
- OS: Windows (PowerShell launch path)
- Claude Code: any recent version that prints the hybrid-auth and connectors warnings
Related
- Design:
docs/superpowers/specs/2026-06-28-claude-code-design.md §3 (launch env vars)
- Analogous pattern: Codex
CODEX_PROXY_KEY=proxy-managed (no equivalent warning observed)
Summary
When Claude Code is launched via the proxy (tray Run Claude Code or the manual snippet), the CLI prints two startup warnings:
This happens because the proxy must set
ANTHROPIC_API_KEY=proxy-managed(dummy value — the real upstream key is injected by the proxy at request time), while many users also have an active claude.ai OAuth session from prior standalone use.Steps to reproduce
/messages).claudeused outside the proxy at least once).Expected behavior
Claude Code starts cleanly against the proxy with no misleading auth warnings — the dummy
ANTHROPIC_API_KEYis intentional and routing goes throughANTHROPIC_BASE_URL.Actual behavior
Both warnings above appear on every launch. They suggest unsetting
ANTHROPIC_API_KEYor logging out of claude.ai — neither is desirable for proxy users who rely on the env var + base URL pattern (same approach as Codex withCODEX_PROXY_KEY=proxy-managed).The connectors warning additionally tells users that claude.ai connectors (MCP integrations tied to the OAuth session) are disabled while the dummy API key is present — even though proxy mode is intentional, not a misconfiguration.
Root cause
spawn_agent/manual_commandalways set:Claude Code treats a non-empty
ANTHROPIC_API_KEYas API-key auth mode and conflicts that with an existing claude.ai OAuth session. The connectors warning is a downstream effect of the same precedence rule: API-key auth wins over claude.ai login.Relevant code:
src-tauri/src/commands.rs(ANTHROPIC_API_KEY_VALUE = "proxy-managed").Impact
/logoutor unset the env var and break proxy routing.ANTHROPIC_BASE_URLpoints at the proxy.Possible directions
ANTHROPIC_API_KEY(e.g. base URL + gateway token only).ANTHROPIC_BASE_URLis overridden.Environment
Related
docs/superpowers/specs/2026-06-28-claude-code-design.md§3 (launch env vars)CODEX_PROXY_KEY=proxy-managed(no equivalent warning observed)