#32726·Claude Code

VSCode extension: add option to prevent panel from stealing focus

Author: AshkaanCreated Mar 10, 2026Updated Sep 17, 2026
Labelsenhancementarea:ideplatform:vscode

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.