Skip to main content

Herdr: A Persistent Terminal for Several Coding Agents

When several coding agents run at once, Herdr gives them one persistent terminal. Its background server owns real terminal processes, so work inside a pane can continue after the client closes, detaches, or loses its SSH connection. Herdr also identifies agents in panes and rolls states such as working, blocked, done, and idle into a sidebar.

Herdr answers where terminals and agents are, what they are doing, and how to reconnect to them. It does not provide code isolation, permission approval, or Git ownership. Parallel writers still need separate worktrees. The examples below use three agents, Pi, Codex, and Antigravity CLI; Herdr officially supports many more.

Divide the workspace by responsibility​

Herdr's concept model has five useful layers:

  • a session is an independent background server namespace; most users only need the default session;
  • a workspace represents one repository, task, or investigation;
  • a tab separates views such as agents, logs, and servers;
  • a pane is a real terminal that can run a shell, agent, test, or service;
  • an agent is a process that Herdr recognizes inside a pane.

This structure separates terminal layout from code ownership. Herdr may show three agents in one workspace, but it cannot prevent them from overwriting the same file.

Install Herdr and the integrations​

The official installation guide gives this direct installer for Linux and macOS:

curl -fsSL https://herdr.dev/install.sh | sh
herdr --version

The official integration list currently has 18 entries: pi, omp, claude, codex, copilot, devin, droid, kimi, opencode, kilo, hermes, qodercli, qwen, letta, cursor, mastracode, antigravity-cli, grok. Install one for each CLI already on the machine; three serve as the example here:

herdr integration install pi
herdr integration install codex
herdr integration install antigravity-cli
herdr integration status

The three integrations report different information, as described in the integration reference:

AgentWhat the integration addsSource of lifecycle state
PiLifecycle reports and a native session referenceDirect reports from the Pi extension
Codex CLISession identity for restore after a restartHerdr screen detection
Antigravity CLIConversation ID after the first prompt, used for restoreHerdr screen detection

The Antigravity CLI hook runs on PreInvocation. A new agy pane must therefore send at least one prompt before Herdr knows its conversation. Herdr restores it with agy --conversation <id>.

The Codex integration changed in 0.9.5 (2026-10-14): Herdr no longer installs Codex turn hooks, and Codex status comes only from screen detection again. If you installed it earlier, run herdr integration install codex once more; native session restore requires Codex integration version 5.

Since 0.9.2, an agent missing from the official list can report its own resume command. After a server restart Herdr reopens that exact session, and it clears the record once the pane is back at an idle shell. The guide for agent authors describes the protocol.

Daily operation​

Start Herdr from a project directory, then run agents in separate panes:

cd ./repository
herdr

# Run these in separate panes
pi
codex
agy

A new user can work entirely with the mouse: click panes and tabs, drag split borders, and use the right-click menu. The keyboard guide defines the default prefix as ctrl+b. Press it, release it, and then press ? to see the bindings that are active. Its starter actions include:

  • prefix+v to split right;
  • prefix+minus to split down;
  • prefix+c to create a tab;
  • prefix+q to detach while background work continues.

Run herdr later on the same machine to reconnect. To stop the default background session rather than detach, use the documented herdr server stop command:

herdr server stop

Since 0.9.4, closing the shell that started Herdr on Linux or macOS no longer stops the server. Scripts that stopped Herdr with SIGHUP should use herdr server stop or SIGTERM.

For remote work, the simplest path is normal SSH: connect to the machine and run Herdr there. The remote workflow guide also documents a thin client over SSH, using an SSH-config host such as herdr --remote workbox or an explicit target such as herdr --remote ssh://you@server:2222. SSH authentication and host verification remain the transport boundary; Herdr does not require exposing its local socket to the network.

Know what survives​

The session-state reference distinguishes these recovery paths that are easy to confuse:

EventWhat survivesWhat is not guaranteed
Client detach and reattachPane processes, layout, recent screen contents, and the conversationTransient client UI state
Normal server restartWorkspace, tab, pane, cwd, layout, and focus; eligible native agent sessions can resumeContinued life of arbitrary shells, tests, servers, or other processes
Plain herdr updateCompatible endpoint-generation-1 servers and their pane processes keep runningOlder servers may require a stop; new server-side features require updating the server
herdr update --handoffAttempts to preserve pane PTYs, processes, agent identity, and durable metadata across server replacementIn-flight requests, streams, messages, or transient coordination

As the update guide explains, after a plain update you reconnect with the new client; server-side changes take effect only after a later server restart or a handoff. Servers from before endpoint generation 1 require a one-time stop during update. Live handoff is experimental and opt-in with --handoff; package-manager updates do not perform it. Resuming an agent conversation still does not revive arbitrary processes.

Keep the control boundaries separate​

Use Herdr as a terminal control plane:

  1. assign one workspace to one clear project or task;
  2. assign one writer to one checkout or worktree (see multi-agent coordination);
  3. constrain scope with project rules every agent reads, such as AGENTS.md;
  4. let Herdr provide state, layout, detach, and reconnection;
  5. use Git diffs, tests, and independent review to decide whether work is complete.

If sidebar state looks wrong, run herdr integration status, confirm that the agent started inside a Herdr pane, and verify that the integration was installed for the same user. Then follow the official agent command reference and use herdr agent list and herdr agent explain <target> --json to inspect how Herdr classified the pane.

Explore connectionsOpen network