Remote Control: Session creation fails with 401 "Authentication failed" — stale/incorrect cached subscription tier (Windows, v2.1.212)
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.aiOAuth (interactive login, notsetup-token/CLAUDE_CODE_OAUTH_TOKEN) - Subscription: Max
claude auth statusoutput:
``json``
{
"loggedIn": true,
"authMethod": "claude.ai",
"apiProvider": "firstParty",
"subscriptionType": "pro"
}
claude doctor: reports "No installation issues found"
Steps to reproduce
- Start an interactive session:
claude --continue - Run
/remote-control - Observe toast: "Remote Control failed · Session creation failed — see debug log"
- Re-run with
claude --continue --debug-file <path>and repeat step 2 — see log excerpt below - Run
claude auth logoutthenclaude auth login(fresh browser OAuth flow, confirmed
.credentials.json rewritten with a new token)
- 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.jsonexpiresAtvalid). - No
ANTHROPIC_BASE_URLorCLAUDE_CODE_OAUTH_TOKENenv vars set. - No stale credential in Windows Credential Manager (Claude Code only uses
.credentials.jsonon
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.