remote-control: Environment expires server-side after ~10 min, no auto-reconnect

Resolved 💬 3 comments Opened Mar 10, 2026 by carlosventurar Closed Mar 14, 2026

Description

claude remote-control sessions disconnect after ~10 minutes with Environment not found error. The server-side environment is expired/cleaned up, causing the local process to shut down with cascading errors. There is no built-in auto-reconnect mechanism.

Steps to reproduce

  1. Start remote-control with verbose logging:

``bash
claude remote-control --name 'VCIA' --verbose 2>&1 | tee /tmp/rc-debug.log
``

  1. Connect from Claude.ai or the Claude app
  2. Complete 1-2 tasks, then wait
  3. After ~10 minutes, the session dies

Error output

[20:01:32] Error: Environment env_016keiFKAyiYeESj7P8M7ZHc not found.
[20:01:32] Shutting down 1 active session(s)…
[20:01:32] Session session_01C26MfyGmvLaoRbGNGFAXAT interrupted
[20:01:32] Failed to stop work session_01C26MfyGmvLaoRbGNGFAXAT: StopWork: Failed with status 204
[20:01:32] Failed to archive session: Not Found
[20:01:32] Failed to deregister environment: Environment env_016keiFKAyiYeESj7P8M7ZHc not found.
[20:01:32] Environment offline.

Investigation

  • Not a local resource issue: 5.9 GB RAM available, no swap pressure, no OOM kills
  • Bridge WebSocket was healthy: Last successful POST at 20:00:00, no errors in bridge log
  • Server-side expiration: The environment ID is deleted/expired by the Anthropic backend
  • Reproducible: Happened across multiple sessions (tested with clean system, single Claude instance)

Environment

  • Claude Code version: 2.1.72
  • OS: Ubuntu 24.04, Linux 6.8.0-101-generic
  • RAM: 7.8 GB total
  • Node.js: v20+

Suggested improvements

  1. Auto-reconnect: When Environment not found is received, automatically re-register and reconnect instead of shutting down
  2. Longer TTL: Extend the server-side environment TTL or implement keep-alive pings
  3. Graceful degradation: Show "Reconnecting..." instead of cascading error messages

Current workaround

Wrapper script that relaunches remote-control on exit:

#!/bin/bash
NAME="${1:-MyProject}"
MAX_RETRIES="${2:-50}"
COUNT=0

while [ $COUNT -lt $MAX_RETRIES ]; do
    COUNT=$((COUNT + 1))
    echo "[$(date)] Attempt #$COUNT"
    claude remote-control --name "$NAME" --verbose
    echo "[$(date)] Exited. Reconnecting in 5s..."
    sleep 5
done

View original on GitHub ↗

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