[BUG] Remote Control won't work when ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY is set
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code allows setting ANTHROPIC_AUTH_TOKEN and ANTHROPIC_API_KEY (alongside other variables, such as ANTHROPIC_BASE_URL), for using the Anthropic API based auth or 3rd party or local providers.
In version 2.1.138 this did work in combination with Remote Control, while using the regular Claude Code auth alongside the custom variables (e.g. claude /login) for a user that has an otherwise active subscription with Anthropic (in this case Max).
What happened previously, was that Claude Code would launch with the indicated model, while the session itself would be available in either the Claude Code Desktop app (Code tab) or on the website (at https://claude.ai/code).
Example when using Claude Code 2.1.138 and starting a Remote Control session, which shows up in the desktop app and works as expected, showing up alongside other regular Anthropic model based sessions (the example here shows DeepSeek, but it could be almost any other setup, including local models with Ollama or other technologies):
<img width="640" height="382" alt="Image" src="https://github.com/user-attachments/assets/e6b7d275-3815-4e80-8b76-b4ae07b5b596" />
Example of the same Remote Control session successfully showing up on the website version:
<img width="640" height="378" alt="Image" src="https://github.com/user-attachments/assets/7d841620-eb9e-448d-81c0-20a78859c0e7" />
Since updating to 2.1.141, this is no longer the case and an attempt to start such a session fails with a Claude Code error (see below) in the terminal, a Remote Control session will not start.
It expects the user to unset ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN which would in turn break the custom model configuration, since no auth could be done.
It is unclear whether this is a code bug and a regression of sorts, or a decision on Anthropic's part to block using Remote Control with any non-subscription models/settings, even when the particular user does have a subscription.
Additional details: when using a Windows PC with PowerShell, I could follow the instructions to install a specific version and can confirm that 2.1.138 works fine, but 2.1.139 breaks: https://code.claude.com/docs/en/setup#install-a-specific-version
It doesn't seem like there's anything in Anthropic's infrastructure that would prevent this use case, with the older version of Claude Code it still works as expected.
What Should Happen?
Option A: it should be clarified that this isn't a regression and is an intentional change - a decision on Anthropic's part to block using Remote Control with any non-subscription models/settings, even when the particular user does have a subscription.
Option B: it should work as in Claude Code version 2.1.138 - a Remote Control session should start under the account that the user is logged in with (Anthropic subscription), while using the indicated model settings under ANTHROPIC_BASE_URL and either ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY.
Error Messages/Logs
Error: Remote Control requires claude.ai subscription auth. ANTHROPIC_AUTH_TOKEN is set, so this session is using API-key auth - unset it (or run in a shell without it) to use Remote Control.
Error: Remote Control requires claude.ai subscription auth. ANTHROPIC_API_KEY is set, so this session is using API-key auth - unset it (or run in a shell without it) to use Remote Control.
Steps to Reproduce
Here's an example of the DeepSeek configuration above, though this would work with other provider too, including local models. The example needs Claude Code installed locally and Bash (or Git Bash) or a similar shell:
export ANTHROPIC_BASE_URL="https://api.deepseek.com/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_DEEPSEEK_API_KEY_HERE"
export ANTHROPIC_MODEL="deepseek-v4-pro[1m]"
export ANTHROPIC_DEFAULT_OPUS_MODEL="deepseek-v4-pro[1m]"
export ANTHROPIC_DEFAULT_SONNET_MODEL="deepseek-v4-pro[1m]"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="deepseek-v4-flash"
export CLAUDE_CODE_SUBAGENT_MODEL="deepseek-v4-flash"
export CLAUDE_CODE_EFFORT_LEVEL="max"
export CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS="1"
claude remote-control
You may also try the Ollama Claude Code example with something running locally: https://docs.ollama.com/integrations/claude-code#manual-setup
export ANTHROPIC_AUTH_TOKEN=ollama
export ANTHROPIC_API_KEY=""
export ANTHROPIC_BASE_URL=http://localhost:11434
export ANTHROPIC_MODEL="qwen3.5"
export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen3.5"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3.5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="qwen3.5"
export CLAUDE_CODE_SUBAGENT_MODEL="qwen3.5"
claude remote-control
(Ollama does not even need to be installed locally or running for this example)
Even a local model will not work starting with Claude Code version 2.1.139.
A local model WILL work if you do:
unset ANTHROPIC_AUTH_TOKEN
unset ANTHROPIC_API_KEY
and then the Remote Control session will show up. However, this is no different than someone just running a proxy that pretends to be a local model (and handles the API keys itself) to talk to cloud providers, so the question is, why is that restriction in place?
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.138 (Claude Code)
Claude Code Version
2.1.139 (Claude Code)
Platform
Other
Operating System
Windows
Terminal/Shell
Windows Terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗