Skip to content

Claude CLI not detected on Windows despite valid installation and multiple workaround attempts #1331

Description

@andrehsmendes

Checklist

  • I searched existing issues and this hasn't been reported

Area

Backend

Operating System

Windows

Version

2.7.4

What happened?

Claude CLI shows "Not detected" in Settings > Paths despite Claude Code v2.1.12 being correctly installed and fully functional from the command line.

Environment:

  • Windows 11
  • Auto-Claude v2.7.4
  • Claude Code v2.1.12 (installed via npm)
  • Node.js v22.x

Proof Claude Code works:

PS C:\Users\16475> & "C:\Users\16475\AppData\Roaming\npm\claude.cmd" --version
2.1.12 (Claude Code)

PS C:\Users\16475> where.exe claude
C:\Users\16475\bin\claude.cmd
C:\Users\16475\bin\claude.exe
C:\Users\16475\AppData\Roaming\npm\claude
C:\Users\16475\AppData\Roaming\npm\claude.cmd

npm directory is in PATH:

PS C:\Users\16475> $env:PATH -split ";" | Where-Object { $_ -like "*npm*" }
C:\Users\16475\AppData\Roaming\npm

Additional bug: Clicking "Install Claude Code" button shows: Failed to open terminal for installation: require is not defined

Steps to reproduce

Steps to reproduce

  1. Install Claude Code via npm on Windows: npm install -g @anthropic-ai/claude-code
  2. Verify it works: claude --version → returns 2.1.12 (Claude Code)
  3. Open Auto-Claude v2.7.4
  4. Go to Settings > Paths
  5. Observe "Claude CLI Path" shows "Not detected"

Workarounds attempted (all failed):

  1. ❌ Set path manually in UI to C:\Users\16475\AppData\Roaming\npm\claude.cmd → Still "Not detected"
  2. ❌ Tried .cmd, .ps1, and direct .js paths → Still "Not detected"
  3. ❌ Created native .exe wrapper that calls claude.cmd → Still "Not detected"
  4. ❌ Manually edited settings.json to set "claudePath": "C:\\Users\\16475\\AppData\\Roaming\\npm\\claude.cmd" → Still "Not detected"
  5. ❌ Set CLAUDE_CLI_PATH environment variable → Still "Not detected"
  6. ❌ Restarted Auto-Claude and full system restart → Still "Not detected"

Expected behavior

Expected behavior

Auto-Claude should:

  1. Auto-detect Claude CLI at C:\Users\16475\AppData\Roaming\npm\claude.cmd (it's in PATH and where.exe claude finds it)
  2. Accept a manually specified path in Settings > Paths UI
  3. Respect the claudePath value when manually set in settings.json
  4. Respect the CLAUDE_CLI_PATH environment variable

Logs / Screenshots

# Logs / Screenshots

**settings.json** (after manual edit):

{
  "claudePath": "C:\\Users\\16475\\AppData\\Roaming\\npm\\claude.cmd",
  "preferredTerminal": "powershell",
  ...
}


**main.log** - No Claude detection errors logged, only basic init:

[2026-01-19 00:26:01.096] [info]  Error logging initialized
[2026-01-19 00:26:01.166] [info]  Debug IPC handlers registered


**claude.cmd contents** (standard npm wrapper):

@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\node_modules\@anthropic-ai\claude-code\cli.js" %*

---

**Possibly related:** PR #1141 "fix: pass CLAUDE_CLI_PATH to Insights runner for non-standard CLI locations" suggests similar detection issues exist elsewhere.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/backendThis is backend onlybugSomething isn't workingneeds-triageNew issue, maintainer review needed

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions