[BUG] VS Code extension activation fails on Windows - "sdk.mjs" hardcoded Linux build path

Resolved 💬 4 comments Opened Feb 24, 2026 by liu870920 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?

The VS Code extension (Anthropic.claude-code v2.1.51-win32-x64) fails to activate on Windows. The extension references a hardcoded Linux build path (file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs) that cannot be resolved on Windows, causing complete activation failure.
The CLI works perfectly in the terminal (claude --version returns 2.1.51), but the VS Code extension never registers any commands.

What Should Happen?

The extension should activate successfully and register all claude-vscode.* commands, allowing use of the Claude Code sidebar panel and related features within VS Code.

Error Messages/Logs

Error from VS Code Developer Tools Console (Ctrl+Shift+I):
Activating extension 'Anthropic.claude-code' failed: 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'.

Steps to Reproduce

Install Claude Code CLI via npm: npm install -g @anthropic-ai/claude-code (v2.1.51)
Set CLAUDE_CODE_GIT_BASH_PATH environment variable correctly
Verify CLI works: claude --version → 2.1.51 (Claude Code)
Open VS Code (v1.109.5)
Extension auto-installs to %USERPROFILE%\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64
Open Developer Tools (Ctrl+Shift+I) → Console shows activation failure
Any Claude command (e.g., Ctrl+Shift+P → "Claude Code: Focus input") returns error: command 'claude-vscode.focus' not found

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

The error message suggests the extension bundle contains a source map or module reference pointing to the CI/CD build environment path (/home/runner/work/claude-cli-internal/...), which is a Linux path from the GitHub Actions build pipeline. Windows cannot resolve this as a valid file URL, causing the activation to fail.

View original on GitHub ↗

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