Claude Desktop Installer Hijacks Claude Code CLI Command
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?
Bug Report: Claude Desktop Installer Hijacks Claude Code CLI Command
Date: 2025-02-11
Reporter: Asdrubal Mendes
Platform: Windows 11
Claude Desktop Version: Latest (installed 2025-02-11, includes Cowork for Windows)
Claude Code CLI: Installed via npm (@anthropic-ai/claude-code)
---
Summary
The latest Claude Desktop installer (which now bundles Cowork for Windows) registers Claude.exe in the WindowsApps directory. This alias takes PATH priority over a pre-existing Claude Code CLI installation via npm, effectively hijacking the claude command. All CLI operations (claude --version, claude update, etc.) silently launch the Desktop App instead.
Steps to Reproduce
- Have Claude Code CLI installed via npm (
npm install -g @anthropic-ai/claude-code) and working correctly (claude --versionreturns CLI version). - Install or update the latest Claude Desktop App (version with Cowork for Windows support).
- Open a new terminal (PowerShell or CMD).
- Run
claude --version.
Expected Behavior
claude --version should return the Claude Code CLI version, as it did before the Desktop App update.
Actual Behavior
Running claude --version launches the Claude Desktop App GUI. The terminal shows:
(node:31028) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `claude --trace-deprecation ...` to show where the warning was created)
Additionally, the Desktop App spawns multiple processes (10+ observed), and disk cache errors appear:
[ERROR:net\disk_cache\cache_util_win.cc:25] Unable to move the cache: Access is denied. (0x5)
[ERROR:net\disk_cache\disk_cache.cc:236] Unable to create cache
Root Cause
The installer creates an alias at:
%LOCALAPPDATA%\Microsoft\WindowsApps\Claude.exe
The WindowsApps directory sits high in the Windows PATH by default and takes priority over the npm global bin directory (%APPDATA%\npm).
PATH resolution after the update (where claude output):
C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\Claude.exe ← Desktop App (NEW, takes priority)
C:\Users\<user>\.local\bin\claude.exe ← Older CLI install
C:\Users\<user>\AppData\Roaming\npm\claude ← npm CLI (correct)
C:\Users\<user>\AppData\Roaming\npm\claude.cmd ← npm CLI (correct)
Workaround
Remove the WindowsApps alias after each install/update:
Remove-Item "$env:LOCALAPPDATA\Microsoft\WindowsApps\Claude.exe"
The Desktop App continues to work normally via Start Menu and taskbar shortcuts. Only the terminal alias is affected.
A PowerShell fix script (fix-claude-path.ps1) is available to automate this workaround.
Impact
- All Claude Code CLI users on Windows who also have the Desktop App installed are affected.
- The conflict is silent — no error message indicates the wrong binary is running.
- Users may unknowingly launch the Desktop App repeatedly, spawning multiple processes.
- This is a regression introduced with the Cowork bundling update.
Suggested Fix
The Claude Desktop installer should either:
- Not register a
Claude.exealias inWindowsAppsif Claude Code CLI is already present in PATH, or - Use a different command name for the Desktop App alias (e.g.,
claude-desktop), or - Not register a terminal alias at all, since the Desktop App is typically launched via GUI shortcuts.
What Should Happen?
claude --version should return the Claude Code CLI version, as it did before the Desktop App update.
Error Messages/Logs
[ERROR:net\disk_cache\cache_util_win.cc:25] Unable to move the cache: Access is denied. (0x5)
[ERROR:net\disk_cache\disk_cache.cc:236] Unable to create cache
Steps to Reproduce
Have Claude Code CLI installed via npm (npm install -g @anthropic-ai/claude-code) and working correctly (claude --version returns CLI version).
Install or update the latest Claude Desktop App (version with Cowork for Windows support).
Open a new terminal (PowerShell or CMD).
Run claude --version.
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
Claude 1.1.2685 (f39a62) 2026-02-10T19:42:56.000Z
Claude Code Version
2.1.39
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
Terminal.app (macOS)
Additional Information
The installer creates an alias at:
%LOCALAPPDATA%\Microsoft\WindowsApps\Claude.exe
The WindowsApps directory sits high in the Windows PATH by default and takes priority over the npm global bin directory (%APPDATA%\npm).
PATH resolution after the update (where claude output):
C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\Claude.exe ← Desktop App (NEW, takes priority)
C:\Users\<user>\.local\bin\claude.exe ← Older CLI install
C:\Users\<user>\AppData\Roaming\npm\claude ← npm CLI (correct)
C:\Users\<user>\AppData\Roaming\npm\claude.cmd ← npm CLI (correct)
Workaround
Remove the WindowsApps alias after each install/update:
powershellRemove-Item "$env:LOCALAPPDATA\Microsoft\WindowsApps\Claude.exe"
The Desktop App continues to work normally via Start Menu and taskbar shortcuts. Only the terminal alias is affected.
A PowerShell fix script (fix-claude-path.ps1) is available to automate this workaround.
Impact
All Claude Code CLI users on Windows who also have the Desktop App installed are affected.
The conflict is silent — no error message indicates the wrong binary is running.
Users may unknowingly launch the Desktop App repeatedly, spawning multiple processes.
This is a regression introduced with the Cowork bundling update.
Suggested Fix
The Claude Desktop installer should either:
Not register a Claude.exe alias in WindowsApps if Claude Code CLI is already present in PATH, or
Use a different command name for the Desktop App alias (e.g., claude-desktop), or
Not register a terminal alias at all, since the Desktop App is typically launched via GUI shortcuts.
This issue has 6 comments on GitHub. Read the full discussion on GitHub ↗