[BUG] Claude Code opens a new editor window and changes focus, instead of staying in the chat window.
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Bug: Before approving a file edit switches VS Code focus from chat panel to code editor (v2.1.100)
Extension version: 2.1.100 (win32-x64)
Previous version where this did not occur: 2.1.98
Behavior:
When approving a file edit in the Claude Code panel, VS Code switches window focus away from the chat panel to the code editor. This did not happen in v2.1.98.
What Should Happen?
Expected: Focus stays in the Claude Code panel after approving an edit.
Error Messages/Logs
Console error logged at the time of the switch:
Uncaught Error: Cannot read properties of undefined (reading 'toUrl')
TypeError: Cannot read properties of undefined (reading 'toUrl')
at Iv.toUri (index.js:22)
at Iv.asBrowserUri (index.js:22)
at iP.$loadForeignModule (index.js:36)
Steps to Reproduce
Steps to reproduce:
Open Claude Code in the VS Code panel (not terminal)
Ask Claude to make any file edit
As it asks you to approve it will open a new editor
VS Code focus switches to the code editor
Expected: Focus stays in the Claude Code panel after approving an edit.
Actual: VS Code switches focus to the edited file in the code editor.
Platform: Windows 10 Pro (10.0.19045)
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.98
Claude Code Version
2.1.100
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗