[BUG] [Bug] Extension fails to activate on Windows v2.1.51 - hardcoded Linux path in sdk.mjs causes TypeError

Resolved 💬 4 comments Opened Feb 24, 2026 by ZZI82 Closed Feb 24, 2026

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?

When opening VS Code with the Claude Code extension installed (v2.1.51 on Windows),
the following error appears immediately in the UI:

command 'claude-vscode.editor.openLast' not found

The extension fails to activate on startup, causing all Claude Code commands to be
unregistered. Checking the VS Code Output panel (Ctrl+Shift+U → "Claude Code")
reveals the root cause — a hardcoded Linux build path inside the extension bundle
that cannot be resolved on Windows:

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:1971:13)
at Object.<anonymous> (...\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)

Because the extension crashes during activation, no commands are registered,
which is why 'claude-vscode.editor.openLast' and all other Claude Code commands
are not found.

What Should Happen?

The extension should activate successfully on Windows without any path resolution errors. The sdk.mjs module should be referenced using a relative or platform-agnostic path rather than a hardcoded Linux build server path.

Error Messages/Logs

Steps to Reproduce

  1. Use a Windows machine (Windows 10/11 or Windows Server)
  2. Install VS Code (latest version)
  3. Install Claude Code extension v2.1.51 from the VS Code Marketplace
  4. Open VS Code and open any project folder
  5. Open Output panel (Ctrl+Shift+U) and select "Claude Code" from the dropdown
  6. Observe the activation error:

"Activating extension Anthropic.claude-code failed due to an error"

  1. Try to run any Claude Code command via Ctrl+Shift+P — all commands return "command not found"

Note: The CLI works fine (running claude in CMD works normally). This is purely a VS Code extension activation issue caused by a hardcoded Linux path inside extension.js.

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

_No response_

Claude Code Version

2.1.51

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

Windows Terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗