Skip to content

Windows support for the embedded Claude session (ConPTY) - #7

Draft
simplaerai-sv wants to merge 3 commits into
HelpFreedom:mainfrom
simplaerai-sv:win32-embedded-claude
Draft

Windows support for the embedded Claude session (ConPTY)#7
simplaerai-sv wants to merge 3 commits into
HelpFreedom:mainfrom
simplaerai-sv:win32-embedded-claude

Conversation

@simplaerai-sv

Copy link
Copy Markdown

Problem

On Windows the Claude panel dies immediately with
не удалось запустить claude: Error: File not found — the session
spawn path is POSIX-only (/bin/bash watchdog wrapper, /bin/sh
command -v, negative-pid group signals).

Changes (electron/claude.ts, win32 branches only — POSIX path untouched)

  • which(): resolve via where.exe, preferring .exe/.cmd/.bat
    (npm puts an extensionless sh shim first, which Windows cannot exec)
  • spawn: no bash watchdog wrapper; .cmd/.bat shims route through
    cmd.exe /c under ConPTY. Closing the pty tears down the attached
    console tree, so a hard Electron death still takes claude with it
  • closeSession(): pty.kill() instead of process.kill(-pid, SIGHUP)
    negative-pid group signals throw on Windows

Plus a trivial second commit syncing the stale 0.1.0 version stamp
in package-lock.json to 0.3.0 (no dependency changes).

Tested

Windows 11 (build 26200), Node 24, claude CLI 2.1.233:

  • panel opens, first-run onboarding and login work
  • all six kadr_* MCP tools reachable from the embedded session
  • session cwd follows the saved project folder as designed
  • panel close/reopen regenerates kadr-mcp.json with a fresh port;
    no orphan processes observed after app exit

No file overlap with open PRs #3 (macOS) and #5 (NixOS).

🤖 Generated with Claude Code

simplaerai-svand others added 2 commits August 16, 2026 16:49
The Claude panel was POSIX-only and died on Windows with "File not
found" before the CLI even started. Three win32 branches, POSIX path
untouched:
- which(): resolve via where.exe, preferring .exe/.cmd/.bat — npm puts
an extensionless sh shim first, which Windows cannot exec
- spawn: no bash watchdog wrapper; .cmd/.bat shims route through
cmd.exe /c under ConPTY. Closing the pty tears down the attached
console tree, so a hard Electron death still takes claude with it
- closeSession(): pty.kill() instead of process.kill(-pid, SIGHUP) —
negative-pid group signals throw on Windows
Tested on Windows 11 (26200), Node 24, claude CLI 2.1.233: panel opens,
all six kadr_* MCP tools reachable from the embedded session.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
npm install refreshed the stale 0.1.0 version stamp left behind by
earlier releases; no dependency changes.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@simplaerai-sv
simplaerai-sv marked this pull request as draft August 16, 2026 13:52
Kadr launched from a Claude Code session (agent workflows, `claude` in a
terminal) passes its whole environment to the embedded CLI, including
CLAUDECODE and CLAUDE_CODE_* markers. The embedded session then treats
itself as a nested child: transcript saving is disabled and /resume shows
no history, so a closed panel is unrecoverable.
Strip those keys before spawning; claude-env.json is applied afterwards
and can still set them deliberately.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for freeto 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.

1 participant

@simplaerai-sv