[BUG] Windows: clicking Claude icon gives "command 'claude-vscode.editor.openLast' not found" - reinstalling VS Code and extension doesn't fix it
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: latest
- Claude Code CLI version: 2.1.51
Bug Description:
Clicking the Claude icon in the VS Code activity bar gives error: command 'claude-vscode.editor.openLast' not found. The extension shows "Activating..." forever and never loads.
Root Cause Found:
In Developer Tools console, this error appears:Activating extension 'Anthropic.claude-code' failed: 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'
The extension has a hardcoded Linux path (/home/runner/work/...) baked into it which doesn't resolve on Windows.
Steps to Reproduce:
- Install Claude Code CLI on Windows
- Open VS Code
- Click the Claude icon in the activity bar
Expected: Claude Code panel opens
Actual: Error: command 'claude-vscode.editor.openLast' not found
Note: CLI works fine in terminal (claude command works). Only the visual panel is broken.
What Should Happen?
Clicking the Claude icon in the VS Code activity bar should open the Claude Code visual panel successfully without any errors.
Error Messages/Logs
Steps to Reproduce
- Install Claude Code CLI on Windows: npm install -g @anthropic-ai/claude-code
- Open VS Code
- Run "claude" in VS Code terminal (auto-installs the extension)
- Click the Claude icon in the VS Code activity bar (top left)
- Error appears: "command 'claude-vscode.editor.openLast' not found"
- Open Developer Tools (Ctrl+Shift+P → "Developer: Toggle Developer Tools")
- Check Console tab — shows the real error: extension activation failed due to hardcoded Linux path
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.51 (Claude Code)
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
The root cause is a hardcoded Linux path in the extension package:
file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs
This path does not exist on Windows, causing the extension to fail activation entirely.
Workaround: Claude CLI works fine in the terminal ("claude" command). Only the visual panel is broken.
Tried to fix by:
<img width="1433" height="942" alt="Image" src="https://github.com/user-attachments/assets/385a3ec5-65de-4221-91cc-3c0833d5abe8" />
- Uninstalling and reinstalling Claude Code CLI
- Uninstalling and reinstalling VS Code completely (including deleting all AppData folders)
- Updating Claude Code CLI to latest version (2.1.51)
- Nothing worked — this appears to be a packaging bug on Anthropic's side
This issue has 15 comments on GitHub. Read the full discussion on GitHub ↗