[FEATURE] Remote Control: allow localhost proxies (loopback exception or opt-in for ANTHROPIC_BASE_URL=http://127.0.0.1:*)

Open 💬 0 comments Opened Jul 11, 2026 by dspv

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

  1. Claude Code ≥ v2.1.196, logged in via a Pro/Max subscription (/login).
  2. export ANTHROPIC_BASE_URL=http://127.0.0.1:8787 (any local reverse proxy that forwards to api.anthropic.com, passing the OAuth Authorization header through untouched).
  3. Start claude/remote-control is missing from the command menu; the session never appears on claude.ai/code.
  4. 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/localhost base 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-key headers 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)

  1. Loopback exception: allow Remote Control when the ANTHROPIC_BASE_URL host is 127.0.0.1/localhost/::1.
  2. Explicit opt-in: e.g. CLAUDE_CODE_REMOTE_CONTROL_WITH_PROXY=1 or a settings.json key, keeping the safe default.
  3. 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.

View original on GitHub ↗