herdbot runs a team of persistent AI bots on your own machine, using the coding-agent subscriptions you already pay for. Each bot lives in its own herdr workspace. When a bot delegates work, the subagent opens in a pane next to it, so you can watch every agent and step in when one needs you. A router decides which harness (claude, codex, cursor-agent or pi) and which model takes each task. When one subscription hits its limit, the work moves to the next.
I built it because I had a roster of bots in Grok Bot and wanted the same setup running locally and spread across my subscriptions. herdbot can import that roster and run alongside Grok Bot, but it doesn't need it.
This is early, and it's macOS only for now (the daemon runs under launchd). What works so far, verified live on 2026-10-20:
- bots with their own workspace, instructions, memory and skills folders
- subagents in panes, with results delivered back to the bot that asked
- bot-to-bot messages, which wait until the receiving bot is idle
- cron schedules
- routing across claude, codex and pi, plus failover when a harness hits a quota or auth limit
- a one-way import of the Grok Bot roster
- herdbot working on its own repo through a
herdbot-devbot - rooms (group bots) with channel, round-robin and moderated turn-taking, verified live on 2026-10-20
- computer use through cua (local; verified 2026-10-20)
Not built yet: importing Grok Bot's schedules and skills (they aren't stored on disk). The menu bar app (status menu, ⌥Space quick entry, a chat window for bots and rooms, a first-run setup window and approval cards) ships in Herdbot.app; see Install. cursor-agent launches, but its tools haven't been seen working end to end. Release 0.1.2, 2026-10-22.
- macOS
- herdr running. Tested with 0.9.1, socket protocol 22.
- Rust with edition 2024 support, only to build from source
- at least one harness CLI on your
PATH, signed in:claude,codex,cursor-agentorpi(pi is restricted to theopencode-goprovider)
Install with Homebrew:
brew install --cask slogsdon/tap/herdbotOpen Herdbot from Applications and use its setup window, or run herdbot setup in a terminal.
The zip from GitHub Releases works the same way:
drag Herdbot.app to Applications, open it, and press Set up everything.
cargo install --path crates/herdbot
herdbot setup
# Accept the starter-bot prompt to create helper.
$EDITOR ~/Bots/helper/BOT.md
herdbot send helper "What can you do?"herdbot setup checks herdr and the harness CLIs, creates ~/Bots and a commented herdbot.toml, links the CLI, installs the launchd service and offers a starter bot. The daemon delivers messages, so send needs it. The bot's workspace opens in herdr the first time a message arrives.
Herdbot records the main agent's herdr terminal ID at launch. herdbot up, daemon
startup polling, and message delivery check that identity. An idle/done agent with a
missing or different ID is replaced in a fresh pane with Herdbot's normal environment,
MCP configuration and hooks. Working, blocked and unknown agents wait until idle/done.
The daemon logs one recovery <bot> line for each completed recovery.
When herdr reports a harness session, recovery retains the recorded route when available
and adds resume <id> for Codex, --resume <id> for Claude, or --session <path> for Pi.
A missing session, unsupported harness, or route fallback to a different harness starts a
fresh conversation. Launch instruction turns that request READY remain excluded from
chat history. Existing state without a terminal ID is migrated through the same recovery.
For a signed release, install the x86_64-apple-darwin Rust target, have a Developer ID Application
certificate in the login keychain, and create a notarytool keychain profile. The tap checkout is
optional; the script prints the rendered cask if TAP_DIR is unset. Then run:
SIGN_IDENTITY="Developer ID Application: … (TEAMID)" NOTARY_PROFILE=herdbot-notary scripts/release.shscripts/release.sh --dry-run --no-notarize builds and signs without uploading or notarizing;
scripts/test-release.sh is the universal dry-run smoke test and needs both Rust targets.
Other commands:
herdbot --version print the installed version
herdbot doctor [--json] first-run and health checks (exit 1 if any fail)
herdbot setup [--yes] [--only home|cli-link|service|restart-daemon] fix what doctor reports
herdbot uninstall [--purge] remove the service and the herdbot link; --purge also deletes the home
herdbot import-template <url> [--name NAME] [--cwd DIR] [--class CLASS] [--paste FILE] [--dry-run] [--json]
herdbot new <name> [--cwd DIR] [--class CLASS] [--instructions TEXT] [--json]
herdbot list | runs bots and subagent runs
herdbot config list [--bot BOT] [--json] supported settings, values and when they apply
herdbot config get <key> [--bot BOT] [--json] one setting
herdbot config set <key> <value> [--bot BOT] [--json] validate and write one setting
herdbot config unset <key> [--bot BOT] [--json] remove one setting (its default applies)
herdbot status --json one snapshot of bots, runs, cooldowns and blocked agents
herdbot watch --json NDJSON: a snapshot line, then changes (for UIs)
herdbot history <bot|room:NAME> --json [--before N] [--limit L] a conversation's items, newest page first (for UIs)
herdbot collaborate --json accept one stable-ID multi-target request on stdin
herdbot focus <agent> focus an agent's pane in herdr
herdbot up <bot> | down <bot> start or stop a bot's workspace
herdbot room new <name> --members a,b[,c] [--mode channel|round_robin|moderated] [--moderator BOT] [--json]
herdbot room send | list | up group conversations between bots and you
herdbot task <bot> <class> <prompt…> start a subagent from the shell
herdbot route <class> [--bot BOT] which harness:model a task class resolves to
herdbot import-grok import the Grok Bot roster once
herdbot service install install and load the launchd service
herdbot service disable | enable stop or start it; keep the plist and CLI link
herdbot service status | uninstall inspect or remove the service
Set HERDBOT_HOME to keep bots somewhere other than ~/Bots. HERDBOT_LINK_DIR is a test hook for choosing the CLI-link directory.
herdbot daemon ──── NDJSON/UDS ────► herdr server (~/.config/herdr/herdr.sock)
· delivers queued prompts │ workspace "🤖 <Bot>" per bot
when the target is idle ├─ root pane: main agent "<slug>" (claude|codex|pi|cursor)
· watches subagent runs ├─ split pane: subagent "<slug>-<run>"
· fires schedules └─ split pane: subagent "<slug>-<run>"
· re-imports the Grok Bot roster │
│ each agent launches
herdbot mcp --bot B [--run R] ◄─────────────┘ (stdio MCP, all harnesses)
│ reads/writes
▼
$HERDBOT_HOME (~/Bots): bot.toml, BOT.md, .runs/, .queue/, .state/
There are two crates. herdr-client is an async client for the herdr socket. herdbot is a single binary that serves as the CLI, the daemon, the stdio MCP server the harnesses call, the tool entry point for shell debugging, the router, and the Grok Bot importer. There's no orchestrator socket and no database. Every process reads and writes the same plain files, and only the daemon prompts agents.
routing.toml # written from the repo default on first use; edit freely
herdbot.toml # [paths] rewrites, e.g. "/workspace/obsidian-vault" = "~/…"; [cua] host/command for computer_use
<slug>/bot.toml # name, title, cwd?, class?, source = grok|local, grok_id?, [[schedules]]
<slug>/BOT.md # instructions; overwritten by Grok sync when source = "grok"
<slug>/BOT.local.md # local additions, appended, never overwritten
<slug>/memory/ skills/
<slug>/turns.jsonl # main-agent prompt/reply pairs, from turn hooks
<slug>/chat/main.jsonl / tree.jsonl # memory log and summary tree, memory bots only (see Memory)
.state/<slug>.json # workspace_id, root_pane, agent, route
.state/launch/<agent>.md / .mcp.json / .settings.json # instructions, MCP config and hook settings handed to the harness
.state/cooldown/<harness>.json # set when a harness hits a quota or auth limit
.state/events/<agent>.jsonl # hook events waiting for the daemon (see Turn hooks)
.state/rooms/<slug>.json # the daemon's routing state for the room
.state/memory/<slug>.json / .nodes.jsonl # memory state (a cache) and the write_node inbox
.state/daemon.lock the daemon's single-writer lock (see Memory)
.state/fm/ schemas handed to fm
.state/daemon.log # daemon output when it runs as the launchd service
.runs/<id>.json # one subagent run
.queue/<agent>.jsonl # prompts waiting for that agent to be idle
rooms/<slug>/room.toml # a room: members, mode, limits (see rooms.rs)
rooms/<slug>/transcript.jsonl / .md # the conversation (append-only) and its rendering
A bot's instructions are a short herdbot preamble followed by BOT.md and BOT.local.md. claude gets them through --append-system-prompt-file and pi through --append-system-prompt. codex and cursor have no flag I could verify, so they get the instructions as their first prompt.
Pi keeps --no-extensions and explicitly loads herdr's lifecycle extension at ~/.pi/agent/extensions/herdr-agent-state.ts when installed, so its status does not depend on the pane width. A missing extension is silently skipped; install it with herdr integration install pi.
In the chat window sidebar, + → New Bot… / New Room… opens the creation form. Bot fields are name, optional working directory (with a folder picker), task class and multi-line instructions. Rooms pick at least two existing bots, a mode and, for moderated rooms, a moderator from the selected members. Create is disabled for incomplete forms and while saving; CLI errors stay inline with the draft intact. Success closes the sheet and opens the new conversation; the existing watch stream updates the sidebar. Return submits (the instructions editor uses Return for newlines); Escape cancels. Cancelling a running request closes the sheet but does not undo creation. + → Import Template… previews a public Grok Bot URL, shows the fetched content and components withheld by the page, accepts pasted content, then uses the same name, working directory and task class fields. Preview and Create show progress; failures keep the draft. Changing the URL requires another preview.
herdbot new --instructions TEXT writes TEXT verbatim to BOT.md, including newlines; quote it as one shell argument. - is literal text, not stdin. Omit the option for an empty file. --json prints only {"slug":"helper","path":"/path/to/home/helper"} for a bot or {"slug":"crew"} for a room; without it the existing human-readable output is retained. For example:
herdbot new helper --class explore --instructions 'Review the repository and report findings.' --json
herdbot new reviewer --class review --json
herdbot room new crew --members helper,reviewer --mode moderated --moderator helper --jsonImport a public Grok Bot template or marketplace detail page:
herdbot import-template https://x.ai/bot/marketplace/bots/alfred --dry-run
herdbot import-template https://x.ai/bot/p7Gh6HIrfv4AGzIow6-9X --name 'Alfred Copy' --paste template.txt --jsonOnly https://x.ai/bot/<id> and https://x.ai/bot/marketplace/bots/<slug> are accepted. Fetches use /usr/bin/curl, HTTPS only, no redirects, no cookies or cache, a 20-second timeout and a 5 MiB limit. --dry-run prints preview JSON and writes nothing; successful --json returns { "slug", "path" }. A changed or incomplete page fails with “the template page has changed; paste the template instead”. The URL remains required for provenance; paste supplements a readable preview. If the page cannot be parsed, make a manual copy through New Bot → Instructions or herdbot new NAME --instructions TEXT.
The public share page supplies name and description; marketplace pages also supply rendered memories. Skills, routines and integrations may be labels only: the preview names what was not imported. Copy the missing prose from the source app into the paste field, or a UTF-8 file for --paste. Use explicit headings (one skill/routine per heading):
## Instructions
Instructions to use verbatim.
## Memories
Facts to retain.
## Skill: Review
Description: Review a change.
Read the diff and report concrete findings.
## Routine: Weekly review
Cron: 0 9 * * 1
Review this week's work.
## Integrations
Calendar (configure separately).
Description: and Cron: are optional. A routine without a cron stays prose in BOT.md; a supplied valid cron creates a disabled schedule. Unsupported headings and fenced code are rejected. Paste prose only; do not paste credentials, executable code or scripts. Nothing installs integrations or executes pasted content during import.
Imports are local copies (source = "local"), with template_url, template_source = "grok", template_fetched_at and template_components in bot.toml. Instructions/description precede provenance in BOT.md; the file also indexes imported skills/*.md and preserves routines as prose. Memories go to memory/imported-YYYY-MM-DD.md, never OptChat's .state/memory; OptChat memory remains off. Existing bots are never overwritten. Grok roster sync preserves the template copy; a same-name roster bot receives a separate -grok (or numbered) slug. There is no URL refresh or private API access.
A bot's cwd defaults to its own folder. You can point it at a repo instead, for example herdbot new herdbot-dev --cwd ~/Code/herdbot.
Path rewrites. [paths] in herdbot.toml maps strings in the instructions to local paths. ~ expands to $HOME and the longest match wins. Rewrites happen when a bot launches, so BOT.md stays exactly as Grok Bot wrote it and an edit takes effect on the bot's next start. Grok Bot's /workspace/obsidian-vault becomes the bot's cwd if you don't map it.
Run from an installed binary. Every MCP config and pane records the path of the running herdbot. If the daemon ran from target/debug, a bot that rebuilds herdbot would swap the binary out from under its own subagents. That's why service install refuses to run from target/. After a cargo install, restart the daemon onto the new binary with launchctl kickstart -k gui/$(id -u)/dev.herdbot.daemon.
The service. herdbot service install writes ~/Library/LaunchAgents/dev.herdbot.daemon.plist and loads it. herdbot service disable stops the daemon and records a launchd override, so it stays off across logins; the plist and CLI link stay, so herdbot service enable loads the same installation again, and herdbot service status says installed but not running meanwhile. herdbot setup --only restart-daemon loads a disabled service again before restarting it. herdbot service uninstall removes the launchd job and plist; it does not delete bot or memory data. The plist records the binary path as invoked, without resolving symlinks. The daemon starts at login and restarts 10 s after any exit, which includes the times herdr isn't running yet. launchd and the menu bar app start with a bare PATH, so the plist records the process PATH plus the interactive login shell's PATH (zsh or bash, cached for 10 minutes in .state/shell-path.json) and the usual install directories, along with HERDBOT_HOME and HERDR_SOCKET. The effective PATH is the same whether setup runs in a terminal or from the app. Setup waits up to 15 seconds for the daemon to answer. herdbot doctor flags a daemon older than the binary on disk; restart it with herdbot setup --only restart-daemon.
herdbot config reads and writes the supported settings in TOML so a UI can present and change them without parsing files itself. routing.toml is not managed here and is still edited directly.
herdbot config list # global settings
herdbot config list --bot helper # one bot's settings
herdbot config sessions --json # Herdr session state and socket paths
herdbot session create work --json # start or reuse a named headless session
herdbot config get approvals.mode # one global setting
herdbot config get memory --bot helper # one bot setting
herdbot config list --json # the versioned contract below
herdbot config set approvals.mode auto # write one global setting
herdbot config set memory true --bot helper # write one bot setting
herdbot config set paths '/workspace/vault=~/Documents/vault' # add or replace one path rewrite
herdbot config unset approvals.mode # remove it; the default applies again
herdbot config unset class --bot helper --json # the updated setting as JSONGlobal settings live in $HERDBOT_HOME/herdbot.toml; bot settings live in $HERDBOT_HOME/<slug>/bot.toml. --bot selects the bot scope and only accepts an existing, normalised slug (lowercase letters, digits and -, at most 20 characters), so an id cannot escape the home. A missing herdbot.toml is not an error: list reports the metadata defaults without creating it, and set creates the file (and any missing section) on the first write. A missing bot, an unknown key, malformed TOML, or a wrong type or value exits 1 with the file and the expected value named.
herdr.session is a global setting that defaults to default. herdbot config sessions --json reports Herdr's session state and socket paths; a named session must be running before the daemon can use it. Set the session explicitly, then restart the daemon with herdbot setup --only restart-daemon. Changing sessions does not move existing bot workspaces. Once this home is bound to a socket (.state/herdr-socket), a different socket is rejected; use a separate HERDBOT_HOME for another session. Legacy homes with workspace state are conservatively treated as belonging to the default socket, including when a new override is supplied. An explicit HERDR_SOCKET environment variable continues to override the setting.
herdbot session create <name> [--json] starts a named Herdr server without attaching a terminal, or succeeds unchanged when that session is already running. It reports success only after herdr session list --json shows the session running with a socket path. The name default is rejected so this command cannot start or alter the default session.
set takes the value as plain text: ask/auto for approvals, default/none for the codex sandbox, true/false for memory, a decimal integer for the numeric settings, one word for class, cua.host and cua.command, and FROM=TO for one paths entry. Quote anything with spaces. Every value is validated before the file is opened, so a rejected value leaves the file byte-for-byte unchanged. Accepted writes preserve comments, key order, inline comments and unrelated sections: the source is edited with a format-preserving TOML editor and replaced atomically through a sibling temp file and a rename, keeping the original permissions, so a crash or a failed write cannot leave truncated TOML. A comment directly above a key that unset removes goes with that key; an emptied [section] header stays.
set and unset return the updated setting: human-readable by default (set approvals.mode in …, the value, its default and when it applies) or, with --json, the same get envelope with the new value (after unset, the default or, for a bot's approvals, the inherited global mode). Reads leave the file byte-for-byte unchanged, including comments, key order and sections the registry does not know. Unknown sections and keys found in the file are left alone rather than reported: only the keys this command exposes are validated, so a wrong type or value for an exposed key is an error while unrelated tables are not.
With --json, list prints one line:
{"version":1,"scope":"global","settings":[{"key":"approvals.mode","type":"enum","description":"…","default":"ask","value":"ask","choices":["ask","auto"],"apply":"next-bot-start"}]}get prints the same envelope with one setting object instead of settings:
{"version":1,"scope":"bot","setting":{"key":"memory","type":"boolean","description":"…","default":false,"value":false,"apply":"next-bot-start"}}version is 1 and new fields are additive. type is enum, string, integer, boolean or map; choices is absent for types without a fixed set; default is the built-in fallback and value is what the file resolves to now. apply is immediate, next-bot-start or daemon-restart. herdr.session requires a daemon restart.
Supported settings and their defaults:
| Scope | Key | Type | Default | Applies |
|---|---|---|---|---|
| global | herdr.session |
string | default |
daemon restart |
| global | approvals.mode |
enum: ask, auto |
ask |
next bot start |
| global | codex.sandbox |
enum: default, none |
default |
next bot start |
| global | memory.max_compactors |
integer ≥ 0 | 2 |
immediately (the daemon reads it each pass) |
| global | paths |
table of string → string | {} |
next bot start |
| global | cua.host |
string or unset | unset | next bot start |
| global | cua.command |
string or unset | unset | next bot start |
| bot | title |
string | "" |
immediately |
| bot | cwd |
string | the bot's folder | next bot start |
| bot | class |
string | default |
next bot start |
| bot | approvals |
enum: ask, auto |
ask, else the global approvals.mode |
next bot start |
| bot | memory |
boolean | false |
next bot start |
| bot | memory_view_bytes |
integer ≥ 0 | 64000 |
next bot start |
“Next bot start” includes new subagent launches; agents already running keep their route, approvals and instructions until restarted. memory.max_compactors takes effect on the daemon's next memory pass because the daemon re-reads it each tick. A write reports this timing as apply; the daemon does not restart itself, and unset never removes a key that was already absent.
Structural and import-owned fields are not settings here: a bot's name, source, grok_id and schedules, room room.toml files, and the routing table itself. routing.toml keys are rejected with a message saying to edit that file directly.
A prompt sent to a busy agent steers its current turn, and the answer it was working on is lost. I confirmed this with pi on 2026-10-20 (crates/herdr-client/examples/busy.rs reproduces it). So nothing prompts an agent directly except its very first prompt at launch. Messages, subagent results and schedule firings go into .queue/<agent>.jsonl. The daemon flushes a queue only when the agent is idle or done, joins the pending items into one prompt, and waits 15 s before delivering to that agent again. A message for a bot that isn't running brings it up. Since the daemon is the only process that launches bots, two senders can't race to start the same one.
When the daemon delivers a prompt to a bot's main agent it also writes .state/inflight/<bot>.json ({"prompt","at"}), and removes it when that turn is logged to turns.jsonl. turns.jsonl only gets a line when a turn ends, so this marker is how a UI shows your message while the bot works (working in status --json, and an inflight item in history). A marker older than an hour is ignored. If two prompts are delivered before a turn ends, only the latest is shown.
herdbot collaborate --json accepts a version-1 JSON request on stdin with request_id, text, and typed bot/room targets. It returns one queued/failed result per unique target. Bot queue records use stable IDs derived from the request and target and source user; retried requests do not enqueue a duplicate even after delivery is recorded in inflight or turn history. Room posts use the same stable ID in transcript.jsonl; composer-resolved mentions are not parsed again by the room router, and bots already directly targeted are excluded from room fan-out. Old queue and turn records without source metadata appear as unknown in history and are not imported as user instructions into OptChat memory. History and watch remain protocol v1 with additive fields.
Two known limitations:
- While a trust or warning modal is up (codex's first run in a directory, for example), herdr can report the agent as idle. The daemon then types into the modal and the queued item is lost. When
fmis available, the daemon holds the delivery (up to 8 retries, about 2 min) while fm reads a prompt in the pane, so accepting the modal lets it through. Without fm it is lost as before. I haven't seen this hold fire on a real modal: codex showed no trust prompt in the two fresh directories I tried. - Reading a claude pane's history once returned text without the latest reply, and it left the pane scrolled up. Claude subagent results no longer depend on that read, since they come from the Stop hook (see Turn hooks). Quota detection still reads the pane, so claude's quota detection is unverified. Only cursor's has been seen working on a real limit so far.
- A bot calls
task{description, prompt, subagent_type?, model?}. - The router resolves the task class, any bot override and any explicit model to
harness:model[:effort](see Routing). - herdbot splits a pane to the right of the bot's root pane, with
HERDBOT_BOT/RUN/TOOLS/EXE/HOMEin its environment. - It starts the agent as
<slug>-<run>, checks the pane for a trust/review/permission prompt, then submits the task plus a footer asking forreport_result. If the agent is still idle after 15 s, herdbot retries once. If the harness remains idle after the second 15 s window, the run is markedblockedand an operator card preserves the pane output; the task is not treated as completed. Delivery across herdr is at-least-once where its API has no idempotency key, so a retry may deliver a duplicate. taskreturns the run id once the agent has taken the task, usually within a few seconds. A task blocked by an operator prompt returns the run id and pane with a direction to open the chat card and answer in the harness. Tool calls never wait on a subagent, because harness tool timeouts are short.- The run finishes one of four ways:
report_resultmarks the run done and queues[subagent <id> "<desc>" finished]with the result for the parent.- No report. The daemon sends the parent the harness's own last reply from a turn-end hook (claude
Stop, codexnotify, piagent_end). Hooked harnesses require that event orreport_result; herdr idle alone never triggers tail harvest. If a hook is lost, the run stays open for inspection orstop_subagent(an explicit active-time limit still applies). For unhooked harnesses, a pane-tail fallback preserves the last 60 lines but marks the runfailed, because pane text alone does not prove task completion. Each run records its source inresult_source:report,hookortail. - Exited. If the agent is gone more than 90 s after start, the parent gets a failure notice.
blocked. Herdbot creates an operator card when the harness is waiting on trust, review, or permission input. It includes the harness, run, bot, visible dialog text and visible choices; choices are informational and Herdbot never answers them. The card clears when the prompt is gone or the run is settled/stopped. Operator prompts stay out of the parent model's queue.
- The daemon closes a finished run's pane once the agent settles.
check_subagentandstop_subagentcover everything else. - Approvals stay with each harness's normal behaviour, with no
--yolo. Only herdbot's own tools are pre-approved, through--allowedTools mcp__herdbotfor claude anddefault_tools_approval_mode="approve"for codex. Before delegating with Codex, open Codex from the bot project's working directory and confirm no Hooks review screen is pending; review the hooks there if prompted. Plugin updates can invalidate that trust, so repeat this check after an update. Herdbot also checks the live pane before task submission and surfaces a card if a review or permission prompt blocks it. A resumed Codex conversation held by another app is retried withrup to three times, two seconds apart. If it stays locked, Herdbot leaves an operator card; it never forks or exits automatically. Queue delivery checks operator prompts before sending and retains unaccepted batches for redelivery. Never assume trust persisted across sessions or updates.
task, check_subagent, stop_subagent, send_to_agent{bot, message} and list_bots. Subagent runs also get report_result. send_to_agent queues [message from <bot>] … for the target bot, bringing it up if needed, and replies come back the same way.
Main agents also get room_post{room, text} and list_rooms: a bot can post to rooms it belongs to, and room messages reach it as [room <slug> …].
Rooms are group conversations between you and any number of bots. Each room has its own folder under ~/Bots/rooms/<slug>/ with a room.toml, an append-only transcript.jsonl, and a rendered transcript.md.
Turn-taking modes:
channel(default): members speak only when named, either with@<slug>or by their display name as a whole word. A message that names nobody calls nobody.round_robin: each message from you starts a round in which every member speaks once, in order.moderated: everything goes to the moderator; the moderator names who speaks next.
Limits: max_turns defaults to 6 bot posts in a row before the room pauses until you post again; member_cooldown_secs defaults to 30 seconds before a member can be called again; turn_timeout_secs defaults to 300 seconds for round-robin turns.
Members answer from their own main agents using the room_post tool. herdbot room up <room> opens a workspace that tails transcript.md, and a future desktop UI would read the same file.
Verified live on 2026-10-20 unless the table says otherwise.
| Harness | Model / effort | Tools | Instructions |
|---|---|---|---|
| claude | --model, --effort |
--mcp-config <file> --allowedTools mcp__herdbot |
--append-system-prompt-file |
| codex | -m, -c model_reasoning_effort= |
-c mcp_servers.herdbot.{command,args,env}=… with default_tools_approval_mode="approve". On the first run in a directory, codex's trust prompts for plugin hooks ate the prompts. |
first prompt |
| cursor-agent | --model (effort is part of the id) |
merges a herdbot entry into <cwd>/.cursor/mcp.json (identity comes from the pane env), plus --approve-mcps and --trust. Without --trust, the first run in a new cwd opens a trust modal that swallows the first prompt. The tools haven't been seen working yet because the test account hit its weekly limit. |
first prompt |
| pi | --no-extensions -e builtin:mcp -e builtin:codemode -e <herdbot-pi.ts> --provider opencode-go --model, --thinking |
-e builtin:mcp -e builtin:codemode -e herdbot-pi.ts, which registers the herdbot stdio MCP server with pi.registerMcpServer at code-mode exposure; scripts use searchTools() (--mcp-config comes from a third-party extension that --no-extensions drops) |
--append-system-prompt <file> |
Approvals: [approvals] mode = "auto" in herdbot.toml, or approvals = "auto" in a bot.toml, launches that bot's main agent and subagents with claude's --permission-mode auto and codex's --approve-for-me. pi doesn't ask for approvals. cursor has no automatic-review mode, so it still asks. "ask" is the default and adds no flags.
[codex] sandbox = "none" in herdbot.toml opts codex agents out of the workspace-write sandbox and runs them with danger-full-access. It is off by default; when enabled, agents can write anywhere your user can, including ~/.cache, ~/.cargo and git worktrees, so Swift/Rust builds and commits from worktrees work. It replaces --approve-for-me for codex, applies globally to all codex-routed agents, and does not affect claude, pi or cursor.
herdr rejects agent arguments it can't quote safely (newlines trigger invalid_agent_argument), so prompts and MCP config are passed as files.
pi needs a guardrail. Without --no-extensions, a user extension replaced the model at startup with a different opencode-go model, and later failed over to another provider entirely. So herdbot always passes --no-extensions --provider opencode-go --model <id>, enables built-in MCP and code mode and registers its server through its own extension, and rejects any pi model that pi --list-models doesn't list for opencode-go. It doesn't yet audit pi's session log for calls to other providers. Built-in MCP also reads ~/.pi/agent/mcp.json. Code mode exposes enabled servers there to bot scripts, including the global radius and rea servers; a global server set to "exposure": "direct" is declared directly.
A Claude launch blocked on its folder trust dialog becomes a card in status and watch --json. Use herdbot card list to inspect pending cards and herdbot card answer <card-id> <option-id> to answer one; this is the only command that answers, and it re-checks the live screen first. Cards live in .state/cards/, with answers recorded in .state/cards.log. Trust and permission dialogs are never answered automatically; the Codex resume lock uses only the bounded retry described above.
Each harness's own hook reports two things to herdbot: a finished turn with its reply, and a block waiting on you. Live on 2026-10-20, claude, codex and pi subagent runs each reached done with result_source: hook.
| Harness | Turn end (reply) | Blocked | Installed by |
|---|---|---|---|
| claude | Stop, reply from last_assistant_message; StopFailure reports API errors |
PermissionRequest (seen live). Notification for permission or input is wired but not seen live |
--settings .state/launch/<agent>.settings.json |
| codex | notify agent-turn-complete, reply from last-assistant-message |
none. approval-requested never reached notify in a live capture, so herdr's status is used |
-c notify=[<herdbot>, hook, codex] |
| pi | agent_end, reply from the last assistant text with stopReason / errorMessage |
ui_prompt_start is wired but not seen live |
herdbot-pi.ts, which pipes each event to herdbot hook pi |
cursor-agent is wired via <cwd>/.cursor/hooks.json from verified captures; the end-to-end run has not yet been verified live.
herdbot hookalways exits 0 and prints nothing. Its own errors go to.state/events/hook-errors.log. Each payload becomes at most one line in.state/events/<agent>.jsonl, which the daemon drains on each tick. Text is capped at 64 KB, keeping the head and tail.- Errored or empty final hook turns settle subagent runs as
failedwithresult_source: hook, an explanatory result, and a parent notice that the task can be resumed in a new run. Pi errors/aborts and ClaudeStopFailurecarry explicit failure signals; Codex notify has no error field. Older Pi text-only payloads remain accepted. Pi extension regression:node --test crates/herdbot/assets/herdbot-pi.test.ts(Node 22.18+). - Codex side turns are filtered. Notify identifies the notifying
thread-idandturn-idbut omits ancestry. Herdbot verifies root CLI identity against the firstsession_metarecord in$CODEX_HOME/sessions(default~/.codex/sessions), rejecting nested agents even when they finish first. Missing or unreadable metadata leaves the run open and records a hook error. Title-generation turns are skipped too. - A late
report_resultafter hook completion replaces the stored hook result and delivers a separate report notice to the parent; already reported or cancelled runs still reject reports. - codex: herdbot's hook re-runs your own
notifyfrom~/.codex/config.tomlwith the same payload appended, detached. Whether that chained notify still receives its payload is not checked live. - claude's
--settingshooks stack with your own. Checked live with one userStophook, which ran alongside herdbot's. Your~/.claude/settings.jsonis never edited. - Main-agent turns are logged to
<slug>/turns.jsonlas{at, prompt, reply}.promptis the text the daemon last delivered, ornullif you typed into the pane. Not checked live: noturns.jsonlline had been written when this was documented. - A launch preamble that asks a main agent to reply
READYis skipped in the turn log; launches without that prompt (for example, pi and claude) are not marked. - With
approvals = "auto", a blocked event is rarely reachable, because the harness seldom asks for approval.
A bot with memory = true in bot.toml keeps one endless log of its prompts and replies, compresses it into a tree of one-line summaries, and starts every fresh session with a fixed-size view of it. It's off by default, and with it off nothing else about that bot changes.
- What's logged. Every prompt and every reply becomes a line in
<slug>/chat/main.jsonl, markeduserortalk, with its UTF-8 size and time; every summary becomes a line in<slug>/chat/tree.jsonl. Both files are append-only, written only by the daemon, one write plus one fsync per line, and torn lines are skipped at load.chat/keeps every prompt and reply forever, so a memory bot's folder is a complete transcript of it. Treat it as private. - How it's compressed. A message that fits in 512 bytes is its own line. A longer one is compressed into a line of at most 512 bytes, then neighbouring lines are merged two at a time, so a line higher up covers more messages. The view shows recent messages one line each and older ones many per line; a line the compactor hasn't built yet shows as
id+1|(not summarized yet: zoom it). - Compactor runs. The model work runs as
compact-class subagents in panes, never through a harness's print mode. A bot gets one compactor run at a time, and[memory] max_compactorsinherdbot.toml(default 2) caps how many run across all bots. A run starts when a bot has a summary due and its log has been quiet for 60 s, or when a recycle is waiting on it, and each job is one turn: compress one message, or merge two neighbouring lines. Jobs carry noid+nmarkers; the compactor answers withwrite_node, and the daemon validates the node, keeps the shortest try when a line is over the limit, and closes the run when nothing is due. A run whose job prompts pass2 × VIEWbytes is closed and replaced, so one compactor session never grows without bound. - The view. A memory bot's instructions end with a short doc on reading the view and then the view itself, so a restart, a quota failover onto another harness and a recycle all hand the bot its past.
- Recycling. Once the bytes logged since the current session started pass
2 × VIEW, and the bot is idle with an empty queue and a built-out view, the daemon restarts its main agent in a fresh session carrying the view. That keeps context bounded instead of leaving the harness to compact one ever-growing session. zoomanddate. A memory bot's main agent also gets two herdbot tools:zoom{id, n}opens a view line into the two lines under it, down to the single message atn = 1, anddate{id}gives that message's time. They readchat/directly, so every harness gets them.- Size.
memory_view_bytesinbot.tomlsets the view's budget, 64,000 bytes by default, and a summary line may take 512 of them. Sizes are UTF-8 bytes, never tokens. - One daemon. The daemon listens on
.state/daemon.lock, so it is the only writer of a bot's memory. A secondherdbot daemonexits withanother herdbot daemon is running, and a socket left behind by a dead daemon is taken over.
The model comes from OptChat, which grew out of Victor Taelin's OptMem. herdbot deviates where its own design says so: the view is rebuilt at every fresh session and a long session is recycled, instead of a model call per message, and the compactor is a herdbot subagent in a pane instead of an API call. Memory only logs prompts and replies; tool calls and tool results aren't in the log, because the hooks don't see them.
Verified live on 2026-10-20 on a codex-routed bot with a 1,500-byte view: 25 turns (50 log messages) built the tree through four compactor runs that opened and closed done, the log showed memory: recycled mem-test onto … once the session passed 3,000 logged bytes, the fresh session's instructions carried the <chat> view, and the bot answered a question about an early message with two zoom calls. At that budget the launch instructions were 4.5 KB; at the 64 KB default the first prompt would be far larger, and whether codex delivers a view that size intact is unverified.
computer_use subagents run on claude only. Any other harness for that class fails the run with an error instead of starting without cua. The run's MCP config gets a second server, cua, next to herdbot:
- No
[cua]table:cua-driver mcpfromPATH, on this Mac. [cua] host:ssh -T <host> <command> mcp, on a remote Mac.commanddefaults tocua-driver. Set it when the remote shell'sPATHlacks~/.local/bin.
[cua]
host = "[email protected]"
command = "~/.local/bin/cua-driver"Each Mac needs cua-driver installed (/bin/bash -c "$(curl -fsSL https://cua.ai/driver/install.sh)") and CuaDriver turned on under Accessibility and Screen & System Audio Recording (cua-driver permissions grant, then check with cua-driver permissions status). A remote host also needs key auth, so ssh -T <host> true runs without a password prompt.
cua's tools are not in --allowedTools, which stays mcp__herdbot. Under the default approvals = "ask", each cua action should wait for approval in the subagent's pane (from code; not seen live). A bot with approvals = "auto" launches claude with --permission-mode auto, so its cua actions run without a prompt. herdbot-dev is set to auto in its bot.toml. The parent is told once, when a run first blocks; later approvals in the same run don't notify it again (from code, notified_blocked; not seen live).
Verified live on 2026-10-20:
cua-driver mcp(0.37.0) answersinitializeandtools/list. The tools includelist_apps,get_window_state,clickandpress_key.- Before the grant, a
computer_userun returnedpermissions_pendingbecause CuaDriver lacked Accessibility and Screen Recording permissions. - After
cua-driver permissions grantgranted Accessibility, Screen Recording and direct capture, a shellcomputer_userun (0mtevz,claude:claude-sonnet-5-5:medium) listed 17 running apps throughlist_appsand endeddonewithresult_sourcereport. It ran without an approval prompt becauseherdbot-devhasapprovals = "auto".
Not verified: the ask approval flow end to end, and any remote host.
The table is in routing.toml. For each task herdbot tries, in order:
- an explicit
modelargument ontask - the bot's override in
[bots.<slug>] [classes.<subagent_type>], an ordered list ofharness:model[:effort][default]
The first available candidate wins. A harness is available when its binary is on PATH and it isn't cooling down after a quota or auth failure. Task classes are Grok Bot's subagent types (explore, shell, bash, browser_use, computer_use, debug, media_review, custom) plus code, review, plan, research, and compact for a memory bot's compactor runs (see Memory). The model IDs were listed by the installed CLIs on 2026-10-19. Which model suits which task is my judgment, so tune it.
An available explicit model launches that exact harness, model and effort. If a valid explicit route is unavailable, herdbot may use the configured fallback and reports the requested route, actual route and reason in its acknowledgement and history, including when startup blocks or fails. The selected route is saved before launch. Invalid explicit routes return an actionable error.
Every launched agent gets an explicit effort. A candidate without one takes its class's effort, then [default] effort, then medium, so a harness never falls back to your global setting.
Cooldown and failover. When a subagent settles or blocks, and when a main agent finishes a turn, the daemon scans the last 15 non-empty lines of its pane for its harness's failure text.
| Harness | Quota | Auth |
|---|---|---|
| claude | a line starting You've hit your … limit, with the reset from resets 12:30am |
Please run /login, authentication_error |
| codex | a line starting You've hit your usage limit, with the reset from try again at 3:45 PM or … at Oct 21st, 2026 3:45 PM |
Your access token could not be refreshed, OAuth refresh token was rejected, api_key_expired |
| cursor | a line starting Error: that contains usage limit reached, with the reset from unifiedSkuWeeklyLimitResetDays: N |
Your stored authentication is invalid, Error: Authentication required, run `cursor-agent login` to re-authenticate |
| pi (opencode-go) | none | api_key_expired |
These strings were checked against claude 2.1.304, codex 0.163.0 and cursor-agent 2026.10.16. cursor's quota text comes from its server, and the pattern above is from one real capture, so other wordings may slip through.
A match writes .state/cooldown/<harness>.json, and routing skips that harness until the reset time plus a minute (or for an hour when no time is given). A subagent that failed this way is closed and its task re-queued on the next route, and its parent gets the new run id. A main agent restarts in a new pane on the next route, and the message it couldn't answer is delivered again with a note that the conversation is new. Text typed straight into the pane isn't re-sent. When no other route is available, the old agent keeps running. Delete the cooldown file to lift it early.
For subagent runs, when none of the patterns match and fm available succeeds, the daemon asks Apple's on-device model to read the same 15 lines. It counts a quota or auth verdict only when the line fm cites sits in the last 12 rows of the pane (a narrow subagent pane wraps one message over several rows) and contains a failure word, and that cooldown lasts 10 minutes. Main agents never act on fm, because a misread would restart them and lose the conversation. Daemon log lines start fm:.
herdbot started as a local take on Grok Bot, so it borrows Grok Bot's concepts (bots, subagent types, WakeParent-style results, bot-to-bot messages) and can import its roster.
Import is one-way. Grok Bot caches its roster in ~/Library/Application Support/Grok Bot/sand-client-persistence/. Each row's description is the bot's full system prompt. herdbot import-grok creates or refreshes one bot per row, and the daemon re-imports whenever that file changes. BOT.md is written verbatim, and nothing is ever written back to Grok Bot.
Schedules, skills and memory aren't in the roster cache. import-template reads public preview HTML and accepts pasted prose for components the page withholds. It does not call Grok Bot's private API or fetch the app-only template payload.
Running both apps at once works because imported schedules start disabled, so a routine never fires in both. Turn a schedule on in herdbot only after you've turned it off in Grok Bot. Grok Bot's group bots aren't imported. Make the room with herdbot room new.
- Template refresh and additional open file formats beyond Grok Bot URL preview plus paste.
- The desktop UI is built; what is left is polish and more cards. A SwiftUI menu bar app (
ui/macos, installed with the cask) has a status menu, a ⌥Space quick-entry panel, a chat window, notifications, a first-run setup window and approval cards. Not built: other prompts as cards (claude's per-tool permission prompts, codex's trust modal; each needs an adapter written from a captured screen), markdown lists and headings in the chat, and usability improvements still to be collected. See the UI layer design, the chat app design and the approval cards design. - pi code mode: verified on pi 1.2.0 (2026-10-20). Three unisolated
deepseek-v4-flashruns calledlist_botsfrom scripts and exited 0 in 5.48, 6.25, and 9.80 seconds;kimi-k2.7-codealso passed in 13.08 seconds. Disabling globalreawas unnecessary. Code mode is enabled; model-generated script errors were recovered within the gate. - A durable harness on Pi Durable. Earendil's Pi Durable (experimental, TypeScript) checkpoints every model call and tool call, so a new process picks up unfinished work after a crash. It also makes submissions exactly-once, lets a conversation fork without copying its transcript, and lets several clients watch and steer one conversation. Those cover herdbot's weakest spots, which are scraping pane text for status and quota errors, and losing an answer when a busy agent gets prompted. A
durableharness, a small Node host per bot that runs in a herdr pane, would hand herdbot real status and results for pi-driven bots instead of screen reads. The API may still change, so this stays an experiment next to the pane-based harnesses. - More uses for Apple's on-device model.
fmnow backs up quota and auth detection for subagents and holds deliveries behind modals. Picking a task class when a bot names none is not built; bots rarely omit it. Summarizing subagent output was left out on purpose: the parent gets the raw tail, which loses nothing, while on-device summaries of long output would.
Open questions:
- The UI is SwiftUI throughout (decided 2026-10-22); another operating system would get its own shell over the same CLI.
- Should any bot run unattended? Automatic review is available through
approvals = "auto"; full bypass (--yolo,--dangerously-skip-permissions,--dangerously-bypass-approvals-and-sandbox) is still never used. - Should bots get their own herdr session (
--session herdbot)? They currently land in your default session.