"Error loading webview provided by 'anthropic.claude-code'": fix
The full message: Error loading webview provided by 'anthropic.claude-code': Error: Could not register service worker: InvalidStateError: Failed to register a ServiceWorker: The document is in an invalid state. It comes from VS Code's webview cache, not from your Claude account, and the same message appears with other extensions' webviews too.
- Close VS Code completely (every window; on macOS use Quit, not just closing the window).
- Delete the
Service Workerfolder for your system. It contains only cached data:
These sit inside VS Code's own data folder (System Folder Windows %APPDATA%\Code\Service WorkermacOS ~/Library/Application Support/Code/Service WorkerLinux ~/.config/Code/Service Worker%APPDATA%\Code,~/Library/Application Support/Code,~/.config/Code). Using VS Code Insiders or a fork? Its data folder has its own name, so look for the sameService Workerfolder there. - Start VS Code again and open the Claude Code panel.
- Still failing? Run
Developer: Reload Window, update the extension, then try the Windows and Linux steps from GitHub reports further down.
Other fixes, in order
- Check versions. The extension needs VS Code 1.94.0 or later (Help > About). Update the Claude Code extension in the Extensions view; its version number is the Claude Code version it bundles.
- Reload the window: Command Palette (
Ctrl+Shift+P/Cmd+Shift+P) →Developer: Reload Window. - Trust the workspace. The extension doesn't work in Restricted Mode.
- Open the logs: Command Palette →
Claude Code: Show Logs, or click View output logs under an error. - Run
claudein a terminal in the same project. A failure usually reproduces there with its real error message.claude doctorchecks the installation and configuration.
Match your symptom
| You see | Fix |
|---|---|
| Panel opens but is completely blank | Update the extension to v2.1.309 or later, then reload the window. If a Claude Code couldn’t load notice appears, follow its steps in order. |
Claude Code process exited with code 1 (or another code) | The exit code alone doesn't say what failed. Open View output logs, or run claude in a terminal to see the real error. |
Claude Code did not finish starting / Subprocess initialization did not complete within 60000ms | Slow plugins, MCP servers, hooks, disk or network delayed startup. Send a message to retry, read the logs, and shorten or remove slow SessionStart/Setup hooks. Older wording ending in check authentication and network connectivity means the extension is older than v2.1.304: update it. |
Could not locate the Claude CLI on PATH (Windows, PowerShell terminal) | Open PowerShell outside VS Code and run where.exe claude. Put the install folder on PATH as a user or system environment variable, not in your PowerShell profile, then restart VS Code: it reads PATH only at startup. |
claude not found in the integrated terminal | The extension bundles a private copy for its panel and does not add claude to PATH. Install the standalone CLI; see 'claude' is not recognized. |
| No Spark icon | Open a file (the icon needs one), or click ✻ Claude Code in the Status Bar. Temporarily disable other AI extensions such as Cline or Continue. |
/ide says No available IDEs detected | Claude Code v2.1.318+ no longer installs the extension for you from the integrated terminal. Install the extension, then start claude. |
API Error: 403 Request not allowed after signing in | See Failed to authenticate / 403. |
Cmd+Esc does nothing (macOS Tahoe or later) | The system Game Overlay shortcut takes it: System Settings → Keyboard → Keyboard Shortcuts → Game Controllers, clear Game Overlay. Or rebind Claude Code: Focus input. |
If deleting the Service Worker folder didn't fix it
Anthropic's docs don't cover this error; it is reported in Claude Code GitHub issues #17822 and #24142 (both closed without an official fix). Extra workarounds that reporters say worked for them, not official steps:
- Windows (#17822): create the folder
mkdir "$env:USERPROFILE\.claude\projects", close VS Code, delete%APPDATA%\Code\Service Worker, and start VS Code again. - Linux (#24142): close VS Code and clear
~/.config/Code/Cache,CachedData,CachedExtensions,GPUCacheandUser/workspaceStorage.
Deleting workspace storage resets per-workspace VS Code state, so try the first step (update and reload) before this. On v2.1.309 or later, a panel that still won't load should be reported with a copy of Claude Code: Show Logs.
Claude Code never answers
Check your connection, start a new conversation, and run claude in a terminal for a more detailed error. On Windows, an exit with code 4294967295 right after a turn completes is closed quietly since v2.1.273; your next message resumes the conversation.
Running Claude Code, Codex or Cursor on real repos, or shipping an AI agent? A Quick Review ($149 / ₹13,900, 1 working day) checks one repo, config or setup for leaked keys, risky agent permissions and MCP servers. Request a Quick Review
FAQ
What does 'Error loading webview provided by anthropic.claude-code: could not register service worker' mean?
VS Code could not start the cached service worker that loads the extension's panel. Close VS Code completely, delete the Service Worker folder (Windows %APPDATA%\Code\Service Worker, macOS ~/Library/Application Support/Code/Service Worker, Linux ~/.config/Code/Service Worker; it holds only cached data) and start VS Code again.
Why is the Claude Code panel in VS Code blank?
Anthropic's docs say to update the extension to v2.1.309 or later and run Developer: Reload Window. If a 'Claude Code couldn't load' notice appears, follow its steps; if it still fails, report it with the output of Claude Code: Show Logs.
Does installing the VS Code extension install the claude command?
No. The extension bundles a private copy for its chat panel. To type claude in a terminal you need the standalone CLI install.
What VS Code version does Claude Code need?
VS Code 1.94.0 or later.
Does Claude Code work in Cursor or other VS Code forks?
Yes. The docs say the extension installs in VS Code forks; search for Claude Code in the editor's Extensions view or install it from the Open VSX Registry.
Related errors
- Claude Code: Failed to authenticate / 403
- MCP error -32000: Connection closed
- Claude API error 529 overloaded_error
Sources
Read 29 Nov 2026. These tools change often: if a step no longer matches, the linked page wins.
- Claude Code docs: Use Claude Code in VS Code: code.claude.com/docs/en/vs-code
- Claude Code docs: Error reference: code.claude.com/docs/en/errors
- UiPath Autopilot troubleshooting: delete the VS Code Service Worker folder (cached data only): docs.uipath.com/autopilot/other/latest/user-guide/troubleshooting-autopilot
- VS Code docs: settings file locations (the Code data folder per OS): code.visualstudio.com/docs/configure/settings
- anthropics/claude-code issue #17822 (Error loading webview): github.com/anthropics/claude-code/issues/17822
- anthropics/claude-code issue #24142 (Error loading webview): github.com/anthropics/claude-code/issues/24142
- MCP config checker: scan your mcp.json for hard-coded tokens, unpinned servers and risky access
- CLAUDE.md security check: find risky instructions in agent rules files
- 'claude' is not recognized (PATH fix): when the claude command can't be found