[BUG] Claude Desktop injects inference-only CLAUDE_CODE_OAUTH_TOKEN that breaks /remote-control
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?
Running /remote-control from within Claude Desktop fails with "Remote Control failed to connect: Remote Control initialization failed". Running claude remote-control --verbose reveals the cause: "Remote Control requires a full-scope login token. Long-lived tokens (from claude setup-token or CLAUDE_CODE_OAUTH_TOKEN) are limited to inference-only." Claude Desktop injects a CLAUDE_CODE_OAUTH_TOKEN (inference-only sk-ant-oat-... token) into the process environment. Running claude auth login succeeds but the injected env var overrides the full-scope credentials. Clearing the env var from child shells doesn't affect the parent Claude Code process. Restarting PC doesn't help — Desktop re-injects on launch.
What Should Happen?
/remote-control should work from within Claude Desktop. Either the Desktop app should inject a full-scope token, or claude auth login should take precedence over the injected env var.
Error Messages/Logs
Remote Control requires a full-scope login token. Long-lived tokens (from setup-token or CLAUDE_CODE_OAUTH_TOKEN) are limited to inference-only for security reasons. Run claude auth login to use Remote Control.
Steps to Reproduce
- Open Claude Code via Claude Desktop app on Windows
- Run /remote-control
- Observe failure
- Run claude auth login in a separate terminal — completes successfully
- Return to Desktop session, try /remote-control again — still fails
- Verify with echo $env:CLAUDE_CODE_OAUTH_TOKEN in a child shell — shows sk-ant-oat-... injected by Desktop
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.107
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Other
Additional Information
Claude Desktop (embedded terminal)
Related issues: #16238, #33105, #47811. The CLAUDE_CODE_OAUTH_TOKEN env var is not set in Windows User or System environment variables — it's injected by the Claude Desktop process at launch time.
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗