Working a plan with a supervising agent
A plan is a work queue. critterstack says what is ready, who holds what, what waits on a person and what the evidence says; it starts no agent. The sessions that do the work are yours: a person at a keyboard, a Claude Code session you are talking to, sessions that one supervises, a cloud agent. Each one reads the queue, claims a node, does the work, reports, and critterstack observes GitHub, the feeds, the test runs and the sessions themselves to say what is done.
The usual way to work a plan is with a lead: one agent session you work with, which takes the lead of the plan. It reads what is ready, claims it, does it (or hands it to sessions it supervises), proves it, answers its workers' questions, and asks you when a decision is yours. This page is how to run one.
What the lead gives you
- One conversation, carried across nodes. What you decided on the third node is still in the lead's context on the ninth. You do not explain the same trade-off to five workers.
- Questions answered in place. The lead asks you when it reaches a decision that is yours, in the session you are already in, and answers its own workers' routine questions itself.
- The plan changes as you learn. When a node turns out to be two, or a dependency was missing, the lead adds and rewires nodes (
add_plan_node,link_plan_nodes,change_plan_node) as it goes, and the plan page shows it at once. - What was learned is kept. The lead records decisions and gotchas (
record_memory,add_repository_note) and your notes on the plan, so the next session, lead or worker, recalls them. - critterstack stays the shared record. What is ready, what is claimed and by whom, what waits on you, every decision with who made it and when, the gates' evidence: all of it is on the plan page and the needs panel, whoever is doing the work.
Two things to plan for:
- The lead's context window. A long plan fills it. Have the lead record what matters as memories and notes as it goes, so a fresh lead session (
/clear, or a new session that takes the lead) can pick up fromplan_status,get_nodeandrecall. - Parallelism is the sessions you run. One lead does one thing at a time, plus whatever it hands to sessions it supervises. critterstack keeps any number of sessions out of each other's way (a claim is refused with its holder's name, a heavy node waits for the machine), and adds none of its own.
Starting one
Wire the repository with
critterstack setupand start the server (critterstack). Start the lead's Claude Code session in the plan's main repository, the one most of the work is in, so its.mcp.jsonnames the critterstack server. Approve thecritterstackserver when Claude Code asks.Have a plan. Author it with the lead (see Plans and nodes), or import one.
Tell the session to take the lead. In plain words:
textTake the lead on plan net11-train in critterstack (lead_plan, with your session id from $CLAUDE_CODE_SESSION_ID). Work it as its lead: read plan_status, tell me what is ready and what waits on me, then take the ready nodes one at a time. Claim each with your session, do it, prove gates with critterstack gate run, report the PR, and release. Ask me before anything that is a decision: scope, a public API, a trade-off. When I say "go ahead" or "merge-on-green" on a node, relay it with the relay tools, naming me as "Jeremy D. Miller". Record what the next session should know as memories. Never merge a PR yourself.
The stoat-coordination-agent-workflow skill teaches an agent this loop; with it installed, a shorter prompt does.
The plan header then shows the lead (gone when it has not been heard from for ten minutes), and its claims show on the cards like any agent's. The header's × clears the lead.
The lead is alive while it keeps calling: lead_plan, await_questions (which parks for up to four minutes at a time), an answer, an escalation or a relay. critterstack watches no session itself, so a lead that stops calling for ten minutes is treated as gone: its questions are yours until it calls again.
The loop the lead runs
Take the lead, then read
lead_plan(plan: "net11-train", agent: "net11-lead", session: "<its session id>")
plan_status(slug: "net11-train")
next_ready_nodes(plan: "net11-train")
get_node(slug: "net11-train", id: "wolverine-tfm", includeGitHub: true)lead_plan is refused while another lead is alive, that is, heard from within ten minutes.
plan_status gives the lead what the plan page gives you: each node's stance (you, broken, held, moving, waiting) with stanceWhy, a waiting node's root blockedBy, its needs from a person, a mergeOrder for a PR waiting on a merge, and the plan's grouped needs with its stalled flag. next_ready_nodes is the queue itself, sorted by how much each node unblocks, and each entry carries its launch: next when nothing holds it, or what does (go-ahead, machine-resource, exclusive). get_node is one node in full: why it is or is not ready, its brief, the skills its work uses, its claim and questions, people's notes, and the memories and repository notes that apply. Read those before claiming.
Get the go-ahead before claiming
An issue node waits for a person's go-ahead before an agent may claim it: its launch reads go-ahead. claim_node does not check it, so a session reads launch and asks. When you say yes, the lead records it as yours before it claims the node:
approve_for_agents(plan: "net11-train", nodes: ["wolverine-tfm"], agent: "net11-lead",
session: "<its session id>", relayFor: "Jeremy D. Miller")Order matters, because a lead cannot relay a decision on a node it holds a claim on (see Guardrails). A node of yours (kind: person, assignee: person) is never claimable; the lead reminds you of it instead.
Claim, work, report, release
claim_node(plan: "net11-train", node: "wolverine-tfm", agent: "net11-lead", session: "<its session id>")
… the work …
report_node(plan: "net11-train", node: "wolverine-tfm", agent: "net11-lead",
note: "TFM moved; two packages pinned below 11", pr: 5139)
release_node(plan: "net11-train", node: "wolverine-tfm", agent: "net11-lead")- The claim is a lease (30 minutes by default, up to 240 with
leaseMinutes), and onlyreport_noderenews it (a session parked inask_personis renewed while it waits). Report at least once a lease, or the claim lapses under the work. - The work is the lead's, or a session it supervises. Subagents the lead starts inside its own session work under the lead's claim. A separate session the lead starts (another terminal, a background
claude -p) claims its own node with its own session id, and itsask_personquestions markedneeds: "agent"come to the lead. prlinks the pull request to an issue node however its body is worded. If the issue is only partly done, the PR saysPart of #n, and the report says what is left:leftOut: ["the docs"]. The node then reads partial, and its dependents wait until you accept it.- Releasing changes no status. The node is done when the issue closes, the version is published, the gate passes.
- Gates are proven, never claimed. From the checkout,
critterstack gate run net11-train/wolverine-gateruns each declared step and records it. See Gates. - A refused claim says why. Another holder is named; a node waiting on a machine resource says who holds it; while the machine is reserved for an exclusive node, the refusal names that node.
- The lead never merges. Merges stay yours, on GitHub; critterstack merges nothing. The needs panel lists the merges in the order they should land. A node you put on
merge-on-greensays its PR may be merged with no review once its checks are green.
Park instead of polling
await_dependencies, await_package_version and await_run_completion block until the fact changes, and await_questions until a worker's question routed to the lead arrives. Each is one open request. Each waits 240 seconds by default, under the time an MCP client commonly lets a tool call run, and answers a timeout rather than being cut off: the lead calls again. A lead in a conversation with you can also check between steps: await_questions returns at once with every question already open.
Answer workers, escalate what is yours
await_questions(plan: "net11-train", agent: "net11-lead", session: "<its session id>")
answer_question(plan: "net11-train", node: "marten-tfm", questionId: "…", answer: "…",
agent: "net11-lead", session: "<its session id>")
escalate_question(plan: "net11-train", node: "marten-tfm", questionId: "…",
reason: "a public API change", agent: "net11-lead", session: "<its session id>")A worker asks with ask_person and parks on its claim. A question marked needs: "agent", or left unmarked while the lead is alive, comes to the lead; answer_question names it by its questionId, and the worker wakes with the answer, recorded as the lead's. A question marked needs: "person" never reaches the lead, and an escalated one is yours for good: it is on the top bar and the strip, and you answer it from the plan page.
Change the plan as it learns
The authoring tools are the lead's as much as anyone's: add the node a discovery calls for, link the edge that was missing, put a brief on a node for whoever takes it, file the issue for an unbound node and bind it (bind_plan_node). Plan authoring over MCP never turns on merge-on-green; that is yours. Your own notes on the plan or a node go through the lead with add_person_note, recorded as yours.
Relaying your decisions
Every control on the plan page that is a person's has an MCP twin that only the plan's live lead may call. The lead uses one when you have said the decision in the conversation, names you in relayFor, and critterstack records it as yours with the lead beside it: the Activity reads "approved for agents, relayed by net11-lead · Jeremy D. Miller".
| You say | The lead relays |
|---|---|
| "Go ahead on wolverine-tfm" | approve_for_agents |
| "That one may merge on green" / "back to review" | set_merge_policy |
| "That partial is enough" / "send it back" | accept_partial |
| "I did the demo" (a node of yours) | mark_person_node_done |
| "Run that gate again" | reverify_gate |
| "That gate's pass is fine as it is" | accept_stale_gate_pass |
| "Take its word for that gate" | allow_asserted_results |
| "Add the fix node for red main" | propose_base_fix |
| "Note on the plan: …" | add_person_note |
| "Accept that finding" / "reject it" / "sign it off" | decide_review |
| "CI is off for marten today" | set_repository_ci |
| "CommitGate stands in for CI there" | set_gate_stand_in |
Those twelve are the whole list; each is described in the MCP reference.
Guardrails
Each of these is refused, with a test named for it:
- Only the plan's live lead relays. Any other agent is refused, and so is a lead critterstack has not heard from for ten minutes. A gone lead's questions are yours at once.
- Never on a node the lead holds. A lead holding a claim on a node cannot approve, merge-on-green or accept it: a worker still cannot approve its own work, even when it is the lead. Get the go-ahead first, or release the node before relaying.
relayFormust name a person, and not the lead itself.- Only for repositories the plan works in, for a repository's controls.
- Still a person's alone, with no MCP twin at all: clearing the lead, purging a plan, and answering a question marked for a person.
The decision is still yours. The relay is a record of what you said, not a way for the lead to decide.
Working a plan without a lead
Nothing above needs a lead. Any session wired with critterstack setup can read next_ready_nodes, claim a node and work it; An agent's first session is that loop on its own. Without a lead every question is a person's, answered from the plan page, and every control on a card is used there.
See also
- A person's controls — every control a lead may relay, and what waits on you
- Gates — running a gate and what it records
- MCP tool reference — the lead and relay tools
- An agent's first session — the claim, report, release loop on its own
