Gates
A gate is a daemon-persisted decision that pauses a subject until a human (or another surface) answers it. Gates survive daemon restarts, can be answered from any surface (the in-pane form, the board, the console, or the MCP server), and the first answer wins via compare-and-swap.
Gates are primarily agent-facing: a herd worker opens one when it needs a decision, the shepherd or a human answers, and the worker resumes. But the CLI surface is how you see what is waiting and answer pending questions directly.
Lifecycle
- Open.
rt gate openorrt gate askmints a gate, stores it in the daemon, and emitsgate/opened. If another open gate already exists on the same subject and kind, it is superseded (closed automatically). - Park (optional).
rt gate park <id>marks the gate paused without closing it. A parked gate can still be answered. - Answer.
rt gate answer <id>records the answer and releases anyone blocked inrt gate wait; a form-presented gate's pane also gets a push (see Delivery). A second answer to the same gate is rejected cleanly, and the rejection carries the winning answer. - Close.
rt gate close <id>closes a gate without an answer. Waiters are released with a "closed" status. - Wait.
rt gate wait <id>blocks until the gate is answered or closed. Works across daemon restarts.
Asking a question with rt gate ask
rt gate ask is the high-level interface. It resolves the subject automatically, determines the presentation mode, and nudges the operator. The presentation is a form only when the asking session has a pane and every question has at most 4 options; otherwise it is wait, and an over-cap question is reported back as formCapExceeded. The cap does not apply when the gate-form plugin's kit form draws the gate: a main-session gate that is not a hand-back, in a session with gate-form's ask tool, keeps a long pick-any list as one question.
rt gate ask \
--questions '[{"id":"q1","label":"Which approach?","multi":false,"options":["Refactor first","Ship as-is"]}]' \
--context "We found dead code in the auth path; removing it simplifies the fix but adds scope."
A gate owned by a human (anything not raised from a herd run) must carry --context; rt gate ask refuses one without it, except for the milestone and pane-attention kinds.
Subject resolution
If --subject is omitted, the daemon walks a resolution ladder: the session's running run (if exactly one), then the session's agent record's subject. If multiple runs exist, it errors with candidates. Pass --subject explicitly to skip the ladder.
Options
Options can be bare strings or objects with richer metadata:
[
{ "value": "refactor", "label": "Refactor first", "recommended": true, "description": "Removes dead code before the fix" },
{ "value": "ship", "label": "Ship as-is", "description": "Smallest diff, tech debt stays" }
]
An option with recommended: true gets a "(Recommended)" suffix in the daemon's normalized label, which downstream UI renders as a badge. The board and the console open a fresh form with each question's recommended options already picked.
Per-question context
Each question can carry its own context field for material specific to that choice. The gate stores the gate-level --context and every per-question context whole, at any size, and the board shows them in full. Only the prose a Claude Code pane's form shows has a budget (8 KB), so a long context can be shortened there and nowhere else.
[
{
"id": "q1",
"label": "Which migration strategy?",
"multi": false,
"options": ["Blue-green", "Rolling"],
"context": "The table has 50M rows; blue-green needs twice the disk during cutover."
}
]
Write-ins
A question can also take an answer in the human's own words. Mark it with "writeIn": true, and set it only on a decision question whose free-text answer the agent can act on, never on next. The question still needs options; a question with none is free-form already.
{
"id": "approach",
"label": "How should we split this?",
"options": ["One MR", "Two MRs"],
"writeIn": true
}
In the console and the board, the human leaves the options alone and types into the question's note box.
Answering
rt gate list --open # see what is waiting
rt gate answer <id> --answers '{"q1":"refactor"}' --by human # answer one
Answer values must match an option's value verbatim. Free-text feedback rides a per-answer note field. For multi-select questions, the answer is an array of values. A multi-select answer can also carry texts, an edited text for some of its picked values, keyed by value; the board sends a review comment you edited this way.
A question marked writeIn may instead take the human's own words, sent alone with no value, note or text:
rt gate answer <id> --by human \
--answers '{"approach":{"writeIn":"migration in its own MR"}}'
The daemon refuses an empty write-in, and a write-in on a question not marked for one. The agent treats a write-in as the human's instruction and never maps it onto the nearest option.
Herd ownership
When a gate was opened by a herd worker, only the owning shepherd's session (or the gated pane itself) can answer it. The shepherd answers or parks one with the herd_gate_answer and herd_gate_park tools. Pass --override to escalate as a human past the automated owner.
Gates in a pipeline run
A pipeline's skills ask their questions through the gate tools on the MCP server, not the CLI. A stage opens its gate with gate_ask, or with gate_open from a structured source, which the tool stores whole while fitting the pane form's prose to its 8 KB budget. When the gate is answered, the answer is recorded on the run as a decision in that stage, so the run's story in console shows it. A gate superseded by a later one at the same point records nothing. The gate tools only open, read and record; the skill decides what happens next.
Delivery
When a gate that carries a nudge session (every form-presented gate does) is answered from another surface, the daemon pushes a notification to the gated pane. The notification tells the pane to re-read the registry; it does not carry the answer itself. The pane then reads the recorded answer. A skill calls gate_reconcile, which under a run also records the answer. A shell calls rt gate wait (or rt herd answer). A gate with no nudge session (a wait-presented rt gate ask gate, for one) gets no push: its rt gate wait returns.
If the gated pane has exited, the daemon retries delivery with bounded retries (up to 20 attempts). An unanswered herd-owned gate is escalated to the human once its TTL passes, or as soon as the owning shepherd's subscription is gone.
Subscriptions
rt gate subscribe registers a session for push notifications on gates matching a subject prefix. Subscriptions fire on both gate/opened and gate/answered events and persist across daemon restarts.
rt gate subscribe --subject-prefix "run:" --session <addr>
rt gate unsubscribe <id>
rt gate subscriptions # list active subscriptions
See also
rt gatecommand referencert gate ask,rt gate answer,rt gate list- The daemon for daemon basics
- MCP server for answering gates through MCP tools