VS Code extension fails to activate on Windows - hardcoded Linux path in extension bundle
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?
OS: Windows
Extension version: 2.1.51
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'
Extension fails to activate on Windows due to a hardcoded Linux path in extension.js.
Command 'claude-vscode.editor.openLast' not found as a result.
What Should Happen?
The Claude Code extension should activate successfully on Windows and the claude-vscode.editor.openLast command should be registered and functional after clicking the Claude icon in the VS Code sidebar.
Error Messages/Logs
Steps to Reproduce
- Install VS Code on Windows (any recent version)
- Install the Claude Code extension (v2.1.51) from the VS Code marketplace
- Ensure Claude Code CLI is installed and working (
claude --versionreturns 2.1.51) - Open any project folder in VS Code
- Click the Claude icon in the VS Code sidebar (or run any claude-vscode command)
Result: Command 'claude-vscode.editor.openLast' not found error appears.
To confirm the root cause:
- Open VS Code logs via Help → Toggle Developer Tools → Console, or
- Command Palette → "Developer: Show Logs" → "Extension Host"
- You will see:
Activating extension Anthropic.claude-code failed due to an 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'
Environment:
- OS: Windows 10/11
- VS Code version: (your version)
- Claude Code extension: 2.1.51
- Claude Code CLI: 2.1.51
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.51
Platform
Other
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 ↗