[bug] VSCode extension activation fails on Windows due to hardcoded /home/runner/ path in extension.js

Resolved 💬 3 comments Opened May 6, 2026 by mustardseed184-sketch Closed May 8, 2026

Summary

anthropic.claude-code VSCode extension fails to activate on Windows under the onStartupFinished and editor-button activation paths because extension.js contains the build-time GitHub Actions runner path file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs. Node's fileURLToPath rejects this URL on Windows (no drive letter / UNC), so activation throws and registerCommand never runs — every command reports "command not found" to the user.

Affected versions

  • 2.1.129 (win32-x64) — confirmed
  • 2.1.131 (win32-x64) — confirmed (same bundled string)
  • Likely all recent builds.

VSCode: 1.118.1, Windows 11.

Repro

  1. Install anthropic.claude-code on Windows VSCode (1.94+).
  2. Reload window.
  3. Click the "Open Last Conversation" icon in editor title bar (or invoke claude-vscode.editor.openLast from palette).
  4. Observe error toast: command 'claude-vscode.editor.openLast' not found.
  5. ~/AppData/Roaming/Code/logs/<timestamp>/window1/exthost/exthost.log shows:

``
Activating extension Anthropic.claude-code failed due to an error:
TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string.
Received 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs'
at extension.js:102:5407
``

Two occurrences in the bundled extension.js:

  • Ai.createRequire("file:///home/runner/.../sdk.mjs")
  • Ji.fileURLToPath("file:///home/runner/.../sdk.mjs") followed by Qi.createRequire(...) for pathToClaudeCodeExecutable resolution.

Workaround (local)

Replace both occurrences of the hardcoded URL in extension.js with a valid Windows file URL pointing to the extension itself, e.g.:

file:///c:/Users/<user>/.vscode/extensions/anthropic.claude-code-<version>-win32-x64/extension.js

After Reload Window, activation succeeds and all commands register.

Suggested fix

At bundle/build time, use import.meta.url resolution or a runtime-relative path (e.g. pathToFileURL(__filename)) instead of inlining the build-host's absolute file URL. The current createRequire(<inlined-runner-path>) and fileURLToPath(<inlined-runner-path>) calls will never work on any non-Linux machine and only work coincidentally on Linux when /home/runner/work/... happens to exist (CI environments).

Notes

  • Webview activation (onWebviewPanel:claudeVSCodePanel) seems to bypass the broken code path, which is why the chat panel works while editor/title commands don't.
  • The bug surfaces only when the extension is cold-activated via onStartupFinished or a command that triggers the broken require path.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗