herdr-fleet
Run several coding agents in parallel in herdr panes, each under its own clausona profile (another Claude Code or Codex account, or an API model such as GLM or DeepSeek), then watch them, check their work and retire them. Use when the user works in herdr and wants work spread across accounts or models, when one account's limits would slow a fan-out, or says "split this across my accounts in herdr", "run these on DeepSeek in herdr".
- License 许可
- MIT
- 最近更新
- 2026-11-12
- Stars
- ★ 61
- Forks
- 11
01 前言 Front Matter
- name
- herdr-fleet
- description
- Run several coding agents in parallel in herdr panes, each under its own clausona profile (another Claude Code or Codex account, or an API model such as GLM or DeepSeek), then watch them, check their work and retire them. Use when the user works in herdr and wants work spread across accounts or models, when one account's limits would slow a fan-out, or says "split this across my accounts in herdr", "run these on DeepSeek in herdr".
03 SKILL.md 正文
herdr fleet on clausona profiles
herdr runs agents in panes and shows their state in its sidebar. clausona puts each pane's agent on the profile you choose.
0. Load the shared rules
Load the fleet-core skill first and follow it; this skill only adds the herdr steps. In Claude
Code, invoke it with the Skill tool. If that fails, or you run in Codex, read the first of these
files that exists, where <base> is this skill's base directory:
<base>/../../../fleet-core/skills/fleet-core/SKILL.md<base>/../../../../fleet-core/*/skills/fleet-core/SKILL.md(if several versions match, read the highest)
If none exists, stop and tell the user to install it: claude plugin install fleet-core@clausona
in Claude Code, or codex plugin add fleet-core@clausona in Codex.
1. Before anything
Stop and tell the user what is missing if any of these fails.
- You run inside a herdr pane:
HERDR_ENVis1(test "${HERDR_ENV:-}" = 1; in PowerShell,$env:HERDR_ENV -eq '1'). herdr's CLI talks to the session of the pane it runs in. Do not control herdr from outside it. In Codex,HERDR_ENVis also unset when Codex hides the environment (fleet-core, Shells). If it does, do not tell the user they are outside herdr: tell them to start Codex again in this pane with-c shell_environment_policy.inherit=all. herdr statusshows a running server. Before a command group's first use, run the group alone (herdr worktree,herdr workspace,herdr agent,herdr pane) to see its current syntax. Never run bareherdr: it starts the interface.- The repo has a remote: workers push their branches.
herdr commands print JSON. Read ids and paths from it; never guess them. herdr runs on macOS, Linux and Windows, and the commands below are the same on each.
2. Starting a worker
For each task, after fleet-core picked its profile:
-
Worktree.
herdr worktree create --cwd <repo> --branch fleet/<task> --label "<task> · <profile>" --no-focus. Keep the label to 20 characters or fewer, with a short task word such asdocs · ds-flash: herdr's agents list cuts longer labels, and the profile at the end is what shows which account runs where. Record.result.workspace.workspace_id,.result.root_pane.pane_idand.result.worktree.path. The worktree lands under~/.herdr/worktrees/. -
Start.
herdr pane run <pane> "clausona run <profile> -- <args>", with the arguments fromfleet-coresection 4. Codex workers keep--disable hooks. -
Check it started. Within 20 seconds,
herdr agent listshows the pane with agentclaudeorcodex. If not, read the pane (herdr pane read <pane> --source recent-unwrapped --lines 60). If the launch line never ran, for example because the shell was still starting, run it once more. Otherwise tell the user what the screen shows. -
Name it.
herdr agent rename <pane> <name>, with a name such asw1-docs: lowercase letters, digits,-or_, starting with a letter, up to 32 characters. Use the name from now on. -
Folder trust. The first worker of a profile in a repo that profile never trusted asks whether to trust the folder, and herdr shows it as
blocked. Read the screen (herdr agent read <name> --source visible) and answer only that question, and only about this repository:- Claude Code ("Is this a project you created or one you trust?"): the highlighted answer is
"No, exit". Send
herdr agent send-keys <name> down enter. - Codex ("Trust this folder?"): the highlighted answer is "1. Trust and continue". Send
herdr agent send-keys <name> enter.
Then
herdr agent wait <name> --until idle --until done --timeout 60000. A plainagent waitright after the keys returns the oldblockedstate. - Claude Code ("Is this a project you created or one you trust?"): the highlighted answer is
"No, exit". Send
-
Brief. Write it as
fleet-coresection 5 says, then send and wait in one command:herdr agent prompt <name> "Read .fleet-brief.md in this folder and do what it says." --wait --timeout 1800000. In Claude Code, run it as a background task (section 3). In Codex, use the Codex form in section 3 instead. -
Record the name, pane, workspace, worktree, branch and profile in the table.
Start workers on the same Claude Code profile one at a time, each after the previous one shows its first output.
The user can switch to any worker's pane in herdr, read along and type into it at any time.
3. Waiting and reading
- Send and wait: every brief and follow-up goes out as
herdr agent prompt <name> "<one line>" --wait --timeout 1800000. It waits until the worker has started its turn and then settles:doneoridlewhen the turn ended,blockedat a prompt or question. Do not send with a plainagent promptand then callagent wait: a worker that has not picked up the prompt yet is stillidle, and the wait returns at once. - Until it works again (a worker the user is answering):
herdr agent wait <name> --until working --timeout 1800000, thenherdr agent wait <name> --until idle --until done --until blocked --timeout 1800000. - The reply: herdr keeps no record of what a worker said, and Claude Code in full-screen mode
leaves nothing above the screen to read. So for a Claude Code worker, read its last reply with
fleet-core'slast-reply.mjsand the worktree path from section 2 (fleet-coresection 8), before its screen. - Read:
herdr agent read <name> --source recent-unwrapped --lines 120. If the reply scrolled away, use--source visible. - Follow-up: write the file, then
herdr agent prompt <name> "Read .fleet-followup-<n>.md in this folder and do what it says." --wait --timeout 1800000.agent promptrefuses an agent at a prompt (agent_blocked); read its screen first. - After a
timeout: read the screen. If the worker still works, wait again withherdr agent wait <name> --timeout <ms>, which matchesidle,doneorblocked. Never send the line again just to wait: the worker would get it twice. - In Codex (one foreground wait at a time, three minutes each): give every worker its brief
before you wait on any. Send each with
herdr agent prompt <name> "<one line>" --wait --until working --until blocked --timeout 20000, which returns once the worker has picked the line up. Then wait on each unfinished worker in turn withherdr agent wait <name> --timeout 180000, and read it when the wait returns.
A timeout or agent_prompt_stalled does not prove a prompt was lost. Read the screen before
sending again.
4. When an account runs out
herdr pane split <old pane> --direction down --cwd <worktree> --no-focus, and read the new pane id.- Start the new profile there, as in section 2, steps 2 to 6, with
fleet-coresection 9's brief. Name the new agent with a new suffix, such asw1-docs-2: the old one still holds its name. herdr pane close <old pane>.herdr workspace rename <workspace> "<task> · <new profile>", with the workspace id from section 2, so the sidebar names the new account. Keep the label to 20 characters or fewer, as in section 2.
5. Retiring
After fleet-core section 11's checks, run herdr worktree remove --workspace <id>. Never add
--force. herdr refuses a worktree with changes (dirty_worktree_requires_force); then keep the
worker and report why. When it succeeds, it closes the workspace and its panes and keeps the
branch. Confirm the worktree directory is gone.
Never close panes, tabs or workspaces you did not create. The workspace herdr opened for the repo itself stays.
04 同仓库更多 Skills
tmux-fleet
Run several coding agents in parallel in tmux windows, each under its own clausona profile (another Claude Code or Codex account, or an API model such as GLM or DeepSeek), then watch them, check their work and retire them. Use when the user works in tmux, on their own machine or over SSH, and wants work spread across accounts or models, when one account's limits would slow a fan-out, or says "split this across my accounts in tmux", "run these on DeepSeek in tmux windows".
superset-fleet
Run several coding agents in parallel in Superset workspaces, each under its own clausona profile (another Claude Code or Codex account, or an API model such as GLM or DeepSeek), then watch them, check their work and retire them. Use when the user wants work spread across accounts or models in Superset, when one account's limits would slow a fan-out, or says "split this across my accounts", "run these on GLM in Superset", "my account is near its limit, keep the workers going". Builds on superset:orchestrate.
routing
Run Claude Code or Codex on whichever clausona account has quota left, using clausona routes, and create, change or explain those routes, and the dir rules and defaults that pick one for a plain `clausona run claude`, for the user. Use when the user says "run this on an account with room", "spread these across my accounts", "make a route of my work accounts", "use my work accounts in this repo", "why did it pick that account", "wait until an account frees up", when a run stops on a usage limit (of the plan or of one model, such as Opus), when writing a script or cron job that runs on a route, or when starting several workers that should not all land on one account.
orca-fleet
Run several coding agents in parallel in Orca worktrees, each under its own clausona profile (another Claude Code or Codex account, or an API model such as GLM or DeepSeek), then watch them, check their work and retire them. Use when the user works in Orca and wants work spread across accounts or models, when one account's limits would slow a fan-out, or says "split this across my accounts in Orca", "run these on DeepSeek in Orca".
fleet-core
Shared rules for the clausona fleet skills (superset-fleet, herdr-fleet, orca-fleet, tmux-fleet). Load it only when one of those skills tells you to; it is not a task on its own.