[BUG] Claude in VS Code on Mac swallows Cmd+H
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?
Cmd+H doesn't work properly.
Claude Code webview swallows Cmd+H because Electron webviews don't pass native shortcuts to macOS
Cmd+H works if in the editor view in VS Code
What Should Happen?
Cmd+H should hide the VS Code app
Error Messages/Logs
Steps to Reproduce
Start VS Code on Mac
Start Claude session
Press Cmd+H
Claude Model
Sonnet (default)
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
Claude Code CLI version 2.1.90. (The VS Code extension is 2.1.92.)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
I ran an exensive claude session to fix the error. Here is the chat:
No cmd+h from Claude Code. The issue is likely the Claude Code webview panel itself — when focus is inside a webview (like the Claude Code panel in your sidebar/bottom), webviews swallow native keyboard shortcuts. This is the Electron bug.
Test this: Click on a regular editor tab (not the Claude panel), then press Cmd+H. Does it work?
If yes, the fix is that Cmd+H only fails when the Claude Code webview has focus. This is a known VS Code/Electron limitation with webviews. The workaround:
Read [keybindings.json](vscode-webview://1u96oj0kg947uet413mj015irdtm79lul1pleo4u7tbjfhuuu8m1/index.html?id=d7aef584-1452-46d1-a39d-96c5c52f09ae&parentId=3&origin=724c0568-1b95-4cf0-a90e-0066e67ac3a9&swVersion=4&extensionId=Anthropic.claude-code&platform=electron&vscode-resource-base-authority=vscode-resource.vscode-cdn.net&parentOrigin=vscode-file%3A%2F%2Fvscode-app&session=e726b054-e82a-45a6-90b8-bed872fd6423#)
Can you test: click on a code file in the editor first, then try Cmd+H? I want to confirm if it's the Claude Code webview panel stealing the shortcut.
deploy-backend.sh
yes, it works in an editor tab, so claude is the culprit
That confirms it — the Claude Code webview swallows Cmd+H because Electron webviews don't pass native shortcuts to macOS.
Unfortunately there's no keybindings.json fix for this since webviews handle their own keyboard events outside VS Code's keybinding system. This is a bug in the Claude Code VS Code extension.
Workarounds:
Cmd+Escape first — moves focus back to the editor, then Cmd+H works
Cmd+TAB then H (while still holding Cmd) — bypasses Electron entirely
Click any editor tab before pressing Cmd+H
You could also report this at https://github.com/anthropics/claude-code/issues — it's a legitimate bug where the Claude Code webview should forward Cmd+H to the native macOS handler.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗