[BUG] VS Code extension v2.1.51 fails to activate on Windows — TypeError: invalid 'filename' argument referencing CI build path (sdk.mjs)

Resolved 💬 3 comments Opened Feb 24, 2026 by trohit920 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 for VS Code extension v2.1.51 (released Feb 24, 2026) fails to activate on Windows. The extension shows "Activating..." in the Running Extensions list but never completes, and all commands (e.g., claude-vscode.sidebar.open, claude-vscode.editor.openLast) return "command not found".

The Extension Host log reveals the root cause — a TypeError where the filename argument contains a CI build path (file://home/runner/work/claude-cli-internal/...) instead of a valid local path:

What Should Happen?

The extension should activate successfully and register all commands (claude-vscode.sidebar.open, claude-vscode.editor.openLast, etc.), allowing the Claude Code UI to open in the sidebar or editor panel.

Error Messages/Logs

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

Key observations:

- The path `file://home/runner/work/claude-cli-internal/...` is a Linux CI/CD runner path (likely GitHub Actions), not a valid Windows path
- The `file://` URL is also malformed — it's missing the third slash (should be `file:///` for an absolute path)
- This suggests a build artifact was shipped with a hardcoded CI path instead of a relative or runtime-resolved path
- The Claude Code CLI (v2.1.51) works perfectly in the terminal — only the VS Code extension UI is broken
- Previous versions of the extension did not have this issue

Steps to Reproduce

  1. Install VS Code v1.109.5 on Windows 10/11
  2. Install Claude Code CLI v2.1.51 via npm install -g @anthropic-ai/claude-code
  3. Authenticate via claude in terminal (OAuth login succeeds)
  4. Install "Claude Code for VS Code" extension v2.1.51 from the VS Code Marketplace
  5. Restart VS Code
  6. Open Command Palette (Ctrl+Shift+P) and run "Claude Code: Open in Side Bar"
  7. Observe error: command 'claude-vscode.sidebar.open' not found
  8. Open Command Palette → "Developer: Show Running Extensions"
  9. Observe "Claude Code for VS Code 2.1.51" stuck at "Activating..."
  10. Check Output → Extension Host log — see TypeError with CI build path

Environment

  • Claude Code CLI version: 2.1.51
  • VS Code version: 1.109.5 (user setup)
  • Extension version: 2.1.51 (anthropic.claude-code-2.1.51-win32-x64)
  • OS: Windows 10 x64 (NT 10.0.26100)
  • Node.js: v24.13.1
  • Electron: 39.3.0

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.45

Claude Code Version

2.1.51 (Claude Code)

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

  • The Claude Code CLI works perfectly in the VS Code integrated terminal (claude command runs fine)
  • The error path file://home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs appears to be a GitHub Actions runner path leaked into the shipped extension bundle
  • The file URL is malformed: file://home/runner/... should be file:///home/runner/... (three slashes for absolute paths)
  • This is likely a regression in the build/packaging pipeline for v2.1.51
  • Clean reinstall (uninstall extension, delete extension folder, reinstall) does not fix the issue

Full Extension Host error stack trace:

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\neo78.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)

<img width="1400" height="862" alt="Image" src="https://github.com/user-attachments/assets/d9d4decf-fbfd-463b-b84b-31eda1fa24af" />

at c_load (node:electron/js2c/node_init:2:17993)

View original on GitHub ↗

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