VS Code extension: keep the session alive when a Remote Tunnel / Remote-SSH client disconnects, and re-attach the panel on reconnect
The use case
I run one long-lived Claude Code session on an always-on Windows host and work in the VS Code extension's chat panel through a VS Code Remote Tunnel.
- On a laptop, vscode.dev tunnelled to the host, chatting in the panel with Remote Control on.
- I close the laptop and pick up the phone, expecting the session in the Claude app.
- At home I open desktop VS Code, tunnel to the same host, and expect the same live session in the panel.
What happens today
Measured on the host (VS Code 1.139, tunnel started with --reconnection-grace-time 86400):
- When the client goes away, the remote extension host exits within seconds (exit code 0), and the Claude process, its child, exits with it. The 24-hour reconnection grace applies to the management connection, not to the extension host, so it does not help.
- Remote Control was on, but by the time the phone looks for the session there is no process left to attach to.
- Step 3 is a restart from the transcript (
resume), not a re-attach. Background work in flight does not resume, and the session comes back under a new peer name, so other sessions that message it cannot reach it until it is re-announced.
What I am asking for
Either of these would close the gap:
- A. The extension's session process outlives the window. When the extension host exits because a remote client disconnected, the Claude process keeps running on the host, as a
claude remote-controlserver session does. The panel re-attaches to it when any VS Code window reconnects to that host and workspace.
- B. The panel can attach to a session that is already running on the same machine, such as a CLI or Remote Control session. It attaches as a thin client, the way the mobile app and claude.ai/code already do.
With either one, steps 2 and 3 work with no restart: the phone attaches over Remote Control while the laptop is closed, and the panel attaches again at home.
Why the panel, not a browser tab
The panel is where the editor context is: file links and diffs open in place, and the status bar carries the session's context and usage. Moving the chat to claude.ai/code keeps the session alive but loses that, which is the reason to use the extension at all.
Related issues
- #60840 "VS Code extension: support attaching to running remote/bg sessions as a thin client (like the mobile app)" - closed as not planned. This request adds a concrete remote-host use case and option A, which does not need a thin client.
- #36401 "Remote Control: session should persist across disconnections" - closed as not planned.
- #96352 "Remote Control + VS Code Remote-SSH: reconnect spawns a second
claude --resumeon the same session" - open; the same reconnect path.
Environment
Windows 11 host, VS Code 1.139 with Remote Tunnels, Claude Code VS Code extension, Remote Control enabled, Max plan.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗