Shipping an AI app or agent? Security review in 1 working day: $149 / ₹13,900. Request a review →
AI Review Ready
Home / Error fixes / Not working in VS Code
Fix · Claude Code · VS Code

Claude Code not working in VS Code: "Error loading webview" and the other fixes

"Error loading webview provided by 'anthropic.claude-code': Could not register service worker": fully close VS Code, delete its Service Worker cache folder (paths below), and start VS Code again. Other failures come from an old VS Code or extension version, Restricted Mode, or the Claude Code process failing to start; the logs show which.

"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.

  1. Close VS Code completely (every window; on macOS use Quit, not just closing the window).
  2. Delete the Service Worker folder for your system. It contains only cached data:
    SystemFolder
    Windows%APPDATA%\Code\Service Worker
    macOS~/Library/Application Support/Code/Service Worker
    Linux~/.config/Code/Service Worker
    These sit inside VS Code's own data folder (%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 same Service Worker folder there.
  3. Start VS Code again and open the Claude Code panel.
  4. 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

  1. 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.
  2. Reload the window: Command Palette (Ctrl+Shift+P / Cmd+Shift+P) → Developer: Reload Window.
  3. Trust the workspace. The extension doesn't work in Restricted Mode.
  4. Open the logs: Command Palette → Claude Code: Show Logs, or click View output logs under an error.
  5. Run claude in a terminal in the same project. A failure usually reproduces there with its real error message. claude doctor checks the installation and configuration.

Match your symptom

You seeFix
Panel opens but is completely blankUpdate 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 60000msSlow 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 terminalThe 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 iconOpen 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 detectedClaude 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 inSee 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, GPUCache and User/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

Sources

Read 29 Nov 2026. These tools change often: if a step no longer matches, the linked page wins.

Related free tools