Remote Control: Session creation fails with 401 "Authentication failed" — stale/incorrect cached subscription tier (Windows, v2.1.212)

Status Open
Reported on v2.1.212
Maintainer reply None cached
Activity 0 comments · opened Jul 17, 2026

Description

/remote-control fails every time with "Session creation failed — see debug log." The underlying
cause (found via --debug-file) is a hard 401 from the code-session creation endpoint, retried
3x, always failing — even immediately after a full claude auth logout + claude auth login
cycle with a freshly issued token.

This looks like the same failure class as #61551 (closed as stale, unresolved), but reproduced on
a current version (2.1.212) with a Max account.

Environment

  • Claude Code version: 2.1.212 (npm-global install)
  • OS: Windows 11 Home 10.0.26200
  • Shell: PowerShell 5.1 / Git Bash
  • Auth method: claude.ai OAuth (interactive login, not setup-token / CLAUDE_CODE_OAUTH_TOKEN)
  • Subscription: Max
  • claude auth status output:

``json
{
"loggedIn": true,
"authMethod": "claude.ai",
"apiProvider": "firstParty",
"subscriptionType": "pro"
}
``

  • claude doctor: reports "No installation issues found"

Steps to reproduce

  1. Start an interactive session: claude --continue
  2. Run /remote-control
  3. Observe toast: "Remote Control failed · Session creation failed — see debug log"
  4. Re-run with claude --continue --debug-file <path> and repeat step 2 — see log excerpt below
  5. Run claude auth logout then claude auth login (fresh browser OAuth flow, confirmed

.credentials.json rewritten with a new token)

  1. Repeat steps 1-2 with the fresh token — identical 401 failure, same timing pattern

Debug log excerpt

[code-session] [bridge] requested branch 'master' is the default branch — omitted from outcomes.branches (the runner stays on the clone)
[code-session] Session create failed 401: Authentication failed
[remote-bridge] createCodeSession failed (attempt 1/3), retrying in 441ms
[code-session] Session create failed 401: Authentication failed
[remote-bridge] createCodeSession failed (attempt 2/3), retrying in 1151ms
[code-session] Session create failed 401: Authentication failed
[bridge:repl] handleStateChange state=failed detail="Session creation failed — see debug log" cancelled=false outboundOnly=false
[bridge:repl] notifyBridgeFailed detail="Session creation failed — see debug log" outboundOnly=false wasConnected=false
[bridge:repl] Init returned null (precondition or session creation failed); consecutive failures: 1

Notes ruling out client-side causes

  • Token is not expired (.credentials.json expiresAt valid).
  • No ANTHROPIC_BASE_URL or CLAUDE_CODE_OAUTH_TOKEN env vars set.
  • No stale credential in Windows Credential Manager (Claude Code only uses .credentials.json on

this platform — confirmed via cmdkey /list).

  • Failure reproduces identically across two unrelated local projects/repos.
  • Failure persists across a full logout/login cycle with a demonstrably fresh token

(.credentials.json mtime postdates the retry timestamps in the log).

Related issues

  • #61551 (near-identical 401-at-registration symptom, Windows, closed stale/unresolved)
  • #57258, #57712, #57715 (related Remote Control session-creation/auth failures)

Expected behavior

/remote-control should either connect successfully, or surface a specific, actionable error
(e.g. "not entitled on your plan") instead of a generic 401 that survives a credential refresh.

View original on GitHub ↗