How shipkit's agents coordinate across sessions with Orca
When a ticket runs through shipkit, no single conversation holds the whole job. The ticket moves through
several Claude sessions that share no memory, and they only know what is in git, in the .shipkit/ state files, or in a
message. This post covers how those sessions find and talk to each other, and what I let the top one decide for me.
Four roles. The root is my own /developer session. A coordinator is the Claude session that owns one ticket in its own git
worktree. A worker is a short-lived session that writes code in a single repo. Orca, the terminal app I run all of them in,
starts and supervises these sessions. I use the orca-cli and orchestration skills for the plumbing, so the agent
follows the guide that matches the installed Orca version instead of guessing flags.
Starting sessions and sending messages
orca worktree create --agent claude makes a worktree for the ticket and opens its coordinator terminal. /assign then
starts one worker per repo with orchestration worker-start --agent claude under a single Run, on Sonnet at medium effort.
The brief goes in as a file, never through terminal send, so backticks and non-ASCII text arrive byte for byte. A worker
ends with worker_done --outcome succeeded or failed, so a failure is never only prose.
A coordinator asks upward with orchestration send, ends its turn, and Orca wakes it with the answer. In the morning
briefing the root asks downward the same way, collecting replies with orchestration check --wait for about 20 seconds. A
busy worktree is not asked, and the root reads its files instead.
Running this on real worktrees produced four rules:
- Orca refuses
worker-start --terminalfor a worker that has settled, so a follow-up is always a new worker. Its brief says to rungit statusandgit logfirst and continue from the commits the last one left. - A second
run-createfrom the same terminal fences the first, so a coordinator creates exactly one Run and reuses its id. - Mail to the root can arrive late. Once it took 9 minutes 23 seconds while the root sat idle at an empty input box. The cause is unknown, so the sender records the message id, checks delivery, and a script types Orca's own wake line into the idle root.
- A permission prompt on a worker's terminal is never answered for me, and an agent never goes into a path another agent is still working in.
The root coordinator
The root stands in for me toward the coordinator of every worktree it starts, so a worktree that would stop and ask me can ask the root first. A question goes to the root only when a rule names it. Anything else is still asked of me directly.
Each worktree holds a small gitignored file that tells its coordinator where the root is. The root writes it right after it creates a worktree and refreshes it whenever it continues one, so a restarted root never leaves a worktree pointing at a dead address. If the root isn't running in an Orca terminal, no file is written and every worktree asks me.
# Root coordinator — read by the ticket coordinator in this worktree
run: <run_id>
root_terminal: <the root's terminal handle>
root_worktree: <the root's worktree id>
written: <ISO-8601>
A coordinator with a question reads that file and sends it up:
orca orchestration send --to run:<run> --from "$ORCA_TERMINAL_HANDLE" \
--subject "<ticket key> question: <short>" --body "<the question, with its options>"
The root answers alone in two cases: my own instructions in that session settle it, or a standing rule of the skill does. An instruction I gave in one session isn't carried to another. Everything else goes to me in one line with the ticket, the worktree and the question, and the root replies after I answer. When it answered alone, it tells me afterwards in one line. What I must approve, such as a Jira comment, a deletion or a merge outside the pipeline's own preconditions, is never answered for me.
Worktrees ask independently, so questions arrive in bursts, and the wake notices can come before or after the mail. The root reads the batch once, writes down each message id with its ticket, replies to each question by its own id, waits about 20 seconds for a late one from the same burst, and relays what is left to me as one numbered list.
What the root decides without me
The first is the PR slot. A worktree that is ready for /pr asks for one, and the first PRs of different tickets must be an
hour apart. The root keeps a ledger, .shipkit/pr-slots.md, with one line per ticket and grants the next free time, because
spacing PRs is neither a post nor a deletion.
The second is removing a finished worktree. When a pipeline ends, the worktree sends a "pipeline done" message with its facts
and a blockers: line, and it never removes itself, since its own session lives there. The root doesn't take the report on
trust. It checks that the sender really is a terminal of that worktree and reads the facts again (clearance script, merged
PRs, no agent mid-turn). Only when all of it agrees does it stop the local stack and remove the worktree, never with
--force. If anything differs from the report, it keeps the worktree and tells me once what it found and what the report
said. With no "pipeline done" message, nothing is removed, however finished the ticket looks.
When the root isn't there
If the file is missing, send fails or the root session is gone, the worktree asks me instead. A root that is alive but
silent is waited on for two hours, then the worktree asks me itself. A reply sits in a terminal-only mailbox, so if the
asker's terminal closes first the reply is lost and the asker asks me again. The pipeline never waits on a root that can't
answer.
The four rules above came from running on real worktrees.