claude-code - 💡(How to fix) Fix [IDE Extension] Agents panel exit causes focus trap — UI becomes unselectable

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

After an Agents session ends or the user exits the Agents panel in the Claude Code IDE extension (VS Code), keyboard and mouse focus remains trapped inside the closed Webview. The main editor and VS Code UI elements become unresponsive to selection and clicks until focus is forcibly released.

Root Cause

Root Cause Hypothesis

Fix Action

Fix / Workaround

Workarounds (temporary)

RAW_BUFFERClick to expand / collapse

Summary

After an Agents session ends or the user exits the Agents panel in the Claude Code IDE extension (VS Code), keyboard and mouse focus remains trapped inside the closed Webview. The main editor and VS Code UI elements become unresponsive to selection and clicks until focus is forcibly released.

Steps to Reproduce

  1. Open Claude Code IDE extension in VS Code
  2. Start an Agents session (open the Agents panel)
  3. Let the agent complete its task, or manually exit/close the Agents panel
  4. Attempt to click or select text in the main editor or other VS Code UI elements

Expected Behavior

After exiting the Agents panel, focus returns to VS Code normally and all UI elements remain selectable and interactive.

Actual Behavior

UI elements in the main editor and VS Code interface become unresponsive. Clicks and text selection do not register until focus is manually released (e.g., pressing Escape, clicking the Activity Bar, or running Developer: Reload Webviews).

Environment

  • OS: Windows 11 Home 10.0.26200
  • Claude Code version: 2.1.143
  • IDE: VS Code (Windows)

Workarounds (temporary)

  • Press Escape to release focus trap
  • Click VS Code Activity Bar (left icon rail)
  • Ctrl+Shift+PDeveloper: Reload Webviews
  • Ctrl+Shift+PDeveloper: Reload Window (last resort)

Root Cause Hypothesis

This is consistent with a Webview lifecycle bug where panel.dispose() or the equivalent close handler does not call panel.webview.postMessage / focus transfer before teardown, leaving the Webview's focus event handler registered but the panel invisible. The OS-level window focus stays with the Webview host, not the editor.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

claude-code - 💡(How to fix) Fix [IDE Extension] Agents panel exit causes focus trap — UI becomes unselectable