claude remote-control server gets a new environment id on most restarts, so routines pinned to it die

Status Open
Reported on v2.1.293
Maintainer reply None cached
Activity 0 comments · opened Oct 8, 2026

Summary

A claude remote-control server that runs as a login service on my Mac gets a new environment id on most restarts. Anything that refers to the environment by id (a cloud routine targeting it, a saved link) breaks the next time the server restarts, even though the server is started the same way with the same --name.

Setup

  • macOS 27.0, Claude Code 2.1.293 (updated daily).
  • launchd job (KeepAlive) runs claude remote-control --spawn same-dir --name "COS Mac" --permission-mode auto in the same directory, under the same account, since 2026-09-05. A companion job restarts it daily at 04:40 so it picks up the newest binary; it also restarts after crashes, network drops and sign-in expiry.

What happened

  • The server log records the environment=env_... id printed at each launch. Between 2026-09-06 and 2026-10-08 it printed 16 different environment ids for this one named server across its restarts.
  • A routine created on 2026-09-07 to run on the then-current environment failed on 2026-09-08 and was auto-disabled on 2026-09-11 after its environment id no longer existed.
  • Claude's own docs say the session "reconnects automatically when your machine comes back online", which is true for a live session, but a restarted server is a new environment every time.

What I would expect

  • A named remote-control server (--name) should keep a stable environment identity across restarts and Claude Code updates, or
  • routines and links should be able to target "the server named X on this machine" rather than a one-time environment id.

Why it matters

An always-on, self-restarting server is the only way to keep a Mac reachable from the phone around the clock. If every restart mints a new environment, nothing can be scheduled against it.

View original on GitHub ↗