Skip to content

The guard's answer 2 runs a 10 s bind inside the 5 s UserPromptSubmit hook, which Claude Code times out by killing the hook's process group, and a failed bind cannot then be answered again #347

Open

Description

@brettheap

What happens. When a lane session answers the guard's offer with 2 (adjust the lane to the session), guard_answer runs the bind inside the UserPromptSubmit hook.

What Claude Code does at the timeout. Lane 4 probed Claude Code 2.1.319's hook runner, with claude -p and a project-only UserPromptSubmit hook, in 5 runs:

  • each hook runs under an sh that is its own session leader;
  • at a 3 s timeout, Claude Code sent SIGTERM to the hook's whole process group at 2.98 s. A ( … & ) child, already orphaned to pid 1 but still in that group, was killed, and a setsid child completed;
  • on a normal exit it killed nothing, and it did not wait on pipes a child had inherited.

So at 5 s the bind dies partway through, and so does any ( … & ) child it forked, such as index_nudge's. The register can be left holding only some of the bind's writes: lane 2 counts four writer calls in it (append-session-id, set-row-state to LIVE, log RESUMED, and the handoff's Rule 3 stamp). That is more than a prompt let through.

A failed bind cannot be answered again.

The fix is in #165's design, in lane 4's section of the add-sql-register change, phase 1. Answer 2's bind runs detached, as a setsid child, guard-bind:

  • the guard rewrites the offer file to mode=binding, starts the child, prints "BINDING" and returns 2;
  • the offer file records the child's pid and start time, which are its liveness test;
  • a failed bind renames the window back.

It is phase 1's first guard PR. It fixes files mode as well as SQL mode, and it touches no write seam.

Evidence:

Not checked yet: whether a lane's transcript has recorded hook_cancelled for a real answer 2. Lane 3 checks that.

Brett asked lane 3 to file this, in a dialog in lane 3's session (Question UTC 2026-11-07T15:26:46Z, Answer UTC 2026-11-07T16:55:11Z): "File the issue (Recommended)".

Lane: openRepoTools-3

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions