Windows support for the embedded Claude session (ConPTY) - #7
Draft
simplaerai-sv wants to merge 3 commits into
Draft
Windows support for the embedded Claude session (ConPTY)#7simplaerai-sv wants to merge 3 commits into
simplaerai-sv wants to merge 3 commits into
Conversation
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
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>
simplaerai-svforce-pushed
the
win32-embedded-claude
branch
from
August 16, 2026 13:58
f71d37d to
934ea30Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On Windows the Claude panel dies immediately with
не удалось запустить claude: Error: File not found— the sessionspawn path is POSIX-only (
/bin/bashwatchdog wrapper,/bin/shcommand -v, negative-pid group signals).Changes (electron/claude.ts, win32 branches only — POSIX path untouched)
which(): resolve viawhere.exe, preferring.exe/.cmd/.bat(npm puts an extensionless sh shim first, which Windows cannot exec)
.cmd/.batshims route throughcmd.exe /cunder ConPTY. Closing the pty tears down the attachedconsole tree, so a hard Electron death still takes claude with it
closeSession():pty.kill()instead ofprocess.kill(-pid, SIGHUP)—negative-pid group signals throw on Windows
Plus a trivial second commit syncing the stale
0.1.0version stampin package-lock.json to 0.3.0 (no dependency changes).
Tested
Windows 11 (build 26200), Node 24, claude CLI 2.1.233:
no orphan processes observed after app exit
No file overlap with open PRs #3 (macOS) and #5 (NixOS).
🤖 Generated with Claude Code