[BUG] VS code latest extension bug
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.51 (win32-x64) fails to activate on Windows with a TypeError related to createRequire. The error references a Linux build server path (/home/runner/work/claude-cli-internal/...) that is invalid on Windows.
Downgrading to v2.1.42 resolves the issue, confirming this is a build/packaging bug introduced in v2.1.51.
Error Log
2026-02-24 13:38:57.206 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
2026-02-24 13:38:57.257 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-02-24 13:38:57.257 [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:1915:13)
at Object.<anonymous> (c:\Users\kkche\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)
at Module._compile (node:internal/modules/cjs/loader:1714:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1848:10)
at Module.load (node:internal/modules/cjs/loader:1448:32)
at Module._load (node:internal/modules/cjs/loader:1270:12)
Symptoms
Extension shows "Activating..." indefinitely in Running Extensions list
command 'claude-vscode.editor.openLast' not found error appears
No "Claude Code" entry appears in the OUTPUT panel dropdown
The extension was previously disabled globally (possibly due to repeated activation failures)
Steps to Reproduce
Install Claude Code for VS Code extension v2.1.51 on Windows
Open any folder/workspace
Extension fails to activate with the above error
Workaround
Downgrade to v2.1.42 via: Extensions → Claude Code → Uninstall dropdown (▼) → "Install Another Version..." → Select 2.1.42. Disable Auto Update to prevent re-upgrading.
Root Cause Analysis
The extension.js file in the win32-x64 package contains a hardcoded Linux path (file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs) from the CI/CD build environment. Module.createRequire() on Windows rejects this path because it is not a valid Windows file URL or absolute path.
Environment
OS: Windows 11
VS Code: Latest
Extension: anthropic.claude-code-2.1.51-win32-x64
Claude Code CLI: 2.1.51
Working version: 2.1.42
What Should Happen?
Down grade to previous version is a solution
Error Messages/Logs
2026-02-24 13:38:57.257 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-02-24 13:38:57.257 [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:1915:13)
at Object.<anonymous> (c:\Users\kkche\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)
at Module._compile (node:internal/modules/cjs/loader:1714:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1848: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:17993)
at e._load (file:///c:/Program%20Files/Microsoft%20VS%20Code/072586267e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:405:6055)
at t._load (file:///c:/Program%20Files/Microsoft%20VS%20Code/072586267e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:223:22773)
at s._load (file:///c:/Program%20Files/Microsoft%20VS%20Code/072586267e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:215:24706)
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)
at require (node:internal/modules/helpers:147:16)
at pee.Cb (file:///c:/Program%20Files/Microsoft%20VS%20Code/072586267e/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:254:1256)
Steps to Reproduce
Down grade to previous version is a solution
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.49
Claude Code Version
Claude Code v2.1.51
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗