[BUG] [Windows] Extension fails to activate - hardcoded Linux path causes TypeError
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?
Environment:
- OS: Windows 11
- VS Code Version: (your version)
- Claude Code Extension Version: 2.1.51
- Claude CLI Version: 2.1.51
Problem:
The Claude Code VS Code extension fails to activate on Windows.
All commands (claude-vscode.terminal.open, claude-vscode.sidebar.open, etc.)
are not found because the extension never activates.
Error from Extension Host Log:
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\..\.vscode\extensions\anthropic.claude-code-2.1.51-win32-x64\extension.js:45:4602)
Root Cause:
The extension contains a hardcoded Linux path
(/home/runner/work/...) inside the Windows build (win32-x64).
This causes activation to fail completely on Windows.
Impact:
- Sidebar does not open
- Terminal command not found
- No Claude commands available in Command Palette
- CLI works fine (claude --version shows 2.1.51)
Steps to Reproduce:
- Install anthropic.claude-code on Windows
- Open VS Code
- Try Ctrl+Shift+P → "Claude: Open in Terminal"
- Error: command 'claude-vscode.terminal.open' not found
What Should Happen?
The Claude Code VS Code extension should activate successfully on Windows
and register all commands properly, including:
- claude-vscode.terminal.open
- claude-vscode.sidebar.open
- claude-vscode.editor.openLast
The extension should use platform-independent or Windows-compatible
paths instead of hardcoded Linux paths
(/home/runner/work/...) in the Windows (win32-x64) build.
After activation, the Claude sidebar should open in VS Code and
all commands should be available in the Command Palette (Ctrl+Shift+P).
Error Messages/Logs
Extension Host Log:
2026-02-24 11:44:18.806 [info] ExtensionService#_doActivateExtension
Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
2026-02-24 11:44:18.879 [error] Activating extension Anthropic.claude-code
failed due to an error:
2026-02-24 11:44:18.880 [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\Foysol\.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 Object.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)
at Module.c._load (node:electron/js2c/node_init:2:17993)
VS Code Command Palette Error:
"Command 'Claude Code: Open in Terminal' resulted in an error"
"command 'claude-vscode.terminal.open' not found"
"Command 'Claude Code: Open in Side Bar' resulted in an error"
"command 'claude-vscode.sidebar.open' not found"
"Command 'Claude Code: Open Last' resulted in an error"
"command 'claude-vscode.editor.openLast' not found"
Note: Claude CLI works fine in terminal (claude --version = 2.1.51)
The issue is only with the VS Code extension activation on Windows.
Steps to Reproduce
- Install Claude Code CLI on Windows:
Run: irm https://claude.ai/install.ps1 | iex
Result: Claude Code v2.1.51 installed successfully
- Add CLI to Windows PATH:
C:\Users\Foysol\.local\bin
- Verify CLI works:
Run: claude --version
Result: 2.1.51 (Claude Code) ✓
- Install VS Code extension:
Run: code --install-extension anthropic.claude-code
Result: Extension 'anthropic.claude-code' v2.1.51 successfully installed ✓
- Fully close and reopen VS Code
- Open Command Palette (Ctrl+Shift+P)
- Search and run: "Claude Code: Open in Terminal"
Result: Error - command 'claude-vscode.terminal.open' not found ✗
- Search and run: "Claude Code: Open in Side Bar"
Result: Error - command 'claude-vscode.sidebar.open' not found ✗
- Check Extension Host Log (Developer: Show Logs → Extension Host)
Result: TypeError with hardcoded Linux path found ✗
Tried uninstalling and reinstalling extension multiple times.
Same error persists every time.
OS: Windows 11
VS Code: latest
Extension: anthropic.claude-code v2.1.51 (win32-x64)
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
Claude Code v2.1.51
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
VS Code integrated terminal
Additional Information
_No response_
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗