claude-code - 💡(How to fix) Fix [BUG] [Windows VS CODE] Extension fails to activate - hardcoded Linux path in v2.1.136

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

2026-05-09 03:55:28.323 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished' 2026-05-09 03:55:28.745 [error] Activating extension Anthropic.claude-code failed due to an error: 2026-05-09 03:55:28.745 [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:1922:13) at Object.<anonymous> (c:\Users\hp.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579) at Module._compile (node:internal/modules/cjs/loader:1713:14) at Module._extensions..js (node:internal/modules/cjs/loader:1847:10) at Module.load (node:internal/modules/cjs/loader:1448:32) at Module._load (node:internal/modules/cjs/loader:1270:12) at c._load (node:electron/js2c/node_init:2:18041) at i._load (file:///c:/Users/hp/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589) at TracingChannel.traceSync (node:diagnostics_channel:328:14) at wrapModuleLoad (node:internal/modules/cjs/loader:244:24) at Module.require (node:internal/modules/cjs/loader:1470:12) at require (node:internal/modules/helpers:147:16)

Root Cause

The Claude Code VS Code extension (v2.1.136, win32-x64) silently fails to activate on Windows. The sidebar icon never appears and every Claude command in the Command Palette returns "command not found". The failure happens because the extension bundle contains a hardcoded Linux CI build path — file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs — that was embedded during packaging on the CI runner. When VS Code tries to activate the extension on Windows, Node.js calls Module.createRequire() with this path, immediately throws a TypeError because the path does not exist on Windows, and the entire extension fails to initialize before it can register any commands or UI elements.

Fix Action

Fix / Workaround

The Claude Code CLI running in PowerShell works perfectly fine on the same machine, which confirms this bug is isolated entirely to the VS Code extension packaging and is not an environment or credentials issue. The bug is also reproducible on a clean Windows install with no prior Claude Code history, ruling out any local configuration as the cause. No workaround currently exists for the VS Code extension — Windows users cannot use it at all on v2.1.136.

Code Example

2026-05-09 03:55:28.323 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
2026-05-09 03:55:28.745 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-05-09 03:55:28.745 [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:1922:13)
    at Object.<anonymous> (c:\Users\hp\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579)
    at Module._compile (node:internal/modules/cjs/loader:1713:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1847:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at c._load (node:electron/js2c/node_init:2:18041)
    at i._load (file:///c:/Users/hp/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The Claude Code VS Code extension (v2.1.136, win32-x64) silently fails to activate on Windows. The sidebar icon never appears and every Claude command in the Command Palette returns "command not found". The failure happens because the extension bundle contains a hardcoded Linux CI build path — file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs — that was embedded during packaging on the CI runner. When VS Code tries to activate the extension on Windows, Node.js calls Module.createRequire() with this path, immediately throws a TypeError because the path does not exist on Windows, and the entire extension fails to initialize before it can register any commands or UI elements.

What Should Happen?

The extension should activate normally on Windows, display the Claude icon in the sidebar, and make all commands available via the Command Palette. The sdk.mjs path should be resolved relative to the extension bundle root at build time — using something like __dirname or import.meta.url — rather than being hardcoded to the CI runner's absolute Linux filesystem path.

Error Messages/Logs

2026-05-09 03:55:28.323 [info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
2026-05-09 03:55:28.745 [error] Activating extension Anthropic.claude-code failed due to an error:
2026-05-09 03:55:28.745 [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:1922:13)
    at Object.<anonymous> (c:\Users\hp\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579)
    at Module._compile (node:internal/modules/cjs/loader:1713:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1847:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at c._load (node:electron/js2c/node_init:2:18041)
    at i._load (file:///c:/Users/hp/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
    at require (node:internal/modules/helpers:147:16)

Steps to Reproduce

  1. On any Windows 10 or Windows 11 64-bit machine, install VS Code from code.visualstudio.com.
  2. Open VS Code, go to Extensions (Ctrl+Shift+X), search "Claude", and install "Claude Code" by Anthropic — the installed version will be v2.1.136.
  3. Restart VS Code completely.
  4. Observe that the Claude icon never appears in the sidebar and no Claude commands are available in the Command Palette (Ctrl+Shift+P → type "claude").
  5. Confirm the error by opening the Extension Host log via Help → Toggle Developer Tools → Console or Ctrl+Shift+P → "Developer: Show Logs" → Extension Host. The TypeError with the Linux path appears immediately on startup.

Claude Model

None — extension never loads.

Is this a regression?

Yes, this worked in a previous version.

Last Working Version

2.1.133

Claude Code Version

2.1.136

Platform

Anthropic API

Operating System

Windows 11 64-bit

Terminal/Shell

PowerShell (Windows)

Additional Information

The Claude Code CLI running in PowerShell works perfectly fine on the same machine, which confirms this bug is isolated entirely to the VS Code extension packaging and is not an environment or credentials issue. The bug is also reproducible on a clean Windows install with no prior Claude Code history, ruling out any local configuration as the cause. No workaround currently exists for the VS Code extension — Windows users cannot use it at all on v2.1.136.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING