Feature request: allow Remote Control when ANTHROPIC_BASE_URL is a transparent local proxy to api.anthropic.com
Title
Feature request: allow Remote Control when ANTHROPIC_BASE_URL is a transparent local proxy to api.anthropic.com
Body
Version: claude-code 2.1.197 (also observed on 2.1.195)
OS: Fedora Linux 43, kernel 7.0.8
Setup
I run Claude Code as a long-lived tmux-hosted session (a home-automation "assistant" project) that gets remotely restarted via a small internal API. For the daily-driver session I route traffic through a local, open-source token-compression reverse proxy (ANTHROPIC_BASE_URL=http://localhost:8787) that forwards every request unmodified to the real https://api.anthropic.com — it only compresses large tool-result payloads to reduce token usage, it does not change model routing, auth, or add any third-party backend.
Actual behavior
Running /remote-control <name> (or claude remote-control --name <name>) in a session where ANTHROPIC_BASE_URL is set to this proxy immediately fails:
Error: Remote Control is only available when using Claude via api.anthropic.com.
[debug] Remote Control auth state:
isBareMode=false
hasOAuthAccessToken=true
oauthScopes=user:file_upload,user:inference,user:mcp_servers,user:profile,user:sessions:claude_code
hasClaudeAIInferenceScope=true
isClaudeAISubscriber=true
hasProfileScope=true
oauthAccount.organizationUuid=set
ANTHROPIC_API_KEY=unset
ANTHROPIC_AUTH_TOKEN=unset
Auth/subscription state is otherwise completely valid (isClaudeAISubscriber=true, valid OAuth scopes) — the only difference from a normal session is ANTHROPIC_BASE_URL.
Expected behavior / request
Remote Control should work as long as the effective upstream is verifiably api.anthropic.com (e.g. resolved through a local reverse proxy that only forwards/compresses requests without changing destination, auth, or content), not just when ANTHROPIC_BASE_URL is literally unset/default.
Possible approaches:
- Allow Remote Control when
ANTHROPIC_BASE_URLis set but the proxy declares (e.g. via a response header, or a documented opt-in flag) that it forwards unmodified to the real API. - Or provide an explicit escape hatch (e.g.
CLAUDE_REMOTE_CONTROL_TRUST_PROXY=1) for advanced users who run their own local infra and understand the security tradeoff.
Why this matters
This blocks combining Claude Code's own official Remote Control feature with self-hosted token-compression tooling — currently the only workaround is to run the remote-controllable session with zero compression, which reintroduces the exact token-cost problem the proxy exists to solve.
Happy to provide more debug output or test a patch if useful.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗