[BUG] Extension v2.1.136 fails to activate on Windows — createRequire called with hardcoded Linux build-runner path
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?
The Claude Code VS Code extension v2.1.136 (anthropic.claude-code-2.1.136-win32-x64) fails to activate on Windows. Clicking the Claude icon in the editor title bar shows a toast:
command 'claude-vscode.editor.openLast' not found
The Extension Host log shows that activation throws TypeError from Module.createRequire because extension.js contains a hardcoded Linux CI build path as the argument:
file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs
That literal appears in two call sites in the bundled extension.js (one direct createRequire, one fileURLToPath followed by createRequire). On Windows, Node rejects a file:// URL that has no drive letter and the entire extension module fails to load, so no commands are ever registered — hence the "command not found" toast.
No sdk.mjs is shipped inside the extension package at all. Contents of the installed extension dir are: extension.js, package.json, README.md, claude-code-settings.schema.json, .vsixmanifest, resources/native-binary/claude.exe, and a few logo SVG/PNGs. The hardcoded path is a build-time leak from import.meta.url that the bundler never rewrote.
This is a regression of #28076 (closed, originally filed for v2.1.51). The fix has been undone or bypassed in v2.1.136.
What Should Happen?
The extension should activate cleanly on Windows, register its commands, and clicking the Claude icon in the editor title bar should open the Claude Code panel.
Error Messages/Logs
From `View → Output → Extension Host` immediately after `Developer: Reload Window`:
2026-05-08 13:36:23.300 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
2026-05-08 13:36:23.478 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-05-08 13:36:23.478 [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 Module.createRequire (node:internal/modules/cjs/loader:1922:13)
at Object.<anonymous> (c:\Users\<user>\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579)
at Module._compile (node:internal/modules/cjs/loader:1713:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1847:10)
at Module.load (node:internal/modules/cjs/loader:1448:32)
at Module._load (node:internal/modules/cjs/loader:1270:12)
at c._load (node:electron/js2c/node_init:2:18041)
at i._load (file:///d:/Users/<user>/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589)
... (truncated)
The same literal `file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs` appears at two locations inside the bundled `extension.js` — one direct `createRequire` call, and one `fileURLToPath(...)` whose result is then passed to `createRequire(...)` and used to `require.resolve("./cli.js")`.
Steps to Reproduce
- On Windows 11 (x64), install Claude Code from the VS Code Marketplace into stable VS Code (not Insiders). Confirm the extension folder is
%USERPROFILE%\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64. - Reload the window:
Ctrl+Shift+P→ Developer: Reload Window. - Open
View → Output, select the Extension Host channel. Observe theTypeErrorstack above immediately after the activation log line. - Click the Claude icon in the editor title bar (top-right, next to the split-editor icon). Observe toast:
command 'claude-vscode.editor.openLast' not found.
Confirmed by inspecting the bundled file:
Select-String -Path "$env:USERPROFILE\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js" `
-Pattern 'home/runner/work/claude-cli-internal' -SimpleMatch | Measure-Object
# Count : 2
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Unknown; #28076 was filed against 2.1.51 and is closed, so the fix was present at some point between 2.1.51 and 2.1.136 and has since been reverted/regressed.
Claude Code Version
2.1.136 (VS Code extension, anthropic.claude-code-2.1.136-win32-x64)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
Diagnostic notes:
- This is a regression of #28076 (originally filed against v2.1.51, now closed).
- Both call sites of the hardcoded path are in the bundled
extension.js— the bundler is inliningimport.meta.urlas a literal but never rewriting it for the published artifact. - No
sdk.mjsships in the extension package at all, so even if the URL parsed correctly on Windows, the subsequentrequire.resolve("./cli.js")against that base would fail. - The actual native CLI is shipped at
resources/native-binary/claude.exeinside the extension; suggest using a runtime-resolved path (__dirname/import.meta.urlfrom the actual loaded module) instead of a build-time literal. - Linux/macOS likely don't reproduce this because POSIX accepts
/home/runner/...as a syntactically valid absolute path; Windows rejects it because there's no drive letter.
Environment: Windows 11 Home 24H2, VS Code stable 1.119, no claude CLI on PATH (extension is meant to use its own bundled binary).
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗