Skip to content

Working with Herdr

Herdr / herdr-core (hc) keeps terminals alive across turns, disconnects, and remote machines. When you run fast-agent inside an hc terminal (or a Herdr pane), it detects the environment automatically — reporting live status, tracking child workers, keeping your prompt cache warm while you wait, and letting you attach to or take over any worker at any time.

Quick start

Start fast-agent inside an hc terminal with -x (shell access) so the agent can coordinate other hc terminals and receives the built-in hc guidance:

fast-agent -x

To confirm fast-agent sees hc, status reporting, and terminal image support:

fast-agent check terminal --image

fast-agent check terminal --image output inside Herdr

From there, you don't need to memorize hc commands — just ask your agent in plain English:

  • "Spin up two workers in separate git worktrees to implement X and Y, and review both before we merge."
  • "Have Claude Code or Codex review this diff in a worker terminal and report back."
  • "Read the traceback in my tests pane, fix it, and re-run the suite there."
  • "Start the dev server in the background as a service so I can test in the browser."
  • "Check the branch on my vps machine and run the test suite there."

fast-agent's default system prompt automatically injects herdr.md, which points the agent to read hc --skill (the version-matched manual) and supplies core coordination rules.


Reading the UI and symbols

When fast-agent is coordinating hc children, a few cues tell you what is still running and whether the session will wake up on its own:

Indicator Where Meaning
⧗ hc · waiting on … End of turn At least one waking hc child is still running — fast-agent will wake automatically when it reports or exits.
⧗ <name> Status bar Live waiting badge while the prompt is idle and waiting on hc children.
warm next HH:MM Status bar & Herdr Automatic prompt-cache warming while waiting on hc children (up to cache_warm.max_minutes). See Prompt-cache warming.
hc · 1 service End of turn / bar A long-lived --label role=service process (such as a dev server) is running; it does not wake the session or hold cache warming open.
▎▶ hc · t2 … Turn heading A peer message (<hc from="...">) or exit notice (<hc>) from herdr-core, unwrapped into a clean heading.

In Herdr, the sidebar mirrors the coordinator's live status — showing nested child workers, waiting on 2: audit-cli, audit-docs, and the automatic cache-warming schedule alongside the ⧗ waiting badge in the terminal toolbar:

Herdr workspace with coordinator waiting on two parallel hc child workers

Once both children report back and are cleaned up, the waiting badge clears and the toolbar returns to the normal cache until countdown:

Herdr workspace after both hc child workers report back and are cleaned up

Here is the full launch → wait → wake cycle recorded live in a terminal:


Working alongside your agents

Watch, steer, or take over a worker

Every hc worker is a real terminal. Run hc ls to see live terminals, or attach directly to any worker (or click it in Herdr):

hc ls
hc attach rev-auth     # Ctrl+\ detaches without stopping the worker

Because workers are live interactive sessions, you can step into a worker mid-task — answer its questions, approve a change, or say "go with option 2" — and detach again while it finishes and reports back to your coordinator.

Read, prompt, and drive other panes

fast-agent is not limited to workers it spawned itself. It can read output and scrollback from any other hc pane (hc read), send prompts or input to another running agent or REPL (hc send), and run interactive shell commands, builds, or test suites in separate panes you can watch live.

Type while a turn is running

You can type and queue follow-up messages while fast-agent is mid-turn. If an <hc> message from a child arrives while you are halfway through typing a prompt, fast-agent saves your draft, delivers the child's message cleanly, and restores your unfinished text afterwards.

Press Esc (or Ctrl+C) to cancel an active turn without losing queued messages.

Check outstanding work with /events and /subagents

  • /events shows a unified view of everything that can wake the session: active MCP Events subscriptions alongside a herdr-core children section listing outstanding waking hc tasks (with elapsed time) and running role=service count.
  • /subagents list shows persisted child runs — local interactive hc workers automatically nest their session history under the coordinator alongside built-in subagents.

Paste images and copy across machines

  • Images: Pressing Ctrl+V in Herdr (or running hc put) uploads the image to the terminal's machine; fast-agent recognizes the uploaded path and attaches it automatically for image-capable models.
  • Clipboard: Inside hc, fast-agent routes copy actions over OSC 52 so copying from a remote or attached pane reaches your local clipboard.

Resuming after a restart

If herdr-core restarts or a host shuts down while a session or its children are running, fast-agent pauses before activating status reporting so queued restart notices don't spill into a blank session. You get a recovery prompt:

  • [r] Resume the interrupted session bound to this terminal.
  • [c] Clear stopped_by_restart children (hc rm) and resume (or start fresh).
  • [n] Start a fresh session.

fast-agent also publishes Program Resume Protocol records so hc knows which session belongs to each terminal.


Patterns that work well

1. Define role templates for models you use often

Put reusable worker or reviewer roles in ~/.config/herdr-core/templates/<name>.md (check them with hc templates). Once defined, your coordinator can launch your preferred reviewer model in one step without startup handshakes:

~/.config/herdr-core/templates/reviewer.md
---
name: reviewer
description: Read-only code reviewer
command: fast-agent go --shell --no-subagents --model 'codexresponses.gpt-6.2-astra?reasoning=high'
---
Review the requested changes read-only. Do not edit files or run git mutations.
Report findings to your parent with `hc send` and end your turn.

If a local hc child is launched without --model and no default_model is configured, fast-agent inherits the live parent session's model automatically (or falls back to $system.last_used) instead of stalling on the interactive model picker.

Workers don't have to be fast-agent — because hc runs any interactive CLI, fast-agent can also delegate to Claude Code (claude), Codex (codex), or other terminal agents (directly or via hc templates) and still track live status, receive hc send reports, and let you attach or take over the exact same way.

2. Reuse one reviewer across fix rounds

Ask your coordinator to keep the same reviewer terminal alive across fix → re-review → approval rounds. Reusing one worker preserves its conversation context and provider prompt cache, and avoids re-reading the codebase on every round.

3. Separate parallel edits with worktrees or file allowlists

  • For parallel implementation, ask for separate git worktrees (git worktree add ...) so builds, tests, and git state don't collide.
  • For parallel work in one checkout, ask the coordinator to write brief files with disjoint file allowlists and forbid workers from running git commit, git checkout, git stash, or git reset.

4. Use remote machines naturally

Once another machine is added with hc machine add, your local coordinator can run commands there (hc exec --on <machine>), inspect open remote terminals (hc read <machine>/<addr>), or launch full remote workers (hc run --on <machine> --bg ...) when the remote box has repos, GPUs, or credentials you don't have locally.

5. Mark servers and dashboards as services

When you ask an agent to run a dev server, preview server, or dashboard in the background, having it use --label role=service --outlive-parent --no-notify keeps the server running across turns without triggering false "waiting on worker" badges or unnecessary cache warming. Remember to stop it with hc kill <name> && hc rm <name> when you're done.


Personal preferences (AGENTS.herdr.md)

Put your own model preferences and coordination conventions in ~/.fast-agent/AGENTS.herdr.md (or $FAST_AGENT_HOME/AGENTS.herdr.md if FAST_AGENT_HOME is set). fast-agent automatically appends it after the built-in herdr.md prompt whenever you run with shell access inside a local hc terminal — and skips it completely outside hc, so it adds zero prompt overhead to regular sessions.

~/.fast-agent/AGENTS.herdr.md
Good models for delegated work:
- `codexresponses.gpt-6.2-astra?reasoning=high` — strong for code reviews, coordination, and second opinions. Constrain it to favor simplicity on repeat passes.
- `google.gemini-4-hydrogen` — fast, reliable implementation and analysis.

Use Claude Code for user experience design reviews.

Practical `hc` conventions:
- For non-trivial tasks, write a brief file (`/tmp/<slug>-brief.md`) naming the return address (`hc send <$HC_TERMINAL_ID>`) and verification steps.
- When parallel workers share a checkout, give each a disjoint file allowlist and forbid `git commit`, `checkout`, `stash`, and `reset`.
- Reuse the same reviewer terminal across fix/re-review rounds to keep context and prompt cache warm; kill and remove accepted workers immediately (`hc kill <name> && hc rm <name>`).

Feature & configuration reference

Feature Default behavior inside hc How to control
Built-in hc guidance Injected via {{herdrInstructions}} when HC_TERMINAL_ID + HC_TERMINAL_SOCKET are set and --shell is enabled; appends AGENTS.herdr.md from FAST_AGENT_HOME or ~/.fast-agent if present. Include or omit {{herdrInstructions}} in custom AgentCards; customize via AGENTS.herdr.md.
Headless child startup hc children skip first-run plugin offers, update checks, and the interactive model picker (inheriting the parent's model or $system.last_used, or failing fast if none is configured). Pass --model <provider.model> (or bare --model to force the picker).
Live terminal status Reports idle, working, blocked (question, permission, or OAuth), error, model, context %, queued input count, child count, and cache countdown via the Program Status Protocol. Automatic on TTYs.
Automatic cache warming Keeps the coordinator's prompt cache warm while idle and waiting on waking hc children, up to cache_warm.max_minutes. cache_warm.auto in config, or /warm / /warm off.
Session resume records Publishes Program Resume Protocol records binding the terminal to its active session. FAST_AGENT_DISABLE_PROGRAM_RESUME=1
Mid-turn input queueing Queues human and <hc> input arriving during a turn and preserves unfinished drafts. FAST_AGENT_DISABLE_TURN_INPUT=1
Nested child sessions Local interactive hc children appear under the parent in /subagents list. Automatic for live local parents.
Terminal images Uses Herdr-aware halfcell rendering when HERDR_ENV=1. Standard terminal image settings.

Quick troubleshooting

What you see Likely cause What to do
A worker shows blocked in Herdr or hc ls It is waiting on an OAuth login, elicitation prompt, or confirmation. Run hc attach <name> (or click the pane in Herdr) to answer it, then detach (Ctrl+\).
Coordinator keeps polling hc wait instead of idling The agent is running a long hc wait or sleep loop. Tell it to end its turn and let hc wake it when children report.
A background server keeps ⧗ hc · waiting on ... active The server was started without --label role=service --no-notify. Restart it with --label role=service --outlive-parent --no-notify, or hc kill && hc rm when done.
A service or worker fails with command not found (node, uv, etc.) hc starts programs with its daemon environment, not your interactive shell's PATH. Check hc exec env and pass an explicit PATH or absolute binary path.
A worker crashed mid-turn Provider stream drop or transient error. Run hc read <name> to check where it stopped, hc kill <name> && hc rm <name>, and ask the coordinator to resume its session (fast-agent go --resume <id>) or spawn a replacement.
Sending a / slash command via hc send hits the model instead hc send wraps text in <hc from="...">...</hc> when HC_TERMINAL_ID is set. Unset HC_TERMINAL_ID and HC_SCOPE: env -u HC_TERMINAL_ID -u HC_SCOPE hc send <name> '/status'.