VS Code: file opens steal focus, wrong column, and pile up
Problem
When using Claude Code in VS Code editor tabs (not panel), file operations cause three UX issues:
1. File opens steal focus from Claude tab
When Claude reads or edits a file, VS Code focuses the file tab. This pulls focus away from the Claude conversation, requiring the user to tab back to approve the next tool call. Every Read/Edit/Write operation interrupts the flow.
Expected: Files open with preserveFocus: true so the user stays in the Claude conversation.
2. Files open in wrong editor column
With multiple editor columns (e.g. Claude tabs in one column, code in another), files opened by Claude appear in a random column instead of adjacent to or in the same group as the Claude tab.
Expected: Files open in the same editor group as the active Claude tab, or in an adjacent column — not a random one.
3. Files accumulate after Claude is done with them
Claude may read 10+ files during a task. These all remain open as tabs, cluttering the editor. There's no way to auto-close files that Claude opened for read-only access once the tool call completes.
Expected: Either auto-close read-only file tabs when the tool call completes, or provide a command like "Claude: Close All Opened Files" to clean up.
Environment
- VS Code (not Insiders)
- Extension:
anthropic.claude-code claudeCode.preferredLocation:"editor"(tabs, not panel)- macOS
Suggested Implementation
- Pass
preserveFocus: trueinvscode.window.showTextDocument()calls - Use
ViewColumn.Activeor resolve the Claude tab's group and open in the same group - Track files opened by Claude during a tool call; close them on completion (configurable via setting like
claudeCode.autoCloseReadFiles)
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗