[BUG] Claude Desktop opening when running "claude" in Powershell ( Windows )

Status Fixed / completed
Reported on v2.1.39
Maintainer reply None cached
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

  1. Download Claude Cowork for Windows
  2. 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_

View original on GitHub ↗

8 Comments

GBA63 · 6 months ago

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:

C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\Claude.exe

This path takes priority over the Claude Code CLI at C:\Users\<user>\.local\bin\claude.exe, so typing claude in the terminal launches the Electron Desktop App instead of the CLI.

You can verify with:

where.exe claude
# C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\Claude.exe  ← Desktop alias (wins)
# C:\Users\<user>\.local\bin\claude.exe                           ← CLI (shadowed)

Additional Symptoms

Beyond the DEP0180 deprecation warning, this can escalate to:

[ERROR:net\disk_cache\cache_util_win.cc:25] Unable to move the cache: Access denied (0x5)
[ERROR:net\disk_cache\disk_cache.cc:236] Unable to create cache

And in some cases a V8 OOM crash:

[ERROR:electron\shell\common\node_bindings.cc:182] OOM error in V8:
Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

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:

  • Not create an App Execution Alias, or
  • Name it differently (e.g., claude-desktop)

---
Closing my duplicate #24903 in favor of this issue.

UltraK18 · 6 months ago

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 put C:\Users\<user>\.local\bin (Claude Code CLI) above WindowsApps, it has no effect.

> where claude
C:\Users\<user>\AppData\Local\Microsoft\WindowsApps\Claude.exe   ← Claude Desktop (always wins)
C:\Users\<user>\.local\bin\claude.exe                              ← Claude Code CLI

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:

[ERROR:cache_util_win.cc:25] Unable to move the cache: Access denied (0x5)
[ERROR:disk_cache.cc:236] Unable to create cache

In my case, taskkill /F /IM "Claude.exe" killed 8 background processes that were holding the cache.

Workaround

  1. Disable App Execution Alias:

Windows Settings → Apps → Advanced app settings → App execution aliases → Turn off Claude

  1. Kill background Claude Desktop processes before using CLI:
   taskkill /F /IM "Claude.exe" 2>nul
  1. Open a new terminal and claude will correctly resolve to Claude Code CLI.

Suggestion

Claude Desktop's installer should either:

  • Not register an app execution alias named claude (use claude-desktop or similar), or
  • Detect existing Claude Code CLI installations and warn the user about the conflict
sebastian-zitzelsberger · 6 months ago

Additional 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.

dknoodle · 6 months ago

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.

felixrieseberg · 6 months ago

Hi, Felix from the Claude team here - we'll have a fix for this out (in the desktop app) shortly, probably today. Apologies!

NacimHarfouche · 6 months ago

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

EirrMedical · 6 months ago
Hi, Felix from the Claude team here - we'll have a fix for this out (in the desktop app) shortly, probably today. Apologies!

Has the fix been rolled out? (I still have this issue).

ilaikim99 · 6 months ago

Typing claude in 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