[BUG] VSCode extension steals focus on workspace load
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?
When the VSCode workspace loads (either at startup or when switching project or reloading manually), the prompt input steals focus immediately. While this is desired if I were opening the Claude Code sidebar myself, it is not desired when the entire workspace is loading.
In my case, I hop between projects quite often, and often reach for keyboard shortcuts to immediately start looking for something. On many occasions, I find myself typing into project search, only to find half the word cut off and now I'm typing into the prompt. Sometimes I land up submitting that to Claude, and it naturally gets confused…
What Should Happen?
The UI should only take focus when starting a new session or when opening it directly (not on workspace load).
Error Messages/Logs
N/A
Steps to Reproduce
- Open VSCode
- Open Claude Code
- Reload the workspace or restart VSCode or switch projects
- Immediately invoke project search with the keyboard and type.
If you're quick enough, you'll find yourself typing into two input controls, one after the other. 🙃
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.49 (CLI); 2.1.59 (VSC Extension)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
_No response_
9 Comments
This is actually quite annoying. It seems to take focus TWICE during load.
I hate to be that guy, but persisting in 2.1.85. I see lots of little UI improvements, and a fix for this would complement them.
Confirming this also happens on Windows 11 (10.0.26100). On every VS Code launch / workspace load, the Claude Code panel steals focus from the console. A little disruptive to workflow, I've spammed "it status" and similar.
Closing for now — inactive for too long. Please open a new issue if this is still relevant.
Can confirm. Happening with me too on MacOS Tahoe 26.5
Super annoying!
@mikerockett Did you find a workaround for this?
@ansh-les Nope, moved to Zed.
@mikerockett I tried zed, just couldn't get used to it. Too much muscle memory for vscode.
I found a workaround for this on vscode.
Add this to your user settings.json
Keeps the secondary sidebar hidden on launch. No claude = no focus stealing :))
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.