How to use Herdr skills and herdr --skill
By Flavio
Tagged: AI
Learn how to install the Herdr agent skill, use herdr --skill, and let coding agents safely inspect, split, run, and wait in panes.
You can drive Herdr straight from the command line, and that gets a lot more useful once you run a coding agent inside it. From a managed pane, an agent can inspect your workspace, open a new pane, spin up a helper agent, wait for tests to finish, and read back the output.
An agent won’t guess those commands or the safety rules around them on its own, though. That’s what the Herdr skill is for: it hands the agent the exact CLI reference and guardrails it needs. If you’re new to Herdr itself, read my deep dive into Herdr first.
What is the Herdr skill?
The Herdr skill is a Markdown instruction file that teaches a coding agent how to drive the Herdr session it’s already running inside (it doesn’t install Herdr for you). That’s different from a Herdr plugin, which is executable code that adds new workflows, actions, events, or panes to Herdr itself.
With the skill loaded, your agent knows how to:
- list workspaces, tabs, panes, and agents
- split a pane without stealing your focus
- run a command in another pane
- read recent terminal output
- wait for a test, server, or agent to finish
- start a helper agent in a sibling pane
It also draws a clear line between a pane and an agent. A pane might hold a regular shell, a dev server, a test runner, or a coding agent. Pane commands work on the terminal itself, while agent commands talk to a recognized coding agent and track its lifecycle states, so automation doesn’t end up treating every shell like an AI session.
Print the skill with herdr —skill
If you already have Herdr installed, you can print the skill bundled with your binary:
herdr --skill
That lets you read through the instructions before handing them to an agent, and it guarantees the command reference matches the Herdr release on your machine.
If your agent expects a local instruction file, redirect that output to a file:
herdr --skill > HERDR-SKILL.md
Skim the file before you commit it to a repo. It’s fairly long because it packs in command syntax, coordination recipes, and safety rules. Most of the time you’re better off installing the reusable skill instead of dropping a generated copy into every repository.
Install the skill globally
Herdr ships the skill straight from its GitHub repository, so you can install it globally with one command:
npx skills add herdrdev/herdr --skill herdr -g
Passing -g makes the skill available to supported agents across all your projects. If you’d rather keep it scoped to a single repository, drop the flag:
npx skills add herdrdev/herdr --skill herdr
If you’re using an agent that doesn’t support reusable skills yet, open the Herdr skill file on GitHub and copy its contents into whatever project or user instruction file your agent loads.
Start the agent inside Herdr
Installing the skill only gives the agent the instructions, so you still need to launch the agent inside a Herdr-managed pane. Start Herdr first:
herdr
Once Herdr is up, launch your coding agent inside one of its panes:
codex
You can swap that for Claude Code, Cursor Agent CLI, OpenCode, or whichever supported agent you use.
Every pane managed by Herdr gets HERDR_ENV=1 set in its environment, and the skill tells the agent to check for it before running any control commands:
test "$HERDR_ENV" = 1
If that variable isn’t set, the agent stops right there. That guardrail keeps an agent running in a plain terminal from reaching over and touching a separate Herdr session you happen to have open.
Try a small task first
Don’t start by asking your agent to spin up ten panes at once. Test the setup with one small, visible job where you can watch every step happen:
Use the Herdr skill. Inspect the current workspace, split a pane to the right without changing my focus, run the test command in that pane, wait for it to finish, and summarize the result.
First, the agent checks what’s currently running in the session with commands like these:
herdr workspace list
herdr pane current --current
herdr pane list --workspace "$HERDR_WORKSPACE_ID"
Next, it opens a new pane in the same working directory without grabbing your cursor:
herdr pane split \
--current \
--direction right \
--cwd "$PWD" \
--no-focus
Herdr answers with JSON containing the new pane ID, and the agent reads that ID straight from the response instead of guessing one. From there, it runs your command in that pane and inspects the output:
herdr pane run w1:p2 "npm test"
herdr pane wait-output w1:p2 \
--match "tests passed" \
--timeout 120000
herdr pane read w1:p2 \
--source recent-unwrapped \
--lines 120
Here w1:p2 is just an example, because Herdr assigns live IDs for each session.
Let one agent start another
Once a single pane works, the same skill lets one agent coordinate another. Say your main agent finishes a change and wants a review. It splits a pane, grabs the returned pane ID, and launches a named helper agent:
herdr agent start reviewer \
--kind codex \
--pane w1:p2
With that agent running, it sends a prompt and waits for the reply:
herdr agent prompt reviewer \
"Review the current diff and report only actionable findings." \
--wait \
--timeout 120000
Because the helper has the name reviewer, the main agent can keep addressing it by name even if the terminal layout changes.
Herdr also tracks whether a recognized agent is working, blocked, done, idle, or unknown. Instead of polling terminal output and parsing raw text, the coordinator can wait for a specific lifecycle state:
herdr agent wait reviewer \
--until blocked \
--timeout 120000
Save that wait command for moments when you’re expecting an approval prompt or a question. For an ordinary task, herdr agent prompt ... --wait handles everything you need.
The skill is not the human guide
Herdr ships two separate documents that are easy to mix up:
herdr --skillgives an agent the instructions it needs to operate Herdr- herdr.dev/agent-guide.md helps an agent explain Herdr to a human
Reach for the skill when you want an agent controlling panes and running commands, and point it at the guide when you want help with setup, concepts, configuration, or troubleshooting.
Common problems
The agent says it is not inside Herdr
Run this inside the pane where the agent is running:
printf '%s\n' "$HERDR_ENV"
If it doesn’t print 1, you’re outside a managed session. Start Herdr first and launch your agent from one of its panes, because installing the skill won’t pull an already-running agent into Herdr.
The agent starts Herdr instead of controlling it
Running bare herdr opens or attaches the TUI, so the skill explicitly tells agents not to use it to explore commands. Have your agent inspect the CLI with these instead:
herdr --help
herdr pane
herdr agent
Both print the available command groups without touching your workspace.
The agent targets the wrong pane
Tell it to pass --current, an explicit pane ID, or a unique agent name on every call. Relying on whichever pane happens to have focus in the UI feels fine when you’re typing commands yourself, and breaks fast when an agent is driving.
The commands in an old skill no longer match
After upgrading Herdr, print the skill straight from your binary to see the current commands:
herdr --skill
That always reflects the version you have installed. When you want to refresh the copy managed by your agent’s skill system, reinstall the reusable skill.
My recommendation
If you run coding agents inside Herdr regularly, install the skill globally with -g so you don’t have to copy a long Markdown file into every repo. Start with a single-pane task (like splitting off a test run) to verify HERDR_ENV=1 and pane targeting work the way you expect, and then move on to spinning up a named reviewer or test runner in a sibling pane.
You’ll get stable pane IDs and state-based waits instead of an agent hijacking your cursor or scraping terminal scrollback. When you need the full list of commands and flags, check the official Herdr agent skill documentation.
Want me to talk about your product? You can sponsor this site.
Related posts about ai: