VS Code extension v2.1.136 fails to activate on Windows — createRequire regression returns (hardcoded /home/runner/work/... 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 fails to activate on Windows. The extension is stuck on "Activating..." indefinitely in the Extensions panel, and every command it registers fails — for example, the Command Palette shows command 'claude-vscode.editor.openLast' not found.
The Extension Host log shows that during activation the extension calls Module.createRequire with a hardcoded Linux CI path baked into the published Windows bundle:
file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs
Windows correctly rejects this as not a valid filename, so activation aborts.
This is a recurrence of a bug that has already been fixed three times:
- #28081 (v2.1.51)
- #28397 (v2.1.53)
- #28416 (v2.1.55)
The same /home/runner/work/... GitHub Actions runner path is leaking into the published extension.js again in v2.1.136.
What Should Happen?
The extension should activate successfully on Windows, register its commands, and be usable. The published win32-x64 bundle must not contain hardcoded /home/runner/work/... paths from the GitHub Actions build environment — those paths should be resolved to the local extension install directory at runtime (or bundled as a relative reference).
Error Messages/Logs
[info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
[error] Activating extension Anthropic.claude-code failed due to an error:
[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\Emerick\.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:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589)
at n._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:652:28855)
at TracingChannel.traceSync (node:diagnostics_channel:328:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
at Module.require (node:internal/modules/cjs/loader:1470:12)
Steps to Reproduce
- On Windows 10/11, install the
Anthropic.claude-codeextension v2.1.136 from the VS Code Marketplace. - Reload the VS Code window: Ctrl+Shift+P → "Developer: Reload Window".
- Observe the Extensions panel: "Claude Code" stays in the "Activating..." state indefinitely.
- Open Command Palette and run any Claude Code command (e.g. "Claude Code: Open Last") — it fails with
command 'claude-vscode.editor.openLast' not found. - Open Output panel → "Log (Extension Host)" to see the activation TypeError above.
Workaround that confirms the cause: roll back to v2.1.131 via Extensions → "Install Another Version", then disable auto-update on the extension. Activation succeeds and commands work.
Claude Model
Other
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.131
Claude Code Version
The bug is in the VS Code extension (v2.1.136), but include the CLI version for completeness; note this in the Additional Information field.
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
This bug is in the VS Code extension v2.1.136 (anthropic.claude-code-2.1.136-win32-x64), not the claude CLI itself. The CLI runs fine.
This is the fourth recurrence of the same createRequire / /home/runner/work/... packaging issue (previously: #28081, #28397, #28416). A pre-publish guard in CI that greps the packaged extension.js for any /home/runner/, /build-agent-sdk/, or claude-cli-internal literal would catch the regression before release. A smoke-test that loads the packaged win32 bundle during the release pipeline would be even better.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗