[FEATURE] Let users remove stale/dead Remote Control environments from the claude.ai/code environment list
Preflight Checklist
- [x] I have searched existing requests and this feature hasn't been requested yet
- [x] This is a single feature request (not multiple features)
Problem Statement
After running claude remote-control multiple times on my local machine and shutting each session down (Ctrl+C / closing the terminal), the old environments continue to appear in the environment list at claude.ai/code. The entries persist indefinitely with no way to remove them, even though none of them work anymore, clicking them leads to a dead/non-functional session.
Over time, anyone who uses Remote Control regularly ends up with a long list of stale, non-functional environments in the web UI, making it hard to find the one active session among the dead ones. There is currently no affordance in the CLI or on the web to delete these stale entries.
Proposed Solution
Expected behavior: Users should be able to remove dead Remote Control environments from the list shown at claude.ai/code (and the mobile apps).
Feature request:
- Remove from web UI — A "Remove" / trash icon next to each entry in the environment list at claude.ai/code that deletes the stale environment from the list. This is the primary request.
- Bulk "Clean up disconnected" action — A single button that removes all environments that are no longer online, for users who accumulate many of them.
- CLI command — Something like claude remote-control --list and claude remote-control --revoke <session> for users who prefer the terminal.
- Optional auto-cleanup — After a configurable period of inactivity (e.g., 24h / 7d), stale environments are removed automatically.
Why this matters
- UX / clutter: The environment dropdown becomes unusable after normal daily use of Remote Control. There's no way to tell at a glance which sessions are alive without clicking.
- User control: Users should be able to manage their own environment list. Right now there's no action of any kind available on these entries.
- Security (secondary): As noted in #28917, stale session links can linger with no way to invalidate them, which is a concern on shared machines.
Alternative Solutions
_No response_
Priority
Medium - Would be very helpful
Feature Category
CLI commands and flags
Use Case Example
- Start a Remote Control session in the morning, work on it, close the terminal at lunch.
- Start another one in the afternoon on a different project, close it at the end of the day.
- Next day, repeat.
- Within a week, claude.ai/code shows 10+ dead environments in the list with no way to remove them, making it hard to locate the one I'm currently using.
Additional Context
Related: #28917 (focuses on security/link-invalidation after shutdown). This request overlaps but emphasizes the environment list UX at claude.ai/code specifically, and the case where a user has accumulated multiple stale entries from normal repeated use.
14 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
I don't think any of these are actual duplicates:
claude remote-controlhanging on Windows. Stale environments are mentioned there only as a suspected cause of the connection hang. Fixing that bug wouldn't give users any way to clean up the list, which is the problem I'm describing.The concern here is unaddressed by all three: after running
claude remote-controlmultiple times on a local machine, dead environments accumulate in the claude.ai/code environment dropdown with no way to remove them — a UX/clutter problem on the web, separate from the connection bug, from regular session deletion, and from the mobile app.still a problem - dead environments are pilling up with no way to delete them
Still a problem – specifically in mobile app!
How has this not been added yet
I confirm, this is still an issue on mobile. PR still showing and without a possibility to delete them.
Adding a data point on what actually creates these stale environments — the thread covers the symptom well but not the trigger.
Setup: headless Linux box, Claude Code 2.1.224, nine
claude remote-control --spawn worktreeservers under systemd (Restart=always), one per project directory, running continuously for weeks.The environment ID is stable across ordinary restarts. Each service has restarted 38 times in two weeks — process exits, systemd restarts it 30s later from the same directory — and the environment ID is unchanged every time. That matches the observation in #78695 that identity is keyed per (machine, directory).
It rotates on whole-fleet events, and all environments rotate together. Only two changes in two weeks, and in both cases all nine environments got new IDs within the same second:
Stoppedfor each one before the box went down. New IDs on the way back up.The reboot case is the interesting one: a completely graceful shutdown does not preserve the environment identity. So "exit cleanly" is not a workaround — there is no shutdown discipline that avoids this. Every reboot permanently adds one dead environment per directory, and they can never be removed.
Why this is worse than clutter: a stale environment keeps advertising the session count it had at the moment it died. One of mine currently shows
8 of 32while the live environment for the same directory shows0 of 32. The two rows are otherwise identical — same directory, same branch — so in the picker the dead entry looks more alive than the real one. Selecting it leaves the mobile app on "Allocating sandbox" indefinitely, with no error and no timeout.Two changes that would each fix the practical problem independently of the delete feature requested here:
Just resubscribed to Claude after refunding my first annual subscription due to atrocious performance and usage limits. Considering doing this again! ChatGPT app has this out of the box!
How is this still not supported?
Remote Control is incredibly frustrating in its current state. Stale environments accumulate permanently, show 0 of 32, and there is apparently no way to delete or revoke them from Desktop, web, mobile, or the CLI.
Basic lifecycle management should not be missing from a feature like this. Please add a proper delete/revoke mechanism and automatic cleanup for dead environments. This should be table stakes.
On my Mac I added a "launch agent" plist file that runs
claude remote-controlon every reboot / unexpected process exit.After some testing of this setup I can also select two different environments in the iphone / ipad app.
One of those environments is dead however and any request lands in "allocating sandbox" limbo, the other one is working fine though.
I also see two environments when typing
/remote-envin Claude on the mac itself.What's curious to me though is that it stays at two envs, no matter how often I reboot my Mac.
Quite annoying to always have to guess which env is the alive one.
<img width="590" height="1278" alt="Image" src="https://github.com/user-attachments/assets/11089fbd-ef11-42ea-8f07-d8ee4f18c6dc" />
+1 — same issue here. After a computer restart, the disconnected session just sits in the list with no delete option, in the CLI or on claude.ai/code. Archiving is the only workaround and it doesn't remove the entry. A per-entry "Remove" action or a bulk "clean up disconnected" button would be a big help for anyone using Remote Control regularly.
I found an undocumented workaround that may help until Anthropic adds a proper UI/CLI delete option.
This lists your environments, then lets you remove a stale one. It reads the local Claude OAuth token automatically and doesn’t print it:
GET https://api.anthropic.com/v1/environmentsDELETE https://api.anthropic.com/v1/environments/bridge/<environment_id>Authenticate with your Claude OAuth token from ~/.claude/.credentials.json
I’d stop any active claude remote-control bridge first, then delete only the stale env_... entry. It worked for me, but it’s undocumented, so a proper “remove disconnected environments” action is still badly needed.
@phishsticks works like a charm!
Also hitting this on Windows.
Setting up Remote Control on one machine (Windows 11, Claude Code 2.1.241 from npm, always the same directory) left 11 environments registered on my account within about an hour, purely from restarting the supervisor while testing. They all show the same hostname and the same path, and most still render as online, so the "Choose environment" list is unusable: you cannot tell which entry is the live one.
There is no way to remove them: nothing in the picker at claude.ai/code (the rows are select-only), nothing under Settings -> Claude Code, no swipe or long-press in the iOS app, and no CLI command.
One detail that may be worth documenting, because it makes the accumulation much worse:
claude rc --no-create-session-in-dircreates a new environment on every start. With no pre-created session there is nothing recorded inbridge-pointer.json, so there is nothing to re-attach to.claude rc --name <x>(keeping the pre-created session) does re-attach and keeps the same environment across restarts. Verified:bridge-pointer.jsonholds the sameenvironmentIdbefore and after a restart.So the flag that looks like the tidy option (no placeholder session cluttering the session list) is exactly the one that spams the environment list. Until there is a delete action, a warning in
claude rc --helpwould already help a lot.Possible work-around:
Stale remote control environments can be deleted using a browser (claude.ai/code). The tag for stale env has 3 vertical dot icon that opens a menu with a Delete button.
If /remote-control is used in a claude session, then you can see the session come and go in the mobile app under Code.
I learned about "claude rc" from the newsletter. It should have recommended using /remote-control in a session for better control.
I also set:
❯ Enable Remote Control for all sessions false
Controlling remote control manually is better for me at this time - quite new at this business.
FYI: Claude can't read these comments. Indicated concern that Anthropic is not reading comments. Was told that I was being unfair. Salty Claude.