Herdr: A Terminal Runtime for AI Coding Agents
Table of Contents
AI Coding Agent can already write code, run tests, modify configurations, and even call another Agent for code review. But when the number of Agents increases, new questions quickly arise: Which task has been completed? Which Agent is waiting for authorization? Which terminal is stuck? Can background tasks continue if I close my laptop?
The traditional approach is usually to open multiple terminal tabs, or use terminal multiplexers such as tmux and screen. They can solve the problem of “the process should not exit because the terminal is closed”, but they do not know which Agent is running in the terminal, and they cannot understand whether the Agent is currently working, waiting for input, or has completed.
Herdr is positioned to complement this layer: it is not a new AI Agent, but a terminal workspace and runtime for Coding Agent. It is responsible for hosting the real terminal where the Agent is located, maintaining session persistence, identifying Agent status, and providing CLI and Socket API for collaboration between Agents.
This article is compiled based on Herdr’s public project data, focusing on its design ideas, and does not regard the project publicity data as independent performance test conclusions.
1. Why tmux is not enough #
tmux is still an excellent general-purpose terminal multiplexer, but its abstract objects are session, window, and pane, not AI Agent. This creates several specific problems.
1. tmux does not know what is running in pane #
From the perspective of tmux, there is no essential difference between running Claude Code, Codex, a normal shell, or a pane of test scripts. Users must remember the purpose of each pane by themselves, and cannot directly query “Which Agent needs me to process”.
2. tmux cannot understand Agent status #
“Whether there is output from the terminal” is not equal to “the current status of the Agent”. An Agent may be executing a task, or it may be paused on the permission confirmation, question inquiry, error prompt, or final result page. tmux can retain the screen contents, but does not convert these contents into an operable state.
3. Lack of Agent collaboration semantics between panes #
Let one Agent write the code and another Agent do the review. The traditional method is usually to manually copy the diff, switch pane, paste the context, and then copy the review results back. The terminal multiplexer provides multiple terminals, but does not provide an interface such as “start another Agent, send it a task, wait for it to complete, and read its results”.
4. Manual inspection is still required after reconnection #
tmux can allow processes to continue running after the client disconnects, but when reconnecting, users often have to check the pane one by one to know which tasks have completed, which tasks have failed, and which tasks are waiting for input. When the number of agents increases, this inspection itself becomes a new job.
Therefore, the value of Herdr does not lie in reinventing terminal multiplexing, but in upgrading the state model of terminal multiplexers from “process and pane” to “project, agent and task”.
2. The basic architecture of Herdr: backend server and terminal client #
Herdr separates the background Server responsible for running tasks from the Client responsible for interaction:
Client(终端 UI) <──连接──> Server(后台运行)
├── Workspace
├── Tab / Pane
└── Agent / Process
Client is just the interface that the user is currently connected to. When you close the terminal, disconnect from SSH, or leave temporarily, the background server continues to manage the workspace, pane, and processes within it. The user runs herdr again, the client reconnects, and the original layout and output are still visible.
A basic session looks like this:
# 在当前项目目录启动或连接 Herdr
herdr
# 使用 tmux 风格的前缀快捷键断开客户端
# 默认:Ctrl+B,然后 Q
# 再次打开终端并重新连接
herdr
This solves the most basic problem when the Agent is running:The user interface can disappear, but the task should not stop because the interface disappears.
What needs to be distinguished is that “the client continues to run after it is disconnected” and “the original process continues to run after the machine is restarted” are not the same thing. Herdr’s public description mentions that it can save the session state and restore the layout after restarting; whether the original process can survive depends on whether the machine is restarted and whether the Agent supports recovery. Don’t understand this to mean that all process contexts can be saved unconditionally across machines and restarts.
3. Agent status detection: turning “stuck” into a visible state #
One of the core capabilities of Herdr is to mark the status of the Agent in the terminal. Common statuses in public profiles include:
| status | meaning |
|---|---|
working | Agent is performing a task |
blocked | Agent is waiting for user input, authorization or confirmation |
idle | Agent is currently idle, waiting for the next instruction |
done | Agent has completed the current work and is waiting for the user to view |
unknown | The status cannot be reliably determined at the moment. |
It does not simply judge the status by “whether there has been output recently”, but combines multiple signals:
- Foreground process identification: Determine which supported Agent CLI is running in the pane;
- Screen mode matching: Read the bottom or recent content of the terminal and match the interface characteristics of the Agent;
- Status inference: Infer that the Agent is working, blocked or idle based on the prompt, waiting for confirmation interface and output changes.
For example, when an Agent enters the permission confirmation interface, Herdr can mark the corresponding pane as blocked. Users do not need to scroll through the terminal one by one. They only need to look at the sidebar or workspace summary to prioritize tasks that really require manual intervention.
This is a very important interactive transformation: the terminal is no longer just a place to output logs, but becomes the status panel of the Agent.
4. Inter-Agent collaboration: let one Agent command another Agent #
Herdr also provides CLI and Socket API for Agent. With these interfaces, one Agent can perform structured operations on another Agent, such as:
- creates a new pane and starts another Agent;
- sends task prompts to the specified Agent;
- waits for another Agent to enter the specified state;
- reads the recent output of another Agent;
- Send keystrokes to the Agent, such as canceling the current operation.
indicates the command as follows:
# 启动一个用于审查的 Agent
herdr agent start reviewer --kind codex --pane w1:p2
# 发送审查任务并等待结果
herdr agent prompt reviewer \
"Review the current diff and report actionable findings." \
--wait --timeout 120000
# 读取审查结果
herdr agent read reviewer --source recent-unwrapped --lines 120
This will form an automation link:
主 Agent 编码
↓
启动审查 Agent
↓
发送审查任务
↓
等待并读取结果
↓
主 Agent 根据反馈继续修改
Compared with “putting all Agents into multiple panes”, there is an extra layer of real orchestration semantics here. Agents can treat other Agents as callable execution units, instead of relying on users to manually copy and paste.
However, being able to communicate between Agents does not mean that they are inherently safe. Production use should still be limited to:
- Which Agents can create other Agents;
- Which Agents can send commands or keystrokes;
- Which directories and credentials can be accessed;
- Which operations must be returned to manual approval. Capabilities like
and especially send-keys are essentially close to directly operating another terminal. Permission boundaries should be treated with the same strictness as normal shell automation.
5. Workspace: Organize Agent by project #
Herdr uses a hierarchical workspace model:
Workspace
└── Tab
└── Pane
└── Agent / Shell / Server
Workspace: Project-level isolation #
A Workspace can correspond to a project or a group of closely related tasks. Backend, frontend, infrastructure and documentation projects can be placed in separate Workspaces to avoid all Agents being mixed in the same global list.
Tab: Different views of the same project #
Multiple Tabs can be created in the same project:
agents: Run Agents such as Claude Code and Codex;server: Run the local development server;logs: View build, test, or service logs.
Pane: real terminal process #
Pane is not a panel that can only display logs, but a complete terminal environment. You can run agents, shells, test commands, or development servers in it. This design maintains the compatibility of existing CLI tools and avoids forcibly encapsulating each Agent into a special plug-in.
The key benefits of this model are:Project boundaries, view boundaries, and process boundaries are simultaneously visible. Users can switch to the project first and then view the Agent status of the project, instead of searching for a certain process in all terminals.
6. Mouse and Keyboard: Reduce the learning cost of terminal tools #
Traditional terminal multiplexers usually have keyboard priority. Users who are familiar with shortcut keys are very efficient, but new users need to remember operations such as prefixes, split screens, switching and closing.
Herdr treats both mouse and keyboard as first-class interactions:
- Click pane to switch focus;
- Drag the divider to resize;
- Right-click to open the context menu;
- uses tmux-style prefix shortcut keys;
- Automates operations via CLI and Socket API.
This results in three usage levels:
- Newbies can first use the mouse to complete basic management;
- Users familiar with tmux can continue to use similar keyboard habits;
- Automation systems and Agents can directly control the workspace through CLI/API.
A good terminal tool should not require everyone to use the same interaction method. Humans are responsible for judgment and approval, keyboards are responsible for high-frequency operations, and agents or scripts are responsible for repetitive arrangements.
7. How to build a reliable Agent runtime #
From Herdr’s design, a checklist can be abstracted that does not rely on specific tools.
1. Session persistence #
- After the client is disconnected, the background task continues to run;
- Layout, output and status can be restored after the user reconnects;
- Use named sessions or independent Workspaces for different projects;
- The recovery boundary after machine restart is clear and verifiable.
2. Agent status is visible #
- distinguishes
working,blocked,idleanddone; - has a unified sidebar or list summary status;
- Provides reminders for tasks awaiting authorization, input, or confirmation;
- State recognition failure is clearly marked as
unknown, don’t pretend to be sure.
3. Agent can collaborate #
- Agent can start or request another Agent;
- can wait for clear state transitions instead of blindly sleeping;
- can read structured, traceable output;
- Set permission boundaries for creating processes, sending commands, and accessing credentials.
4. Items can be isolated #
- Each project has an independent Workspace;
- Agent, logs and services can be placed in different tabs;
- The working directory, environment variables and permissions of each Pane can be tracked;
- Keep audit records of important operations.
8. What scenarios is Herdr suitable for? #
Herdr is particularly suitable for the following workflows:
- runs multiple Coding Agents at the same time;
- One Agent codes, and another Agent does review or testing;
- Long-running test, build, or migration tasks are required;
- works on a remote development machine via SSH;
- Hope that the task will continue after closing the laptop;
- Need to quickly switch Agent collections between multiple projects.
It does not replace all tools:
- A normal terminal is simpler when running only a short command;
- tmux is still sufficient when only generic session persistence is required;
- When you need full IDE debugging capabilities, you should still use an IDE or a dedicated debugger;
- When complex cross-machine scheduling is required, queues, permissions, logs, and resource management systems are also required.
Herdr solves the problem of “how to reliably host multiple Coding Agents in local or remote terminals”, rather than a complete distributed Agent platform.
Conclusion: In addition to Agent capabilities, a runtime is also needed #
People usually focus on which model is smarter and which Agent is better at writing code, but the actual efficiency of a multi-Agent system also depends on the runtime: whether the task can be sustained, whether the status is visible, whether the Agent can cooperate, and whether humans only intervene when necessary.
Herdr’s design has four key features:
- Backend server allows the task to continue running after the terminal client is disconnected;
- Status detection allows users to quickly discover Agents that are waiting for input or have completed;
- CLI/API collaboration enables Agents to launch, command, and read other Agents;
- Workspace model allows projects, views, terminals and agents to form a clear hierarchy.
If you are only running one Agent, tmux may be sufficient. If you start running coding, testing, reviewing, and researching Agents at the same time, the “Terminal Multiplexer” ceases to be just a layout tool and increasingly becomes the Agent’s runtime infrastructure.
References #
- Herdr GitHub repository
- Herdr Quick Start Document
- Herdr core concept
- Herdr Agent Skill
- Herdr session status
Written by Jermine. View original text.