[BUG] VS Code extension v2.1.51 fails to activate on Windows — hardcoded CI build path in createRequire`

Resolved 💬 3 comments Opened Feb 24, 2026 by myeewyee 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 Claude Code VS Code extension (v2.1.51, win32-x64) fails to activate on Windows. The extension host log shows:

[error] Activating extension Anthropic.claude-code failed due to an error:
[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\myles\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)

The bundled extension.js contains a hardcoded path from the CI build environment (file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs). This path is passed to Module.createRequire(), which fails on Windows because it's not a valid Windows path (no drive letter).

Because the extension crashes on activation, no commands are registered, no Output channel is created, and VS Code shows command 'claude-vscode.editor.openLast' not found.

What Should Happen?

The extension should activate normally. The createRequire call should use a runtime-relative path (e.g., __filename or __dirname) instead of a hardcoded CI build path.

Error Messages/Logs

Steps to Reproduce

  1. Install Claude Code VS Code extension v2.1.51 on Windows
  2. Open any workspace
  3. Extension fails to activate — no Claude Code Output channel appears
  4. Attempting any Claude command shows "command 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.47 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

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