Guides
Orchestration
Use kumo as an ADE — how humans and AI agents wait, prompt, read, and coordinate across panes.
Who is this for?
Humans driving a session from a shell, and AI agents running inside a kumo pane that need to drive their own web. The entire kumo CLI is the API — agents and humans use the same commands over the same daemon socket. For agents, install the bundled skill.
Why kumo can orchestrate
Classic multiplexers can send-keys. None could wait. An agent that injects a command and then polls sleep 1; check again is fragile, wasteful, and races with the shell.
Kumo adds server-owned, event-driven waits: the daemon holds your socket open and replies once — when the condition is met, on timeout, or if the pane's occupant changed. No polling loop on the client, no race between submit and wait.
tmux: send-keys "npm test" → sleep 2 → hope
kumo: agent prompt -p 42 "npm test" --wait idle → daemon replies once
pane wait-output -p 12 --regex "passed|failed" → exactly when it appearsHow agents use kumo
Any process inside a pane can shell out to the kumo binary. Panes receive
KUMO_BIN_PATH (the binary that owns the pane) and KUMO_SOCKET_PATH (the
daemon's socket), so "$KUMO_BIN_PATH" always reaches the right daemon — see
[worktree] expose-socket in Configuration.
Humans, TUI clients, scripts, and AI agents all speak the same protocol.
You do not need a special SDK. If you can run a command, you can orchestrate.
Add --json whenever a script consumes the output — the
machine API is a stable contract, the
human-readable output is not:
kumo pane list -s myproj # discover panes: ids + s1:t2:p3 positions
kumo agent status -s myproj # which panes host agents, their status
kumo agent wait -p 42 --until idle
kumo agent read -p 42 --source recentComposite pane addresses
Panes have a stable numeric id and a composite position s1:t2:p3 (1-based: session index or name, tab, pane). Use whichever is convenient — composites are resolved against the live layout and the daemon always gets the canonical id. kumo pane list and kumo agent status print both. Agent aliases set with kumo agent rename work too.
s1:t2:p3— session 1, tab 2, pane 3kumo:t2:p1— session namedkumo, tab 2, pane 1t2:p1— tab 2, pane 1 (session from-s)42— stable numeric id (best for scripts)
The primitives
| Primitive | What it does | Server behavior |
|---|---|---|
kumo agent wait | Wait until an agent reaches blocked|done|idle|working | Holds the socket; pinned to the pane's process (agent_replaced if it changes); replies at once if already there (agent_blocked if blocked instead); timeout otherwise |
kumo agent prompt | Send text to a pane (bracketed-paste aware) | Wrapped in bracketed paste when the pane enabled it; refuses with agent_blocked if already blocked |
kumo agent prompt --wait | Prompt and wait in one RPC | Atomic — no race between send and wait |
kumo agent read | Read the pane's buffer from the daemon | Alt-screen intact; no scraping; --source selects the view |
kumo pane wait-output | Wait for PATTERN in any pane's output | One-shot, regex or substring, on recent tail + visible buffer |
kumo agent start | Launch an agent in an existing shell pane | Returns once detection shows ready; agent_not_ready if blocked at start |
kumo agent rename | Live alias for a pane | So scripts can use names, not ids |
kumo agent broadcast | Fan one prompt to every AI pane | Over existing send-keys path; optional --filter STATUS |
kumo agent wait
kumo agent wait <PANE> --until <STATUS> [--timeout 30s] [-s SESSION]
# examples
kumo agent wait -p 42 --until idle --timeout 60s
kumo agent wait -p s1:t1:p2 --until blocked --timeout 10s
kumo agent wait -p 42 --until done # finished-but-unseen (went idle while unfocused)STATUS:blocked(needs approval) ·done(finished while you weren't looking) ·idle(quiet, ready) ·working(producing output). The five-state model isworking · blocked · idle · done · unknown— see AI Agents.- Pinned occupant: the wait is pinned to the pane's
OS pidat creation. If the process is replaced, the daemon repliesagent_replacedinstead of falsely succeeding.agent_blockedis returned immediately when--untilis notblockedbut the pane is already blocked. - Default timeout:
30s. Accepts500ms/30s/2mor bare milliseconds.
kumo agent prompt
kumo agent prompt <PANE> <TEXT> [--wait [STATUS]] [--timeout 60s] [-s SESSION]
# examples
kumo agent prompt -p 42 "fix the failing test in src/foo.rs"
kumo agent prompt -p 42 "rebase onto main" --wait idle --timeout 120s
kumo agent prompt -p 42 "ship it" --wait blocked # wait until it needs approval
kumo agent prompt --wait -p 42 "hello" # bare --wait means idle
kumo agent prompt -p 42 -- "echo --wait is not a flag" # -- separates text from flags- Bracketed-paste aware: when the pane has bracketed paste enabled, kumo wraps the payload as
\x1b[200~TEXT\x1b[201~\r; otherwiseTEXT\r. No stray escapes. - Refuses when blocked: if the agent is already
blocked, prompt returnsagent_blockedwithout injecting — you must handle the approval first. --waitis atomic:prompt --wait idledoes submit + wait in one server-owned request, so there is no window where the agent could go idle between yoursend-keysand your separatewait. Defaultprompt --waittimeout is120s.
kumo agent read
kumo agent read <PANE> [--source <SOURCE>] [-s SESSION]
# SOURCE: visible | recent | detection | traceback (default visible)| Source | What you get |
|---|---|
visible | The viewport as the daemon sees it (what is on screen right now) |
recent | Last ~16 KiB of output (ring tail) — good for recent logs |
detection | Raw signal regions as screen / form / footer / title — for debugging detection |
traceback | Last prompt block: form (below last rule) or the last 120 rows if empty |
The daemon owns the screen buffer including the alt-screen (ghostty's buffer holds it), so full-screen agent transcripts (claude/codex) read directly without mouse-scroll scraping.
kumo agent read -p 42 --source visible
kumo agent read -p 42 --source recent | tail -n 100
kumo agent read -p 42 --source traceback # last failing command + output when availableOutput may be truncated (flagged in the reply); keep --source targeted and page with tail/grep.
kumo pane wait-output
kumo pane wait-output [PANE] PATTERN [--regex] [--timeout 30s] [-s SESSION]
# examples — PANE may be positional or -p; PATTERN is positional
kumo pane wait-output -p 12 "Ready on http"
kumo pane wait-output -p 12 --regex "passed|failed" --timeout 60s
kumo pane wait-output s1:t1:p2 "TASK_DONE" --timeout 10s
kumo pane wait-output -p 12 --timeout 500ms "demo-token"- Any pane, not just AI panes — the primitive behind dev servers, test suites, and builds.
- Substring by default,
--regextreatsPATTERNas a Rustregex. Bad regex returnsbad_regex: "…: error"immediately. - Checks the recent tail + visible buffer, then holds the socket until new output contains the pattern. Pinned to the pane's process like
agent wait. Default timeout30s.
kumo agent start / rename / broadcast
kumo agent start --kind <agent> --pane <PANE> [-- <args>] [-s SESSION]
kumo agent rename <PANE> <NAME> [-s SESSION]
kumo agent broadcast "TEXT" [-s SESSION] [--filter STATUS]
# examples
kumo agent start --kind claude --pane 12 -- --model sonnet --resume abc
kumo agent start --kind opencode --pane s1:t2:p1 -- --help
kumo agent rename -p 42 worker
kumo agent broadcast -s myproj "rebase onto main" --filter idle
kumo agent broadcast "echo broadcast-ok" -s myproj --filter blockedstartlaunches the agent program in an existing shell pane and returns once detection shows it ready (agent_not_readyif it starts blocked;--kindselects the detection rulesagent-detection/<kind>.toml).renamesets a live alias so scripts reference agents by name, not id.broadcastfans the prompt over the existingsend-keyswire path to every AI pane in the session;--filterrestricts toworking|blocked|idle|done|unknown.
Isolated worktrees and checkpoints
Use an AI worktree when an agent should work in its own checkout and branch:
kumo worktree create --ai fix-login \
--agent claude \
--from main \
--note "Investigate the authentication tests" \
-s myproj--ai creates an ephemeral worktree and opens a session for it. The
positional NAME is slugged into a branch unless --branch supplies an
explicit branch. --from accepts a local or remote branch, commit, #1234,
or a GitHub/GitLab pull or merge request URL. Jira references are not supported
yet. --agent KIND starts the selected agent in the new pane and replies once
it is ready (agent_not_ready if it starts blocked, like agent start). It
does not send the task text — submit it as an explicit step:
kumo agent status
kumo agent prompt -p 42 "Fix the failing authentication tests" --wait idle --timeout 10m
kumo worktree set -s myproj --status in-review \
--comment "Tests pass; ready for review"Inspect or clean up the worktree with kumo worktree current, list,
set, open, and rm. rm keeps a branch with unmerged commits unless
--force is supplied. Checkpoint statuses are todo, in-progress,
in-review, and completed; --note on create seeds the checkpoint comment.
Shared directories (node_modules, caches) and copied local files (.env)
are configured with [worktree] shared-dirs and .worktreeinclude — see
Configuration.
Patterns (copy-paste)
The recipes use jq on the --json output. kumo pane split keeps focus on
the original pane, and pane ids only grow, so the newest pane of the active
tab is the highest id:
newest_pane() {
kumo pane list -s "$1" --json | jq '[.tabs[] | select(.active) | .panes[].id] | max'
}1 — Dev server: run it, wait for ready, then read
SESSION=myproj
kumo pane split -s $SESSION --horizontal
PANE=$(newest_pane $SESSION)
kumo agent prompt -p $PANE "npm run dev"
kumo pane wait-output -p $PANE --regex "Ready|listening|Local:" --timeout 30s
kumo agent read -p $PANE --source recent | grep -i "ready"2 — Verify loop: run tests, wait for result, feed failure back
Run the suite in a fresh split, wait for its output, and only then feed the failure to the agent:
SESSION=myproj
WORKER=42 # your agent pane
kumo pane split -s $SESSION --horizontal
TEST_PANE=$(newest_pane $SESSION)
kumo agent prompt -p $TEST_PANE "npm test 2>&1"
if kumo pane wait-output -p $TEST_PANE --regex "passed|failed" --timeout 120s; then
FAIL=$(kumo agent read -p $TEST_PANE --source recent | grep -A 50 "failed\|FAIL")
if [ -n "$FAIL" ]; then
kumo agent prompt -p $WORKER "tests failed: $FAIL" --wait idle --timeout 180s
fi
else
echo "tests timed out" >&2
fi3 — Agent-to-agent handoff
Agent in s1:t1:p1 waits for worker s1:t1:p2 to finish:
kumo pane wait-output -p s1:t1:p2 "TASK_DONE" --timeout 300s
RESULT=$(kumo agent read -p s1:t1:p2 --source recent)
kumo agent prompt -p s1:t1:p1 "worker done: $RESULT" --wait idleAtomic prompt+wait for a worker task:
kumo agent prompt -p s1:t1:p2 "implement feature X and run tests" --wait done --timeout 600s
kumo agent read -p s1:t1:p2 --source traceback4 — Parallel workers + aggregator
Read-only or non-overlapping tasks can share one checkout. Agents that edit the same files should each get their own worktree.
for TASK in "review module A" "review module B" "review module C"; do
kumo pane split -s myproj --ai # runs your ai-cmd
P=$(newest_pane myproj)
kumo agent wait -p $P --until idle --timeout 60s
kumo agent prompt -p $P "$TASK" --wait idle --timeout 30m &
done
wait
kumo agent broadcast -s myproj "summarize your findings" --filter idle5 — Broadcast to the fleet
kumo agent broadcast -s myproj "git fetch && git rebase origin/main" --filter idle
kumo agent broadcast -s myproj "echo tick" # all AI panesErrors, timeouts, and pinning
| Code | Meaning | What to do |
|---|---|---|
timeout | Condition not met before --timeout | Retry, increase timeout, or agent read --source recent to see progress |
agent_blocked | Pane already blocked but --until was not blocked / prompt refused while blocked | Handle the approval (agent read to see prompt, prompt after resolving), or wait with --until blocked |
agent_replaced | Pane's OS pid changed since wait was created | Re-resolve the pane id and retry; do not treat as success |
bad_regex | --regex pattern failed to compile (bad regex "…": error) | Fix the pattern |
All waits are server-owned and event-driven: the CLI blocks on the socket and the daemon re-checks pending waits whenever an agent changes status or a pane produces output, so there is no client polling. With --json, every failure carries its code — see the full error-code table.
Tips for AI agents
- Discover panes first:
kumo pane list(every pane +s:t:p) andkumo agent status(AI panes + status + positions). Use stable numericidin scripts; composites1:t2:p3for interactive use. - Use
--jsonin scripts and match onerror.code, never on human-readable text. - Prefer
readover scraping:agent read --source visible|recentcomes from the daemon's ghostty buffer.tracebackgives the last prompt block. - Use
--regex "passed|failed"for test watchers, substring for dev-server banners. - Always set a timeout long enough for the job (defaults:
120sforprompt --wait,30sforwaitandwait-output). - No polling: do
kumo agent waitorkumo pane wait-output, notwhile true; do kumo agent status; sleep 1; done. - Handle
agent_blocked: neverprompta blocked pane.read --source visibleto see the permission dialog, then act. - Bracketed paste is automatic: you do not need to send
ESC[200~yourself —agent promptdoes it when the pane has the mode enabled. - Keep reads small:
recentis ~16 KiB; pipe throughgrep/tailrather than dumping the whole buffer into context.
Bundled agent skill
Kumo ships its orchestration instructions inside the binary, so they always match the installed CLI. Choose your agent and run the generated command:
Install for Codex
Personal skill · available in every project · ~/.agents/skills/kumo/SKILL.md
kumo agent skill --output ~/.agents/skills/kumo/SKILL.mdThe command does not require a running daemon and installs the skill at user
scope, so it is available across projects. Re-run it after updating Kumo to
refresh the skill. kumo agent skill without --output prints the
instructions instead.
You can manage the same targets from MENU → settings → agents: select an
agent and press Enter (or click it) to install the skill; selecting
an installed skill removes its SKILL.md. Update available means the file
exists but differs from the skill bundled with the running Kumo — usually
because Kumo was upgraded, possibly because the file was edited. The update
action replaces it with the bundled version.
See also
- AI Agents — the five-state model, detection rules, and
agent explain - CLI Reference — every
kumocommand - Sessions & Panes — split tree, focus, resize, zoom