[BUG] The build 2.1.51 has a hardcoded Linux path (file:///home/runner/work/claude-cli-internal/...) baked into extension.js that crashes createRequire on Windows.
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 build has a hardcoded Linux path (file:///home/runner/work/claude-cli-internal/...) baked into extension.js that crashes createRequire on Windows.
What Should Happen?
The Claude Code VS Code extension (v2.1.51, win32-x64) should activate successfully on Windows. Instead, it fails with:
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'
The extension's extension.js (line 45) contains a hardcoded Linux CI build path that causes Module.createRequire to fail on Windows. The path file:///home/runner/work/... is a GitHub Actions runner path baked into the build artifact, which is invalid on Windows.
Expected: The extension should activate normally and register all commands including claude-vscode.editor.openLast.
Additional context:
OS: Windows 11
VS Code version: (add yours)
Extension version: 2.1.51 (win32-x64)
CLI version: 2.1.51
The vsix file is also missing from the npm package's vendor/ directory
/ide command throws onInstall is not defined
Clean reinstall from marketplace installs the same broken version
Error Messages/Logs
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'
2026-02-24 09:28:18.577 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onWalkthrough:claude-code-walkthrough'
2026-02-24 09:28:18.728 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-02-24 09:28:18.728 [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\Onkar\.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)
Steps to Reproduce
Steps to reproduce:
Install Claude Code CLI via npm on Windows:
npm install -g @anthropic-ai/claude-code@latest
CLI version installed: 2.1.51
Install the VS Code extension:
code --install-extension anthropic.claude-code
Extension version installed: 2.1.51 (win32-x64)
Open VS Code and observe:
Extension shows as "Activating" indefinitely in Developer: Show Running Extensions
No "Claude Code" output channel appears in Output panel
Command claude-vscode.editor.openLast not found in Command Palette
Check Extension Host log (Output → Extension Host):
Extension activation fails with createRequire TypeError referencing Linux CI path
Additional reproduction:
Run claude /ide in terminal → crashes with onInstall is not defined
Check %APPDATA%\npm\node_modules\@anthropic-ai\claude-code\vendor\ → claude-code.vsix file is completely missing, only ripgrep/ folder exists
Uninstalling and reinstalling both CLI and extension reproduces the same error
Environment:
OS: Windows 11
VS Code: (add your version — check Help → About)
Node.js: (add output of node --version)
Claude Code CLI: 2.1.51
Extension: anthropic.claude-code-2.1.51-win32-x64
Claude Model
Opus
Is this a regression?
Yes, this worked in a previous version
Last Working Version
2.1.50
Claude Code Version
2.1.51
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗