[Bug] VS Code extension v2.1.51 fails to activate on Windows — hardcoded Linux CI path in extension.js
Bug Report
Extension version: 2.1.51 (win32-x64)
VS Code version: 1.109.4
Platform: Windows Server 2022 (x64)
Node.js: bundled with VS Code
Description
The Claude Code VS Code extension v2.1.51 fails to activate on Windows with the following error. The extension was working correctly on v2.1.49.
Error Message
2026-02-24 08:40:53.493 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-02-24 08:40:53.493 [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 Object.<anonymous> (c:\Users\Administrator\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)
Root Cause Analysis
The error occurs in extension.js line 45, position 4602. The extension bundle contains a hardcoded Linux CI path (file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs) that was embedded during the build process on GitHub Actions runner (/home/runner/work/...).
On Windows, this path is invalid because:
- It is a Linux absolute path that does not exist on the host machine
- The
file://URL points to the CI build agent's filesystem, not the installed extension directory - Node.js
require()/ module resolution throwsTypeErrorfor this non-existent path
This appears to be a build packaging regression in v2.1.51 where the sdk.mjs path is not resolved relative to __dirname or import.meta.url at runtime, but instead was accidentally inlined as the CI build machine's absolute path.
Steps to Reproduce
- Install Claude Code extension v2.1.51 on Windows
- Open VS Code
- Click on the Claude Code sidebar icon
- Extension fails to activate
Expected Behavior
Extension activates successfully (as it did in v2.1.49).
Actual Behavior
Extension fails to activate. Sidebar shows no content. Error visible in:Help → Toggle Developer Tools → Console or in VS Code Output panel (Extension Host log).
Workaround
Rollback to v2.1.49:
code --install-extension anthropic.claude-code@2.1.49 --force
Or manually install the 2.1.49 VSIX from the Marketplace.
Log Evidence
Log path: %APPDATA%\Code\logs\<session>\window1\exthost\exthost.log
2026-02-24 08:40:53.398 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onView:claudeVSCodeSidebarSecondary'
2026-02-24 08:40:53.493 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-02-24 08:40:53.493 [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 Object.<anonymous> (c:\Users\Administrator\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)
Environment
| Field | Value |
|-------|-------|
| Extension version | 2.1.51 (fails), 2.1.49 (works) |
| VS Code | 1.109.4 |
| OS | Windows Server 2022 Standard 10.0.20348 x64 |
| Architecture | x64 |
| Working version | 2.1.49 |
Severity
High — Extension completely non-functional on Windows for users who auto-updated to 2.1.51. Blocks all Claude Code functionality in VS Code.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗