Skip to content

[codex] Fix Claude CLI spawn on Windows#107

Merged
nashsu merged 1 commit intonashsu:mainfrom
yyyzl:codex/fix-claude-cli-windows-shim
May 1, 2026
Merged

[codex] Fix Claude CLI spawn on Windows#107
nashsu merged 1 commit intonashsu:mainfrom
yyyzl:codex/fix-claude-cli-windows-shim

Conversation

@yyyzl
Copy link
Copy Markdown
Contributor

@yyyzl yyyzl commented Apr 30, 2026

Summary

Fixes the Claude Code CLI provider on Windows when Settings detects a local claude install but chat fails with Claude Code CLI not found.

Root Cause

The Settings health check resolved the CLI through which::which("claude"), but the chat transport spawned a bare Command::new("claude"). On Windows, the npm install usually exposes claude.cmd / claude.ps1 shims and a real claude.exe; Rust/Tauri process spawning does not behave like PowerShell command resolution, so detection could pass while chat spawn failed.

Changes

  • Add a shared find_claude_command() helper for Claude CLI resolution.
  • Prefer claude.cmd and claude.exe on Windows, then fall back to claude for other platforms.
  • Use the same resolved path for both detection and chat subprocess spawn.

Validation

  • rustfmt --edition 2021 --check src\commands\claude_cli.rs passes.
  • cargo check --quiet could not complete locally because the installed toolchain is rustc 1.90.0, while lancedb / lance dependencies require rustc 1.91.0.

Closes #106.

Related: #86.

@nashsu nashsu marked this pull request as ready for review May 1, 2026 07:55
@nashsu nashsu merged commit 7fca09c into nashsu:main May 1, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Claude Code CLI 检测通过但聊天时报 not found

2 participants