VSCode extension: add option to prevent panel from stealing focus

Open 💬 10 comments Opened Mar 10, 2026 by Ashkaan

Problem

When using Claude Code as a VSCode extension, the panel auto-reveals and steals focus whenever it produces output. This interrupts workflow in other editor tabs — for example, if I'm typing in a file and Claude finishes a response, focus jumps to the Claude panel.

Expected behavior

The extension should have an option to not steal focus when producing output. The user should be able to check Claude's output on their own terms.

Suggested solution

Add a preserveFocus setting (e.g., claude-code.preserveFocus: true) that prevents the extension panel from auto-revealing or grabbing focus when new output arrives. VSCode's WebviewPanel API supports preserveFocus natively, so this should be straightforward to wire up.

Workarounds

Currently the only workarounds are:

  • Running Claude in terminal mode (claude-code.useTerminal: true)
  • Running claude directly in the integrated terminal

Neither gives the full panel experience without the focus interruption.

View original on GitHub ↗

This issue has 10 comments on GitHub. Read the full discussion on GitHub ↗