[BUG] Claude Desktop opening when running "claude" in Powershell ( Windows )
Status Fixed / completed
Reported on v2.1.39
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 8 comments · opened Feb 11, 2026 · closed Aug 25, 2026
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?
When typing claude in the command line on Windows, the claude code cli no longer opens. Instead I get:
(node:11048) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `Claude --trace-deprecation ...` to show where the warning was created)
And it opens Claude Desktop instead.
This just starting happening after installing Cowork for Windows.
What Should Happen?
Claude Code should successfully open its TUI interface. Claude Cowork / Desktop should not open.
Error Messages/Logs
(node:11048) [DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
(Use `Claude --trace-deprecation ...` to show where the warning was created)
Steps to Reproduce
- Download Claude Cowork for Windows
- Type "claude" in Powershell
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.39
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
PowerShell
Additional Information
_No response_
8 Comments
Root Cause Analysis
The issue is caused by a Windows App Execution Alias. When the Claude Desktop App is installed, Windows creates an alias at:
This path takes priority over the Claude Code CLI at
C:\Users\<user>\.local\bin\claude.exe, so typingclaudein the terminal launches the Electron Desktop App instead of the CLI.You can verify with:
Additional Symptoms
Beyond the
DEP0180deprecation warning, this can escalate to:And in some cases a V8 OOM crash:
Workaround
Disable the App Execution Alias for Claude:
Windows Settings → Apps → Advanced App Settings → App Execution Aliases → Claude → OFF
Then restart the terminal. The Desktop App can still be launched via the Start Menu.
Suggested Fix
The Desktop App installer should either:
claude-desktop)---
Closing my duplicate #24903 in favor of this issue.
Additional findings: Root cause and workaround
Root Cause: Windows App Execution Alias
The issue is caused by Claude Desktop registering a Windows App Execution Alias at
C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\Claude.exe. This alias takes priority over normal PATH resolution, so even if you reorder your PATH to putC:\Users\<user>\.local\bin(Claude Code CLI) aboveWindowsApps, it has no effect.Secondary Issue: Electron Cache Lock
Even after invoking Claude Code CLI directly via its full path, if Claude Desktop is still running in the background (it spawns multiple processes), it locks the shared Electron disk cache. This causes the following error:
In my case,
taskkill /F /IM "Claude.exe"killed 8 background processes that were holding the cache.Workaround
Windows Settings → Apps → Advanced app settings → App execution aliases → Turn off Claude
claudewill correctly resolve to Claude Code CLI.Suggestion
Claude Desktop's installer should either:
claude(useclaude-desktopor similar), orAdditional workaround:
Just make sure the path to your desired application is higher in priority in your PATH Variable.
if the entry C:\Users\<user>\.local\bin is before C:\Users\<user>\AppData\Local\Microsoft\WindowsApps
typing claude in a terminal will start claude-code again over the electron app.
The workaround worked fine for me. It was annoying that it did this at all, but it was a relatively quick and easy fix as a power user once I found this github issue.
Hi, Felix from the Claude team here - we'll have a fix for this out (in the desktop app) shortly, probably today. Apologies!
For me :
Last working version
2.1.37 + without co worker (installed)
Did the workaround :
disabled the alias made by the installation of Claude desktop (co worker).
-> worked well
Has the fix been rolled out? (I still have this issue).
Typing
claudein PowerShell after installing Claude Desktop and getting the Electron app instead of the CLI? This is a Windows App Execution Alias conflict — Claude Desktop registers an alias that bypasses PATH entirely. One toggle in Windows Settings fixes it: https://cacheoverflow.dev/blog/zAuVEBUr