[BUG] claude remote-control dies with 401 when mobile client connects (token valid but poll fails)

Resolved 💬 4 comments Opened Mar 2, 2026 by KOOKSIL-SSV Closed Mar 31, 2026

Bug Description

claude remote-control starts successfully and registers a bridge, but immediately dies with 401 the moment a mobile Claude app client connects. The OAuth token is confirmed valid via direct API testing.

Environment

  • OS: macOS Darwin 25.3.0 (Mac Mini, Apple Silicon)
  • Claude Code: v2.1.63 (latest)
  • Subscription: Claude Max (claude.ai OAuth)
  • Shell: zsh
  • Node: via homebrew

Reproduction Steps

  1. claude auth login (success, claude.ai method)
  2. claude remote-control → shows ✔ Ready with bridge URL
  3. Open Claude mobile app → select the Mac Mini environment
  4. Immediately:

``
Error: Poll: Authentication failed (401): Invalid OAuth token.
The provided token was not found or is malformed.
Remote Control is only available with claude.ai subscriptions.
``

  1. Process exits

Critical Evidence

The OAuth token stored in macOS Keychain is valid:

# Direct API test with the token from Keychain
$ curl -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    https://api.anthropic.com/v1/environments/bridge -X POST

# Returns 400 (Field required) — NOT 401
# This proves the token authenticates successfully

But claude remote-control gets 401 during the Poll phase when a client connects. This suggests:

  • The CLI may not be sending the token correctly during poll requests
  • OR the token gets rotated/invalidated when a mobile client connects and the CLI fails to handle the refresh

Additional Context

  • The command previously worked, then was force-killed. After that, it never worked again.
  • Fresh logout → login → new token → same issue
  • Deleting Keychain entry → fresh login → same issue
  • Reinstalling Claude Code via npm → same issue
  • Without any mobile client connecting, claude remote-control runs indefinitely with no errors
  • The 401 happens specifically during the Poll phase, not during initial bridge registration

Possibly Related Issues

  • #30096 — Same 401 error on macOS with remote-control
  • #28827 — OAuth token refresh fails in non-interactive/headless mode
  • #21765 — OAuth refresh token not used in headless environments
  • #12447 — OAuth token expiration disrupts autonomous workflows

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗