[FEATURE] Remote Control: allow localhost proxies (loopback exception or opt-in for ANTHROPIC_BASE_URL=http://127.0.0.1:*)
Summary
Since v2.1.196, Remote Control is disabled whenever ANTHROPIC_BASE_URL points at any host other than api.anthropic.com (changelog: "Remote Control is now disabled when ANTHROPIC_BASE_URL points at a non-Anthropic host"). This also gates loopback proxies (http://127.0.0.1:*), which breaks a legitimate and growing workflow: running Claude Code through a local optimization/audit proxy (context compression, prompt-cache handling, local savings metering) while still being able to hand a session off to claude.ai/code or the mobile app.
Please consider a loopback exception — or an explicit opt-in — so local proxies and Remote Control can coexist.
Reproduction
- Claude Code ≥ v2.1.196, logged in via a Pro/Max subscription (
/login). export ANTHROPIC_BASE_URL=http://127.0.0.1:8787(any local reverse proxy that forwards toapi.anthropic.com, passing the OAuth Authorization header through untouched).- Start
claude→/remote-controlis missing from the command menu; the session never appears on claude.ai/code. unset ANTHROPIC_BASE_URL→ works again. Last version where the combination worked: v2.1.138.
Why a loopback exception is reasonable
- A
127.0.0.1/localhostbase URL is the user's own machine — the same trust domain as the CLI process itself, not a remote MITM. The proxy never sees anything the local Claude Code process doesn't already see. - Auth is untouched: these proxies pass the
Authorization/x-api-keyheaders through verbatim; Anthropic's backend still authenticates the same subscription. - The current behavior is a silent capability loss: the command simply disappears, and users debug their proxy for hours before finding the version gate.
Proposed options (any would help, in order of preference)
- Loopback exception: allow Remote Control when the
ANTHROPIC_BASE_URLhost is127.0.0.1/localhost/::1. - Explicit opt-in: e.g.
CLAUDE_CODE_REMOTE_CONTROL_WITH_PROXY=1or asettings.jsonkey, keeping the safe default. - At minimum, a visible notice when the gate disables Remote Control ("disabled because ANTHROPIC_BASE_URL is set"), instead of the command silently vanishing.
Who this affects
Users of local LLM proxies/gateways in front of Claude Code — e.g. the open-source Headroom proxy community hit this too: https://github.com/headroomlabs-ai/headroom/issues/1779. Related (auth-token variant of the same gate): #59062; broader session-handoff ask: #71731.
Environment: Claude Code ≥ 2.1.196, macOS 14, subscription login.