[FEATURE] Remote Control: same-name re-registration should supersede the old session entry (disconnected duplicates accumulate indefinitely)
Summary
When a claude --remote-control <name> process is stopped and a new one is started with the same display name, the app (claude.ai / desktop / mobile, Code tab) creates a new entry in the Recents list instead of superseding the old one. The old disconnected entry stays forever — there is no delete affordance in the UI and no CLI command to deregister it (archiving only hides it).
Environment
- Claude Code 2.1.219
- macOS (launchd keepalive) and Synology DSM (tmux + supervisor), all on a claude.ai Max subscription
Reproduction
- Run
claude --remote-control myhost-remoteon a machine; entry appears in the app. - Kill the process; start it again with the exact same name.
- The app now shows two
myhost-remoteentries — one live, one permanently dead.
Why this hurts in practice
I run a small fleet (4 machines) of 24/7 remote-control daemons. Because server-side registrations can silently die (process healthy, connections ESTABLISHED, but the host disappears from the app — client-side undetectable), each machine performs a daily forced re-registration as a mitigation. That works, but the side effect is +4 dead duplicate entries every day, and the Recents list becomes mostly graveyard. Users have to guess which same-named entry is the live one.
Note the irony: the accumulation is caused by the workaround for another RC reliability gap (silent registration loss). Fixing either side would help.
Prior art
- #40812 — ghost sessions persist after restart (closed: not planned)
- #50496 — allow deleting old RC sessions (closed: not planned)
- #50884 — remove stale/dead RC environments (closed)
- #61525 — no way to delete or reconnect disconnected sessions (closed as completed on 2026-05-24, but the accumulation behavior above still reproduces on 2.1.219 as of 2026-07-26)
Suggested fixes (any one of these would resolve it)
- Supersede by name: a new registration with the same
--remote-control <name>replaces the previous entry for that name (opt-in flag would be fine, e.g.--remote-control-replace). - TTL / auto-expiry for disconnected RC sessions (e.g. hide after N days offline).
- Delete affordance: context-menu delete in the app and/or a CLI
claude remote-control deregister <name>.
Option 1 fits the daemon use case best: for a keepalive-managed host, the display name is the stable identity; the per-session entries behind it are an implementation detail.