VS Code extension host becomes unresponsive (1-2.5 min) while claude.exe --resume loads a large session
Environment:
- Claude Code for VS Code: v2.1.181
- VS Code build: commit 93cfdd489c (Windows 11 Enterprise 10.0.26200)
- OS: Windows 11 Enterprise, AzureAD-joined/managed machine
Summary:
After a long-running Claude Code session (many hours, large transcript) and a VS Code window reload, the extension host reports "is unresponsive" for anywhere from ~15 seconds to ~2.5 minutes before recovering on its own. During this window, Task Manager / Get-CimInstance Win32_Process shows a separate claude.exe process (the CLI backend, e.g. .../anthropic.claude-code-2.1.181-win32-x64/resources/native-binary/claude.exe --resume <sessionId> ...) actively running. The freeze duration appears to scale with how much conversation history that session has accumulated -- projects/workspaces with heavy recent Claude Code activity froze repeatedly and for longer; workspaces with no recent Claude Code session history opened instantly.
We spent a full evening incorrectly suspecting an unrelated third-party VS Code extension (ours) before isolating this -- confirmed by disabling that extension entirely and reproducing the identical freeze, then identifying the actual claude.exe --resume process via Get-CimInstance Win32_Process -Filter "ProcessId=<extension-host-pid>".
Every occurrence was paired with this in the Window or Extension Host output log (inconsistently which channel it lands in):
[error] [Window] Canceled: Canceled
at ... Pge.triggerRefresh ...
at ... Failed to load custom agents
Steps to reproduce:
- Run a long Claude Code session in a VS Code workspace (many tool calls / large transcript).
- Reload the VS Code window (or close and reopen it) so the extension reconnects to / resumes that session.
- Observe: "Extension host (LocalProcess pid: N) is unresponsive" in the Window output channel, lasting up to a few minutes, recovering on its own.
- Confirm a claude.exe --resume <sessionId> process is running for the duration (Get-CimInstance Win32_Process | Where-Object CommandLine -like "claude.exe--resume*").
Expected: Resuming a session shouldn't block the VS Code extension host's event loop -- the UI can show a loading state while the resume happens in the background, without making the entire window (including unrelated extensions) appear frozen to VS Code's responsiveness monitor.
Possibly related: #69255 (UI flickering in resumed sessions with longer conversation histories) -- may share the same root cause (resume cost scaling with transcript size), different visible symptom.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗