Skip to content

Support native Windows #22

Closed

Description

@abruption

Motivation

Windows is excluded today, and the README says so. The reason given — "named pipes with a mandatory auth line" — is accurate but was never tested; it came from reading the docs, not from trying.

There is a Windows machine on the same tailnet as the four supported hosts, so this is reachable in practice rather than hypothetical.

What actually differs

From the docs:

macOS / Linux / WSL 2 native Windows
inbox Unix domain socket named pipe
auth line optional required — a connection whose first line isn't valid auth delivers nothing
access control socket restricted to the OS user key readable only by the OS user
own-child verification process evidence (Linux), token (macOS) token only
minimum version v2.1.224 v2.1.234

So three things change, not one:

  1. Transport. post_to_socket() opens AF_UNIX unconditionally — that constant doesn't exist on Windows Python. A named pipe is opened as a file (\\.\pipe\...), not through the socket API.
  2. Auth becomes mandatory. We currently send the message line on its own, which macOS and Linux accept. On Windows that connection is closed and nothing is delivered. CLAUDE_CODE_MESSAGING_TOKEN has to be read and sent first — and it must come from the target session, so a script posting to a session it doesn't belong to needs the token from that machine's registry rather than its own environment.
  3. Discovery. sessions_dir() assumes ~/.claude/sessions, and messagingSocketPath is read as a filesystem path. Both need checking against what a Windows session actually writes; neither has been observed.

Also worth deciding

  • WSL 2 counts as Linux, and the docs are explicit that a WSL 2 session and a native Windows session on the same computer cannot reach each other — different home directories, different socket types. If the goal is only "reach Claude Code on that box", installing under WSL 2 already works today with no code change. Native support is worth it only for sessions actually running on Windows.
  • How does --host reach it? The remote path pipes this file into python3 - over SSH. Windows OpenSSH with PowerShell as the default shell handles that differently, and python3 may be python or a Store alias. install.sh is POSIX sh and won't run there at all — a Windows install path is a separate question from the transport.

Acceptance criteria

  • list and send work on a native Windows session, verified on the tailnet machine rather than assumed
  • Named-pipe transport chosen at runtime, without breaking the Unix path
  • Auth line sent when the platform requires it, with the token sourced from the target session
  • Discovery confirmed against a real Windows session record, not inferred
  • A decision recorded on --host and installation for Windows, even if the answer is "use WSL 2"
  • README and SKILL.md updated; the current "unsupported" note replaced with what is actually true
  • CI gains a Windows leg, or the exclusion is documented with a reason

Not in scope

Making a Windows machine a sender over --host may be considerably more work than making it a receiver. Receiving is the useful half — that is what lets a worker there be reached — and it is worth splitting if the sending side turns out to be a project of its own.

Activity

  1. added
    enhancement
    on Sep 7, 2026
  2. abruption commented on Sep 8, 2026

    @abruption
    OwnerAuthor

    Windows 실기 테스트 결과 (2026-09-08)

    환경: Windows 10 22H2, Python 3.10.0, Claude Code v2.1.263, Tailscale SSH 접속

    세션 레코드 형식 (실측)

    {
      "pid": 13224,
      "pidDomain": "win32:<hostname>",
      "messagingSocketPath": "\\\\.\\pipe\\LOCAL\\cc-msg-<hash>",
      "name": "my-session",
      "status": "idle",
      "version": "2.1.263"
    }
    • Named pipe 경로: \\.\pipe\LOCAL\cc-msg-<hash>
    • Auth key 파일: <pid>.<hash>.key (JSON: peerToken, procStartFt, pidDomain)
    • Auth line은 필수 — 없으면 메시지 무시됨

    수정 내용 (fix/windows-compat 브랜치)

    1. pid_alive(): os.kill(pid, 0) → Windows에서 ctypes.windll.kernel32.OpenProcess() 사용
    2. discover(): named pipe 경로(\\.\pipe\) 인식
    3. post_to_socket(): Windows pipe 감지 시 _post_to_pipe()로 분기 — .key 파일에서 auth 토큰 읽어 auth line 전송 후 메시지 전송
    4. 인코딩: 모든 text=True → encoding="utf-8", 모든 read_text()에 encoding="utf-8" 명시, main()에서 stdout/stderr reconfigure

    테스트 결과

    기능 결과
    --version ✅
    list (세션 발견, named pipe 인식) ✅
    list --json ✅
    send (named pipe + auth) ✅
    send --dry-run ✅
    send --json ✅
    update --check ✅
    list --host ubuntu@<remote> ✅ (사용자 직접 실행 검증)
    list --host --json ✅ (사용자 직접 실행 검증)
    send --host --to <session> --dry-run ✅ (사용자 직접 실행 검증)

    Issue #22 acceptance criteria 현황

    • list와 send가 native Windows 세션에서 동작 — 실기 검증 완료
    • Named pipe 전송을 런타임에 선택, Unix 경로 미파손
    • Auth line 전송 (토큰은 세션 .key 파일에서 읽음)
    • Discovery가 실제 Windows 세션 레코드에서 확인됨
    • --host 검증 완료 (사용자 직접 실행), 설치는 pip install cc-peer (install.sh는 POSIX 전용)
    • README/SKILL.md 업데이트 완료 (fix/windows-compat 브랜치)
    • CI Windows leg 추가 (windows-latest, Python 3.13)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions