/agents:herdr-atomicfrom AI Agents and Models
Deterministic scripts for driving herdr, the terminal workspace manager that keeps coding agents alive in persistent panes. Use this skill whenever herdr is mentioned by name, and also whenever the task calls for running a command in another pane, delegating work to a second or parallel coding agent, orchestrating several agents at once, reading or waiting on another pane's output, or checking what agents are currently running — even if the user never says the word 'herdr'. Each script performs one atomic action and returns JSON with fixed exit codes, so never hand-compose herdr CLI invocations or parse its output yourself. Requires herdr 0.8.2 or newer.
Ships in AI Agents and Models. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Ten scripts in scripts/. Each one performs a complete action and prints a single JSON object on stdout. Run them; do not reconstruct what they do from raw herdr commands.
That restriction is the point. The herdr CLI has sharp edges that cost a run to discover — responses that are not valid JSON, a pane run that reports no exit status, an agent start that returns success onto a dialog whose default button quits the agent. Every script here already handles the edge it touches. Composing the CLI by hand means rediscovering them.
| You want to | Run |
|---|---|
| Check herdr is usable and see what is live | preflight.sh |
| List workspaces, panes, and agents | snapshot.sh |
| Make somewhere to work | new_pane.sh |
| Run a command and get its exit code and output | run_cmd.sh |
| Read what is on a pane or agent screen | read_pane.sh |
| Block until an agent settles or text appears | wait_for.sh |
| Start a coding agent in its own pane | spawn_agent.sh |
| Give a running agent work and get its reply | ask_agent.sh |
| Press keys — answer a dialog, interrupt a process | send_keys.sh |
| Close what these scripts created | cleanup.sh |
Every script accepts --session NAME and -h. Run -h for its full arguments.
Branch on the exit code. It is the same everywhere, so you never need to read the message to decide what to do next.
| Code | Meaning | What to do |
|---|---|---|
| 0 | Success | Continue. |
| 2 | Bad arguments to the script | Fix the call; check -h. |
| 3 | Not inside herdr and no session named | Pass --session NAME. |
| 4 | herdr missing, too old, or no server running | Report it; do not retry. |
| 5 | Timed out | The work may still be running. Read the pane before assuming failure. |
| 6 | Agent is blocked at a dialog | read_pane.sh it, then send_keys.sh. Never guess. |
| 7 | Pane or agent does not exist | Re-check with snapshot.sh. |
| 8 | Other herdr error | Read .message. |
run_cmd.sh is the exception worth remembering: a command that fails still exits 0, because running it was successful. The command's own status is in .exit_code.
Nothing implicit. These scripts act inside a herdr pane (HERDR_ENV=1) or on a session you name with --session. With neither, they exit 3 rather than reach for whichever pane happens to be focused — that pane may belong to the human.
Nothing you did not create. Creating scripts record what they made. cleanup.sh closes only those records, so it cannot close the user's own work. Use --dry-run to see the list first.
Run something and check the result:
scripts/run_cmd.sh --cmd "npm test" --new-pane --timeout 300000
# -> {"ok":true,"pane_id":"w1:p3","exit_code":1,"output":"..."}
Delegate to another agent:
scripts/spawn_agent.sh --kind codex --name reviewer --cwd "$PWD"
# -> {"ok":true,"agent":"reviewer","pane_id":"w1:p4","kind":"codex","status":"idle"}
scripts/ask_agent.sh --agent reviewer --prompt "Review the current diff." --timeout 600000
# -> {"ok":true,"agent":"reviewer","status":"idle","text":"..."}
Fan work out to several agents by spawning them all first, then prompting each — ask_agent.sh blocks until its agent settles, so prompt in one pass and collect in another rather than spawning and waiting one at a time.
When spawn_agent.sh or ask_agent.sh exits 6, the agent is alive and waiting on a question:
scripts/read_pane.sh --agent reviewer --source visible # see what it asked
scripts/send_keys.sh --agent reviewer down enter # answer deliberately
Read the dialog before answering it. First-run agents commonly open a trust prompt whose highlighted default is No, exit, so a reflexive enter quits the agent instead of continuing.
Keep the human's focus where they left it — creation defaults to --no-focus; pass --focus only when the user asked to be taken somewhere.
Prefer run_cmd.sh over typing a command with send_keys.sh. It submits atomically and returns the real exit code; typing plus enter gives you neither.
Split panes get narrower each time. For more than two or three parallel agents, give each its own tab with new_pane.sh --where tab.
Agent names must match [a-z][a-z0-9_-]{0,31} and be unique among live agents. Omit --name and one is generated.
If wait_for.sh --pane --match returns instantly, check the matched line: herdr's snapshot includes text already on screen, so a pattern can match the command being echoed rather than its output. run_cmd.sh avoids this with a unique end-marker; prefer it for anything you are running yourself.
references/herdr-cli.md holds the details these scripts wrap — read it only when you need something the scripts do not cover, such as worktrees, plugins, or pane geometry.
evals/evals.json (opens in a new tab)references/herdr-cli.md (opens in a new tab)scripts/_lib.sh (opens in a new tab)scripts/ask_agent.sh (opens in a new tab)scripts/cleanup.sh (opens in a new tab)scripts/new_pane.sh (opens in a new tab)scripts/preflight.sh (opens in a new tab)scripts/read_pane.sh (opens in a new tab)scripts/run_cmd.sh (opens in a new tab)scripts/send_keys.sh (opens in a new tab)scripts/snapshot.sh (opens in a new tab)scripts/spawn_agent.sh (opens in a new tab)scripts/wait_for.sh (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub mattmakes/skill-marketplace --plugin agents24 skills in this plugin
/agent-architecture-auditFull-stack diagnostic for agent and LLM applications. Audits the 12-layer agent stack for wrapper regression, memory pollution, tool discipline failures, hidden repair loops, and rendering corruption. Produces severity-ranked findings with code-first fixes. Essential for developers building agent applications, autonomous loops, or any LLM-powered feature. Use when an agent or LLM feature misbehaves and the failing layer is unknown, or before shipping an agent stack./autoresearch-agentAutonomous experiment loop that optimizes any file by a measurable metric. Inspired by Karpathy's autoresearch. The agent edits a target file, runs a fixed evaluation, keeps improvements (git commit), discards failures (git reset), and loops indefinitely. Use when: user wants to optimize code speed, reduce bundle/image size, improve test pass rate, optimize prompts, improve content quality (headlines, copy, CTR), or run any measurable improvement loop. Requires: a target file, an evaluation command that outputs a metric, and a git repo./book-to-skillConverts books, documentation folders, and source collections (PDF, EPUB, DOCX, HTML, Markdown, RST, AsciiDoc, RTF, MOBI/AZW) into structured agent skills — extracting named frameworks, principles, techniques, and anti-patterns into a master SKILL.md plus on-demand chapter files, a glossary, a patterns file, and a decision cheatsheet. Use when the user wants to study a document with an agent, apply an author's frameworks while working, turn internal docs or standards into a reusable knowledge base, or package a compiled book skill as a Claude Code plugin./checkpoint-promotionGate fine-tuned checkpoints with drift budgets, paired comparison, and forgetting checks before promotion. Use after a training run produces a checkpoint, when deciding whether a tuned model ships, or when a promoted model needs re-gating against updated goldens./cli-for-agentsDesigns or reviews CLIs so coding agents can run them reliably: non-interactive flags, layered --help with examples, stdin/pipelines, fast actionable errors, idempotency, dry-run, and predictable structure. Use when building a CLI, adding commands, writing --help, or when the user mentions agents, terminals, or automation-friendly CLIs./dataset-curationPrepare, format, and validate datasets for supervised fine-tuning and preference training. Use when converting raw data into training format, applying chat templates, configuring sequence packing, generating synthetic training data, or writing a dataset card before a run.