Herdr recognizes coding agents running in panes and tracks their state. This reference covers the herdr agent and herdr integration commands.

Agents

Introduction

Herdr detects coding agents inside panes, tracks their idle, working, blocked, done, and unknown states, and rolls state up to tabs and workspaces. This reference covers the herdr agent command group.

Supported agents

Agents get support in one of two ways: Herdr supports them, or they support Herdr themselves. Either way you see each agent's idle, working, and blocked state and can wait on it from scripts.

Supported by Herdr, with an integration

AgentIntegrationNotes
Claude Codeclaude 
Codexcodex 
GitHub Copilot CLIcopilot 
Cursor Agent CLIcursor 
OpenCodeopencodealso reports state
Pipialso reports state
OMPompstate requires the integration
Droiddroid 
Devin CLIdevin 
Kimi Code CLIkimialso reports state
Kilo Code CLIkiloalso reports state
Hermes Agenthermes 
Qoder CLIqodercli 
Qwen Codeqwen 
Letta CodelettaCLI install only
MastraCodemastracodestate requires the integration
Grok CLIgrok 
Antigravity CLIantigravity-cli 

Detected, state only

These agents get state detection without an integration: Amp, Kiro CLI, Maki, and Gemini CLI and Cline (both less tested).

Supported by the agent

These agents report their own state; there is nothing to install.

An agent that also reports its resume command comes back in the same session after a server restart.

Agents Herdr does not recognize still run normally in panes; they just show up as plain terminals.

Start an agent

herdr agent start reviewer --kind codex --pane w1:p2
herdr agent start reviewer --kind codex --pane w1:p2 --timeout 30000
herdr agent start reviewer --kind claude --pane w1:p2 \
  -- --model sonnet

The pane must be an available interactive shell at its prompt. agent start never creates, splits, or moves layout. It returns once the expected agent is detected in the same terminal and is ready for input; the startup timeout defaults to 30000 ms (max 300000).

Kinds

KindAgent
claudeClaude Code
codexCodex
copilotGitHub Copilot CLI
cursorCursor Agent CLI
opencodeOpenCode
piPi
ompOMP
droidDroid
devinDevin CLI
kimiKimi Code CLI
kiloKilo Code CLI
hermesHermes Agent
qodercliQoder CLI
qwenQwen Code
lettaLetta Code
mastracodeMastraCode
grokGrok CLI
agyAntigravity CLI
ampAmp
kiroKiro CLI
makiMaki
geminiGemini CLI
clineCline
museMuse

Names must match [a-z][a-z0-9_-]{0,31} and be unique among live agents. A name follows the current pane occupant and clears when the agent exits, is released, or is replaced. Targets accept a unique live agent name or the pane ID currently hosting the agent; terminal IDs and bare kind labels are not accepted.

Prompt and wait

herdr agent prompt reviewer "Review the current diff." --wait
herdr agent prompt reviewer "Ship it" --wait --timeout 120000
herdr agent prompt reviewer "Keep going" --wait --until working
herdr agent wait reviewer --until blocked --timeout 120000

--wait settles on the first idle, done, or blocked state. --until can be repeated for specific states. Submitting to an already-blocked agent is rejected with agent_blocked before any input is sent.

When an accepted prompt starts from another non-working state, --wait requires an observed working or blocked state within 5 s; otherwise it returns agent_prompt_stalled. A caller --timeout that expires first returns timeout. The wait tracks lifecycle state, not one turn — if the agent is already working, that turn's completion may match.

Standalone agent wait matches the same settled defaults; add --until for a state-specific wait. Without --timeout it waits indefinitely.

States

StateMeaning
idleReady for input; seen in the UI
workingActively running
blockedNeeds input, approval, or a decision
doneFinished; you have not looked at it yet
unknownPresent, but Herdr cannot classify it

idle and done are the same underlying state; done is the unseen variant. Focusing the tab or targeting the pane with a focus command marks it seen; CLI reads do not.

The sidebar rolls state up: a blocked agent makes its pane, tab, and workspace look blocked, a working agent makes the workspace active, and a done agent stays visible until you view it.

Inspect

herdr agent list
herdr agent get reviewer
herdr agent read reviewer --source recent-unwrapped --lines 120
herdr agent explain reviewer
herdr agent explain --file screen.txt --agent codex --json

Read sources

SourceReturns
visibleCurrently rendered viewport
recentRecent output, including soft wraps
recent-unwrappedRecent output, soft wraps joined
detectionBottom-buffer snapshot used for detection

agent get shows the resolved agent and its state. agent explain reports detection state, the matched rule, and why an idle fallback happened; add --json for machine-readable output. On agent read, use --format ansi (or --ansi) when colors and styling are evidence.

Keys and focus

herdr agent send-keys reviewer esc
herdr agent send-keys reviewer ctrl+c
herdr agent focus reviewer
herdr agent rename reviewer reviewer-2
herdr agent rename reviewer --clear
herdr agent attach reviewer --takeover

Herdr validates all keys before writing any bytes to the pane. Inspect a blocked agent with agent get and agent read before deciding what input to send. attach takes over the current terminal; detach with ctrl+b q, and send a literal ctrl+b with ctrl+b ctrl+b. Use --takeover when another attach client already owns input.

Integrations

herdr integration install claude
herdr integration uninstall claude
herdr integration status --outdated-only

Install values: pi, omp, claude, codex, copilot, devin, droid, kimi, opencode, kilo, hermes, qodercli, qwen, cursor, mastracode, antigravity-cli, grok, letta.

Every integration tells Herdr which session the agent is in, so the same session resumes after a server restart. Turn that off with [session] resume_agents_on_restore = false.

The Pi, OMP, Kimi, OpenCode, Kilo, and MastraCode integrations also report state; while they report, Herdr uses that instead of reading the screen. The others leave state to screen detection.

Patterns

New tab, start, prompt

PANE=$(herdr tab create --workspace "$HERDR_WORKSPACE_ID" \
  | jq -r '.result.root_pane.pane_id') \
  && herdr agent start reviewer --kind omp --pane "$PANE" \
  && herdr agent prompt reviewer "Review the diff." --wait

Split pane, start agent

PANE=$(herdr pane split --current --direction right --cwd "$PWD" \
  --no-focus | jq -r '.result.pane.pane_id') \
  && herdr agent start reviewer --kind claude --pane "$PANE" \
  -- --model sonnet

Prompt, then read

herdr agent prompt reviewer "Summarize the failing tests." --wait \
  --timeout 120000
herdr agent read reviewer --source recent-unwrapped --lines 120

Wait until blocked

herdr agent wait reviewer --until blocked --timeout 120000
herdr agent get reviewer
herdr agent read reviewer --source detection --lines 40

Herdr returns JSON; extract IDs with jq, and target a unique agent name, an explicit pane ID, or --current rather than the UI-focused pane.

0 Comments for this cheatsheet. Write yours!