VS Code: after an extension host restart, Claude panels never re-attach, so every session in the window looks frozen until Reload Window

Status Open
Reported on v2.1.272
Maintainer reply None cached
Activity 3 comments · opened Sep 16, 2026

Environment

  • Claude Code VS Code extension 2.1.272 (CLI 2.1.270)
  • VS Code 1.136.1 (stable), single window, single-folder workspace
  • Windows 11 Pro, build 26200

What happened

Three Claude Code sessions were running in panels of one VS Code window. The window's extension host was restarted (the logs show a renderer-initiated terminate; it followed an extension being disabled from the Extensions view). Every session stopped at the same second and never processed input again. Each panel kept showing its last state — one mid-tool-call, one mid-response — with no error, no "session ended" notice and no way to continue. The sessions were not hung: the CLI processes had exited cleanly. Only a window reload (here, a full PC restart) recovered them; the transcripts were intact and --resume worked afterwards.

Evidence (log excerpts, local time, paths and ids removed)

08:20:22.433  Claude VSCode.log  Stream started - received first chunk      <- last CLI output relayed
08:20:22.533  exthost.log        Extension host terminating: received terminate message from renderer
08:20:23.17   exthost.log        Channel has been closed  (claude-code: shutdown -> closeAllChannels -> closeChannel)
08:20:23.5-25 claude MCP logs    Terminating MCP server process tree / connection closed (cleanly)   x4 CLI processes
08:20:25.085  main.log           Extension host with pid <old> exited with code: 0
08:20:23.373  renderer.log       Started local extension host with pid <new>
08:20:48.569  Claude VSCode.log  AuthManager initialized / extension is now active / MCP Server running on port <n>
              (no further Claude log lines; no panel ever sent `init` to the new host)

Windows showed no sleep, crash, memory pressure or network change in that window, and a separate non-VS Code process tree kept running normally.

Expected

When the extension reactivates in a new host, open panels either re-attach to their sessions, or clearly show the session ended with a one-click resume.

Actual

Panels keep rendering dead sessions as live. Nothing indicates the session is gone, so the natural reaction is to wait or restart the machine.

Reproduction (inferred from the logs above, not yet re-run in isolation)

  1. Open one or more Claude Code panels and start a long-running task in each.
  2. Disable any other active extension in the Extensions view and accept Restart Extensions (or run Developer: Restart Extension Host).
  3. Observe the Claude panels.

Workaround

Developer: Reload Window, then reopen each session from the panel's session history.

Possibly related

#79921 (sessions freeze locally until another session receives input), #75571 (extension hangs tied to the extension host IPC layer) — different trigger, same user-visible symptom.

View original on GitHub ↗

3 Comments

shinya-kobo · 20 days ago

Confirming this on Windows 11, and the trigger here was the routine "Restart Extensions" prompt that VS Code shows after an unrelated extension auto-updates. No extension was disabled manually.

Environment

  • Claude Code VS Code extension 2.1.280
  • VS Code 1.139.0 (stable), single window
  • Windows 11, build 26200

What I did

  1. At 14:35 (local time, UTC+9) VS Code auto-updated an unrelated extension (Pylance 2026.4.1). The Extensions view showed a badge and a message saying a restart of all extensions is needed to apply the update (my UI is Japanese; this is my translation), with a "Restart Extensions" button. @restartrequired listed only Pylance. The Claude Code extension itself was not updated (still 2.1.280).
  2. I did not click the button and kept using the Claude Code panel normally for about 4.5 hours. No hang.
  3. At about 19:06 I clicked "Restart Extensions".

Logs from step 3 (local time, paths removed)

19:06:15.639  Claude VSCode.log  Received message from webview: update_session_state (idle)   <- last normal webview message
19:06:26.797  exthost.log        Extension host terminating: received terminate message from renderer
19:06:27.186  exthost.log        Extension host with pid <new> started
19:06:28.227  Claude VSCode.log  AuthManager initialized / Claude code extension is now active / MCP Server running on port <n>
              (no further lines: no `init` message from the webview, which normally arrives a few seconds after activation)
19:08:02      I restarted the whole VS Code window

The panel never recovered. Same sequence as in the report above (renderer-initiated terminate, extension reactivates in the new host, the panel never sends init).

Why I think this matters

  • I have the same log pattern from three earlier days (2026-09-17, 09-18, 09-20). Each followed a Claude Code extension update, so I had assumed the update itself was the cause. This controlled run shows that restarting the extension host is enough. It does not matter which extension was updated.
  • The Claude Code extension itself updates every 1-2 days on my machine, and any extension's auto-update can produce the "Restart Extensions" prompt. So this is likely to be hit during ordinary use, not only after manually disabling an extension.

Not verified

  • I saw one controlled repro (plus the three earlier same-pattern occurrences, where I did not isolate the trigger). I have not checked whether it always happens.
  • I did not observe the click itself. The terminate time matches the click only by timing.

Workaround
Not clicking "Restart Extensions" avoided the problem for the 4.5 hours I tested. After a hang, restarting the window recovers it (as noted in the report).

yadonpapa · 6 days ago

Same signature on a plain cold start of VS Code, with no extension host restart in that session.

Environment

  • Windows 11 Pro, build 26200
  • VS Code 1.141.0 (2a59476c9b), single window, single-folder workspace
  • Claude Code extension 2.1.294 (win32-x64)

What happened
I closed VS Code and started it again. The Claude panel never connected. Starting VS Code once more fixed it. From the user's side this happens intermittently: one restart fails, the next one usually works.

Evidence (local time, UTC+9)

Failing session — this is the whole Claude VSCode.log (9 lines):

11:41:56.696 AuthManager initialized
11:41:56.696 Claude code extension is now active?
11:41:56.696 MCP Server running on port <n> (localhost only)
11:41:56.696 Getting authentication status
11:41:56.696 OAuth tokens found in secure storage
11:41:56.696 AuthManager initialized
11:42:15.786 Getting authentication status
11:42:15.786 OAuth tokens found in secure storage
11:42:15.786 AuthManager initialized

No Received message from webview line at all, so no webview ever sent init, and no Launching Claude / Spawning Claude followed. I quit VS Code at 11:42:55.

  • renderer.log: Started local extension host appears once. There is no second host and no host exit until shutdown.
  • exthost.log: the extension was activated by onWebviewPanel:claudeVSCodePanel (an editor-area Claude tab being restored).

Next start, about a minute later (works). Activation was onView:claudeVSCodeSidebarSecondary, and init arrives at once:

11:42:58.441 Claude code extension is now active?
11:42:58.441 Received message from webview: {"type":"request",...,"request":{"type":"init"}}
...
11:42:58.812 Launching Claude on channel: ...
11:43:02.701 Spawning Claude with SDK query function ...

Notes

  • onWebviewPanel activation does not always fail. In the session before the failing one, a restarted host was also activated by onWebviewPanel:claudeVSCodePanel and received init 2 s later. So the restored-panel activation path is the context of the failure, not a proven cause.
  • In all three starts, renderer.log logs Auto updating outdated extensions. anthropic.claude-code shortly after startup. The installed version stayed at 2.1.294 throughout.
  • Out of 12 VS Code sessions in my retained logs (Sep 30 – Oct 9), this is the only one where init never arrived.

Expected: a restored panel or sidebar sends init to the active host. If the handshake doesn't complete, the panel should show an error or retry, instead of waiting forever.

Workaround: restart VS Code (or Developer: Reload Window).

yadonpapa · 2 days ago

Correction to my comment above: in my case this was not a Claude Code bug, and not the same cause as this issue. Please disregard my cold-start report.

I found the cause on the same machine. In each failed start, the whole webview layer of that VS Code window was broken, because the window had been started while the previous VS Code instance was still shutting down. That instance was kept alive for about 6 seconds by another extension (Cline), which loops at shutdown (cline/cline#13197). While the old process still holds the profile, the new instance cannot open the Service Worker database, so every webview in that window fails with Could not register service worker: InvalidStateError. The Claude panel is one of those webviews, so the extension is active but init never arrives. Reloading the window does not help; restarting VS Code after the old process has exited does.

  • All four failures in my logs were started while the previous instance was still shutting down. For the most recent one, the Service Worker database log written at that start is empty (0 bytes), which means the database could not be opened.
  • I reproduced it in an isolated profile without Claude Code: the built-in Markdown preview, plus a dummy extension whose deactivate() takes longer than 5 s. Starting VS Code 1 s after closing it broke the webview; starting it after the old process had exited did not.

If someone else sees "extension active, but no init from the panel" right after restarting VS Code, these are worth checking:

  • In the previous session's main.log, is Extension host with pid ... exited logged after the new session started?
  • Is %APPDATA%\Code\Service Worker\Database\LOG (or LOG.old) 0 bytes with the time of the failed start?