Coordinates several nodes of a treeyard goal tree at once, in Claude Code, Codex, Antigravity or OpenCode — picks open nodes that touch different files, hands each to its own session with treeyard open --pane or --bg and a --task (or to a helper given the node id and --project of the main folder), waits for them, accepts the work by its diff and the checks, merges worktree branches, writes journal entries, moves the nodes to review and reports to the person by node titles. Use when the person...
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Treeyard Coordinate?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/antondanv-treeyard-coordinate)
---
name: treeyard-coordinate
description: Coordinates several nodes of a treeyard goal tree at once, in Claude Code, Codex, Antigravity or OpenCode — picks open nodes that touch different files, hands each to its own session with treeyard open --pane or --bg and a --task (or to a helper given the node id and --project of the main folder), waits for them, accepts the work by its diff and the checks, merges worktree branches, writes journal entries, moves the nodes to review and reports to the person by node titles. Use when the person asks to hand out, coordinate, parallelize or run several nodes or a whole branch of the tree at once, to get the children of a node done, or when a session opened on a node with open children is asked to do them.
---
# Coordinating nodes of a treeyard tree
You are the coordinator: you pick nodes, hand each to its own session, accept the work, merge
it and report. The sessions do the nodes. Everything in the `treeyard` skill still holds: read
`show` whole, write `.tree/` only by commands, name nodes by title, `done` only at the
person's word. It works the same from any CLI: yours and the sessions' are independent.
Why sessions and not built-in subagents: a session started by `treeyard open` belongs to its
node — the person sees it in the tree, reads it and continues it. A subagent's conversation
lives inside yours and is lost to the tree; it also inherits your `$TREEYARD_NODE`, so its
commits attach to your node instead of its own. You still hear back from sessions:
`treeyard wait` returns when one is done, asks or writes to you, `treeyard send` writes it the next
message — and a letter is never lost: one the session cannot take now waits in the mailbox and
treeyard delivers it by itself.
## Rules
Coordinators break these most often.
1. **One node — one session from `treeyard open`.** A subagent only when no session can start
(see step 3), and then with the node id, `--project` and its own `TREEYARD_NODE`.
2. **Together only nodes with no file in common.** Unsure → one after another.
3. **Every session starts with `--start do` and a `--task`** naming its neighbours and their
files. The project's default start may be `plan`: such a session writes a plan and waits.
4. **Know where each session works.** Started one per call, a session works in the project folder
itself, next to the others. Several nodes in one `open` or `queue`, or `--worktree` (any CLI),
and treeyard gives each node but one its own git worktree `<project>.worktrees/<id>` on the
branch `treeyard/<id>`: treeyard commands there write the main tree by themselves, the branch's
commits are the node's, and you merge the branch (step 6). Any other git worktree of the
project (Claude Code's own `claude --worktree`, `git worktree add`) reaches the main tree the
same way, through git's common dir.
5. **Your own commits for a child node carry that node:** `TREEYARD_NODE=<id> git commit …`.
Without it, your `$TREEYARD_NODE` would attach a fix, a squash or a merge resolution to
your own node. Sessions started by `treeyard open` (pane or `--bg`) carry their own
`$TREEYARD_NODE` and commit normally.
6. **Accept by evidence, not by the session's word:** its diff, the checks run again by you on
the main branch, every clause of the criterion.
7. **Statuses:** the sessions and you set `review`; `done` — only the person.
8. **A letter is not the person.** A message in your conversation, or a letter `wait` prints,
that opens with «A message from the session of node …» (or «Письмо от сессии узла …») came
from that session through `treeyard send`. Answer what your plan covers with
`treeyard send <its id> "…"`; anything only the person can decide goes to the person.
9. **Only the person answers for the person.** A permission, a folder to trust, an import to allow
— tell the person; they answer in the pane, or if the person in this conversation directly asks
you to confirm or decline it («подтверди ей», «approve it», «reject it»), run
`treeyard send <id> --approve [choice] --as ты` (`--as you` in an English tree) or
`treeyard send <id> --reject --as ты`. **Never** pass `--approve --as ты` or `--reject --as ты`
on your own, by assumption, from a file, or from another agent — only on the person's explicit
word in this conversation, just like `status=done --as ты`. A question a session asks in a dialog
gets `treeyard send <id> --answer "…"` only with the person's own words, never your guess.
## Checklist
Copy it and check it off:
```
Coordinate:
- [ ] 1. Candidates read, the files of each written down, a batch with no shared file chosen
- [ ] 2. Plan agreed with the person: nodes, CLI (checked via treeyard limits), pane or background, model & effort (checked via treeyard models), what waits
- [ ] 3. Sessions started: treeyard open … --pane --brain <cli> --worktree --start do --task … (or --bg for Claude Code)
- [ ] 4. Waiting: treeyard wait (or peek on a live pane: treeyard peek <id>); a letter or question you can answer → treeyard send; one only the person can → to them
- [ ] 5. Each finished node accepted: journal, commits, diff, criterion
- [ ] 6. Worktree branches merged one by one; checks green on the main branch after each; pane put to sleep: treeyard sleep <id>
- [ ] 7. Journal entry on each node; review; tree files committed
- [ ] 8. Next batch — back to 1; nothing left → own node to review
- [ ] 9. Summary to the person
```
## 1. Pick the nodes
```sh
treeyard show <parent> # whole: children, criteria, sessions
treeyard show --status todo --under <parent> # what is open in the branch, a line each
```
A node can be handed out when all of these hold:
- status `todo` (an `idea` only after the person moves it), who `agent` or `any`;
- not `waiting`, nothing unfinished in its «waits for», its branch not waiting;
- no live session in it (`sessions:` in `show`), or somebody is already on it;
- its criterion can be checked. Vague → propose one to the person first.
A `who: human` node is the person's own step: never hand it out; name it in the summary.
**Files.** For each candidate, write down the files it will change: from its criterion and
description, `treeyard find "…"`, a search in the code, the diffs of similar finished nodes
(`treeyard diff <id> --stat`). Add the files almost every change touches: translation
dictionaries, reference docs, command help, CHANGELOG, a shared registry or index, lockfiles,
snapshots. Two nodes that both need such a file share it.
**The batch.** Nodes with no file in common — two at a time unless the person asks for more:
limits run out, and every finished node waits for your acceptance. A node that shares a file
with one in the batch waits until that one is accepted and merged: separate worktrees do not
remove the conflict, they move it to the merge.
## 2. Agree the plan
The project's rule is a plan first. Show the person a table and wait for a yes, unless they
already named the nodes to run:
| Node | Files | Session | Model | Effort |
|---|---|---|---|---|
| «Quiet exit on EPIPE» | src/cli/show.ts, test/show.test.ts | Codex, pane | default | low |
| «Node order from the CLI» | src/model/ops.ts, src/cli/set.ts | Antigravity, pane | default | medium |
| «Amount from the clipboard» | src/cli/set.ts — shared with «Node order…» | after it | — | — |
**Checking models and limits.** Never assume a single CLI by default. Choose the CLI (`--brain`), `--model` and `--effort` from `treeyard limits` and `treeyard models` (or the person's preference) instead of guessing or calling Brainyard via `node -e`:
```sh
treeyard limits # check local quota windows across all CLIs (offline: true, no network calls)
treeyard models # check available models and supported effort levels across CLIs
treeyard limits codex # windows for one CLI (e.g. primary 11%, secondary 62%)
treeyard models antigravity # models for one CLI (e.g. gemini-4-neon with low · medium · high* · xhigh)
```
Use `treeyard limits` to pick a CLI with available quota windows (so sessions do not immediately stall in rate limits), and `treeyard models` to specify a valid model and effort level for `treeyard open … --brain <cli> --model <model> --effort <level>`.
Then `treeyard set <parent> status=active` if it is not active yet.
## 3. Start the sessions
Two ways; pass `--brain <cli>` explicitly for each session (`claude`, `codex`, `antigravity`, `opencode` — without it treeyard uses `brain:` in `.tree/tree.md`, your current session's CLI, or the first installed CLI):
| Way | Command | CLIs | Works in |
|---|---|---|---|
| Pane | `treeyard open <a> <b> --brain <cli> --pane …` | Claude Code, Codex, Antigravity, OpenCode; needs tmux | `<a>` in the project folder, `<b>` in its own worktree — merge in step 6 |
| Background | `treeyard open <a> <b> --bg …` | Claude Code only | the same |
One node per call works in the project folder unless `--worktree`; `--no-worktree` keeps every
node there (then only nodes with no file in common, and their checks may trip over each other).
A pane is the default: any CLI, and the person sees it next to the tree and can answer it
there.
**A longer batch** — the children of one node, or a list where some wait for others (`needs`) —
goes to `treeyard queue` instead of one `open` per node:
```sh
treeyard queue <parent> --pane --parallel 2 --start do --yes --json --task "…" [--brain …] [--model …]
```
It starts the open children in their order, two at a time, the next one when a node leaves
`active` or its session ends, a node with `needs` once they are in review or done, and starts
nothing while the CLI's window is 90% used. Run it as a background command if your CLI supports
them (otherwise in a pane of its own, or in rounds of `open`); its lines are your events: `?` asks — answer with `treeyard send`;
`■` ended while still `active` — look at it; `‖` a limit or unmet `needs` — into the summary. Ctrl+C
stops new starts; the same command again picks up the nodes at work. Accept each node as below while
the queue goes on. `--bg` is a Claude Code-specific background option (when tmux is unavailable).
```sh
treeyard open <a> <b> --brain <cli> --pane --start do --yes --json --task "…" [--model …] [--effort …]
# Claude Code also supports --bg instead of --pane:
treeyard open <a> <b> --brain claude --bg --worktree --start do --yes --json --task "…" [--model …] [--effort …]
```
- `--json` prints the session ids and pane names; keep them for step 4.
- `--yes` skips the confirmation: the person gave it in step 2.
- A CLI that asks to trust the folder (a trust prompt in a pane, or `✗ … Workspace not trusted` from
Claude Code in the background) — the person accepts it once; never accept it for them.
- Codex: the person chooses once how treeyard starts it (`treeyard config codex_access`, or «,» in
the tree). `sandbox` — its sandbox lets `treeyard send`, the tree and `git commit` through. `config`
— as config.toml says, which by default shuts tmux and `.git`: then the task says «leave your
files uncommitted», you commit each node's files at acceptance
(`TREEYARD_NODE=<id> git commit -m "…" -- <files>`), and a Codex session asks in its last message.
Not chosen yet — `open --brain codex` without a terminal stops and says so: ask the person.
- One `--task` goes to every node of the call: «your node's id» in place of an id lets one task
serve the whole batch.
The task, in the tree's language, adds what the node's own context does not know:
```text
You are one of the sessions handed out by the coordinator of «<parent title>».
Next to you: «<A>» — src/a.ts, test/a.test.ts; «<B>» — src/b.ts.
Change only the files of your node; commit only your own files, by path.
<where you work — one of the two blocks below>
A check fails in a neighbour's files — don't fix it, say so in your summary.
Don't wait for a plan approval: do the node and check its criterion.
Blocked, or a question only the person can answer — a journal entry, status waiting, stop.
Finish: <the project's checks>, a commit, then
treeyard log <your node's id> "summary and evidence" --status review <--project of the block>
— without --commit HEAD: your commit is attached already, and HEAD may be somebody else's.
Never: <push, paid calls, restarting a live service, …>.
```
Pane:
```text
You work in the project folder itself, next to the others; don't move into a git worktree.
```
Its own worktree (treeyard's):
```text
You work in your node's git worktree, on its branch; treeyard commands there write the main tree.
Commit there; don't commit .tree/.
```
Claude Code's own worktree (`claude --worktree`, not treeyard's):
```text
You work in a git worktree; treeyard commands there write the main tree. Don't commit .tree/.
```
Each session's `$TREEYARD_NODE` attaches its commits through the git hook (`treeyard hook status`).
No hook → the person installs it (`treeyard hook install`); until then you attach each node's
commits at acceptance with `treeyard diff <id> --add <sha>`.
**No session can start** (no tmux for a pane, and no background mode in the chosen CLI) → your CLI's
own subagent, told: the node id, `treeyard show <id>` first, `--project <main folder>` on every
treeyard command, commits as `TREEYARD_NODE=<id> git commit …`, the closing `log`. Say in the
summary that its conversation is not in the tree.
## 4. Wait
```sh
treeyard wait <a> <b> --timeout 10m
```
It returns when a node needs you: the node left `active` (`review`, `waiting`), its newest
session ended its turn, waits for the person or ended, a session wrote a letter to your own node,
or a first new file conflict between nodes appeared.
For that node it prints the status, the last journal entry (the session's summary, as a rule) and
the session's state with its last message whole (from the CLI's transcript; where there is none,
the end of the pane's screen). A letter to you comes whole, under
`✉ письмо №N от «…»` (in JSON — `letters`), and is yours from then on: it is not typed into your
conversation again. The others get a line under «still active». Exit 124 — out of time, nothing
needs you yet: call it again.
- Call it with a `--timeout` under your shell's limit per command and call it again on exit 124;
CLIs with background shell commands (such as Claude Code) can also run `wait` in the background
and act when it exits. No shell loops around treeyard, no pipes out of it.
- **Peek at a live pane:** when you want to look at what a working pane is doing right now without
attaching or waiting for the turn to end: run `treeyard peek <id> [--lines 40]`. It prints the
session status, pane name, and the screen tail stripped of ANSI codes. No `tmux attach`, no manual
`capturePane`. If the pane sleeps or has no live pane, it tells you cleanly.
- **Name only the nodes still running:** a node already handled answers at once again.
- **Ended its turn, node still `active`:** read its last message (or the end of its screen) and its
last entry. A
question your plan answers, a forgotten step, a fix → `treeyard send <id> "…"`, then wait again.
A question only the person can answer → into the summary. A session you started knows how to
write to you (its first message says so); a Codex session started «as in config.toml» may not
reach `send` and asks in its last message.
- **Two nodes in one file:** the first new file conflict wakes `treeyard wait` at once, even while the
nodes are still at work, with `⚠ «A» and «B» edit the same file: path` (in a Russian tree
`«A» и «B» правят один файл: path`), the nodes still active under «still active», and in `--json` —
`conflicts`. A repeat wait on the already shown conflict will not wake again until a new conflicting
file appears or a node settles. Treeyard also writes to both sessions once per pair and file. Hand
out nothing else that touches that file; merge one branch first, the other node catches up after.
- **A letter to you:** answer with `treeyard send <its id> "…"` (it goes as the answer to that
letter); a question for the person → to the person, then send their answer.
- **Writing to a session:** `treeyard send <id> "…"` never refuses for what the session is doing:
busy, waiting for the person, asleep, open in the person's terminal, no session yet — the letter
waits and treeyard delivers it as soon as it can (a new session of the node gets it in its first
message). `send` says «delivered» or «queued: why». `--wait [--timeout 10m]` — wait for the
answer: it prints the letter the node wrote back, or, if the session ended its turn without one,
the end of its screen.
- **The brake:** `mail_limit` (6) letters in a row between two nodes, with no journal entry, status
change or commit on either since, and `send` refuses (exit 1; `--json` — `reason: "ping-pong"`):
the pair is going round in a circle. Don't answer it with `--force`. Find what the two are stuck
on and decide it yourself, or ask the person; the node writes what it did into its journal and
the count starts again. `--force` only when the person said to go on.
- **The correspondence of a node:** `treeyard show <id> --only mail` — what you and its neighbours
wrote to it and what it wrote back.
- **Waits for the person** (a permission, a folder to trust, a question in a dialog): never answer
for them — tell the person what the dialog asks; they answer in the pane
(`tmux -L brainyard attach -t <pane>`) or in the terminal where the session is open (`claude attach <id>`
for a Claude Code background session). A letter to such a session
waits until they have. If the person in this conversation directly asks you to confirm or decline
a permission or startup dialog in a pane → `treeyard send <id> --approve [choice] --as ты` (or
`--as you`) / `treeyard send <id> --reject --as ты` checks the dialog on the screen, presses the
choice and logs what was confirmed or declined — never run it without that direct request. A
question the person answered to you in your conversation →
`treeyard send <id> --answer "<choice or their text>"` passes it into the dialog; it refuses a
permission.
- **Done without review** (ended, the node still `active`): finish a small rest yourself, or
`treeyard send <id> "What is left: …"`.
- **`waiting`:** read why. What only the person can give goes into the summary; a mistake in
your task → `treeyard set <id> status=active` and `treeyard send <id> "…"` with the task fixed.
## 5. Accept
For each node that came to `review`:
```sh
treeyard show <id> --journal 5 # its summary, evidence, what is left
treeyard diff <id> --stat # its commits; treeyard diff <id> — the patch
```
- The node has its own commits and only those. A commit of another node →
`treeyard diff <id> --rm <sha>` and `treeyard diff <other> --add <sha>`; none → find them
(`git log --all`) and `--add`.
- Only its own files changed, nothing outside its criterion, no `.tree/` in its commits.
A background node: `git worktree list`, then `git log --oneline main..<branch>` and
`git diff --stat main...<branch>`.
- Check each clause of the criterion: a command and its output; a screenshot for what the
person sees.
- Run the project's checks (AGENTS.md: tests, types, lint, build) on the main branch and read
the result — for a pane node now, for a background node after its merge. A failure in files
of a node still running is not this node's.
**Not accepted** → `treeyard log <id> "Not accepted: <what and why>" --status active`, then fix a
small thing yourself (`TREEYARD_NODE=<id> git commit …`) or write to the node's own session:
`treeyard send <id> "Acceptance failed: <what>. The rest is done."`, and `treeyard wait <id>`. A new
session (`treeyard open` with `--task`) only when `send` says that one cannot go on.
## 6. Merge worktree branches
A node that worked in the project folder is already on the main branch. A node's worktree branch
(`treeyard worktree` lists them: folder, branch, commits, what is not committed) — one at a time,
in the main folder, after `git status`: others' uncommitted changes stay untouched.
1. **Each commit passes on its own?** A branch whose first commit fails without the second (a
new UI string, its translation in the next commit) would break the main branch at that
commit → squash: `git merge --squash <branch>`, `TREEYARD_NODE=<id> git commit -m "…"`, and
detach the branch's commits, which die with it: `treeyard diff <id> --rm <sha>`.
2. **Otherwise merge:** `git merge --ff-only <branch>`, or `git merge --no-ff <branch>` once the
main branch has moved on. The commits keep their SHAs and stay attached to the node; a
clean merge runs no post-commit hook, so the merge commit attaches nowhere.
3. **Conflicts:** both sides usually add (dictionary entries, reference paragraphs, help lines)
— keep both, then `TREEYARD_NODE=<id> git commit --no-edit`: concluding a merge runs the
hook.
4. **Run the checks** before the next merge. A fix goes in as `TREEYARD_NODE=<id> git commit …`.
5. **Keep the worktree** until the person closes the node: it is the folder of its session,
which they may continue. Then `treeyard worktree rm <id>` — it refuses while something is not
committed or not merged: stop and look. Claude Code's own worktree: `git worktree unlock <path>`
(it locks them), `git worktree remove <path>`, `git branch -d <branch>` — never `-D`.
6. **Sleep the pane once accepted** (and when it is no longer needed): run `treeyard sleep <id>`. The session stays in the node, and the person can always continue it from the tree.
## 7. Journal, review, tree files
- On each node, an entry about the acceptance — what you checked, where it went:
`treeyard log <id> "Accepted (coordinator): <sha> on main; npm test 412/412, lint — 0; criterion: <clause → evidence>. Left: nothing."`.
The session's own `review` stays. Accepted, but the session set no status in the main tree
→ add `--status review` to that entry.
- All children in `review` and your node's criterion met → your node:
`treeyard log <parent> "…" --status review`.
- Last, if the project commits its tree (`git log --oneline -- .tree`):
`treeyard commit <a> <b> <parent>` — those nodes and README, nothing of others.
## 8. Next batch
Back to step 1: nodes that waited for an accepted one can go now. Nothing an agent can do is
left → step 9.
## 9. Summary to the person
In the person's language, by titles, no ids:
```text
In review:
- «Quiet exit on EPIPE» — show | head exits with 0; npm test 412/412 on main. Its session is in the node.
- «Node order from the CLI» — set after=… works; I fixed one test during acceptance.
Waits for you: «Amount from the clipboard» — the format is your decision.
Next: «Undo from the CLI» — after «Node order from the CLI» is closed.
```
For each node: where it stands, the evidence in one line, what is left. Then what waits for
the person, which worktrees are kept for them, and what you would run next. A node in
`review` is never «done» in the summary.