Remote control: dead environment (404) shows misleading "Sign in again to verify your device" modal instead of environment-gone state
Environment
- Claude Desktop app 1.32352.1, macOS 26.5 (Apple Silicon)
- Claude Code CLI 2.1.233 running
claude remote-control --spawn worktreeunder a LaunchAgent (KeepAlive=true)
What happened
- The remote-control host serving environment
env_01LzXh…died with a bareError: Not foundafter the backend had stopped recognizing its state (it had earlier loggedError: CCR v2 worker registration failed for session cse_01H4…: Request failed with status code 404twice — for a session that had already reported "Session completed" the previous day). - The LaunchAgent relaunched the host 2 seconds later. It could not resume the preserved environment and silently registered a fresh environment (startup banner switched from "Continue coding…" to "Code anywhere…"). No warning that the old environment and its chats were being abandoned.
- Every chat bound to the old environment now 404s when opened. From the desktop webview log:
[REACT_QUERY_CLIENT] QueryClient error: {"type":"not_found_error","statusCode":404,
"endpoint":"/v1/environment_providers/private/organizations/<org>/environments/env_01LzXh…",
"method":"GET", "rawBody":"…Environment env_01LzXh… not found."}
(e.g. request_id req_011CeBdzpqK7pSHhMHmahbDq, 2026-08-19 ~06:32 UTC)
The bug: misleading sign-in modal
Opening such a chat pops a modal — "Sign in again to verify your device — Please sign in again to continue your session" (Not now / Sign in) — plus a toast "Remote connection setup error". But auth is completely healthy: the 404s above are authenticated responses, and there is not a single 401/403 in the logs for the whole incident window. Signing in again changes nothing, so the user repeatedly chases sign-in/keychain/auth fixes for what is actually an orphaned-environment state. This recurs on every click of an affected chat.
The accurate banner ("Remote environment unavailable — The remote environment this session was connected to is no longer available. Start a new session to continue.") also renders in the same view, so two contradictory diagnoses are shown at once, and the sign-in modal is the one that takes focus.
Expected
- No sign-in/verify-device modal when the failure is an environment 404 with valid auth — show only the environment-unavailable state.
- Ideally a terminal state for chats whose environment is gone, and/or a way to re-bind them to a live environment on the same machine (machine identity is stable via
remoteControlMachineId). - CLI side: after a crash,
claude remote-controlshould say loudly "could not resume environmentenv_…(not found), registering a new one — existing chats will be orphaned" instead of silently minting a fresh environment. (This has happened twice on this machine — the earlier occurrence followed a DNS outage: "Persistent errors for 10 minutes, giving up.")
Happy to provide fuller logs (main.log / claude.ai-web.log / remote-control host log) on request.
🤖 Diagnosed with Claude Code