Skip to content

Studio: Windows — the hook finds claude.exe and takes turns on the session record (#936) #945

Backlog

Description

@danielrispler

Parent

#936

What to build

On Windows the hook records claude.exe as the session's agent, and concurrent hooks of one session never fail on the record's lock.

  • The parent pid on Windows comes from a Toolhelp snapshot. In exec form the parent is claude.exe.
  • inspect gains a Windows arm (parent pid and full image path through QueryFullProcessImageNameW). is_shell splits on \ and /, strips .exe case-insensitively, and knows pwsh, powershell and cmd. agent_pid skips a run of shells, at most three, on every platform. in_app learns VS Code's and Cursor's Windows install folders.
  • The session records' locks in turns/: on Windows the prune's remove_file of a lock another hook holds leaves it delete-pending, and a third hook's open fails with access denied. Make a hook never fail on that: a short retry of the open, or a prune that leaves the lock to the session's end; say which and why in the PR.

Acceptance criteria

  • hook/tests/pid.rs rows on every CI with the injected inspect: exec form, the Git Bash chain bash.exe > bash.exe > claude.exe, two Unix shells.
  • The parent pid canary (the_logged_line_carries_the_parent_pid_or_the_wrappers) runs on Windows.
  • A Windows-job test of hooks racing a prune over one turn lock: every hook writes its record.
  • docs/studio/behaviour/sessions.md notes the walk past up to three shells.
  • Each Windows-only test row is shown red (an assertion failure), then green, on Windows runs of this ticket's own pushed issue-* branch, x64 and arm64; Daniel approves the push when auto mode stops it (Spec: Windows Phase 1 — Claude Code recorded on native Windows, x64 and arm64 #936 breakdown, Q41; the rule is in docs/agents/issue-tracker.md once 01 lands). Both run links are in the PR.
  • npm run check and npm run check:windows pass.

Reading

Touches

  • Files: hook/src/main.rs, hook/src/lib.rs, hook/tests/pid.rs, hook/tests/prune.rs, hook/tests/turns.rs, docs/studio/behaviour/sessions.md
  • Session: auto mode
  • Route: strong · effort high — concurrency: hooks racing a prune on one lock file

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agentwindows

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions