Skip to main content
Beato
  1. All Articles/

A Complete Guide to Herdr for AI Coding Workflows

·9 mins

A terminal workspace manager that allows AI agents to never go offline.

Preface: Why do you need Herdr? #

Have you ever encountered such a scenario: the AI ​​programming assistant is running a long task for you, you close your laptop and go to a meeting, and when you come back you find that the process has been interrupted - everything has to start all over again? Or you have several AI agents running in multiple projects at the same time, switching back and forth, and you are completely confused about which one is busy, which one is stuck, and which one has finished running?

Herdr was created to solve these problems. There is a sentence in the official document that summarizes it very accurately:“Herdr is the runtime your coding agents live on.”- It is the “runtime environment” that your AI programming agents live on.

Simply put, Herdr is aTerminal workspace manager, designed for running multiple AI programming agents (such as Claude Code, Codex, Cursor, etc.) simultaneously. Its core concept is: let each agent stay in a real terminal window,The shell, logs, prompts, and running processes are all intact. You close the terminal window, close the laptop, or even restart the computer, they will not stop - when you come back, everything will be the same as before.

Core concept: Understand the architecture of Herdr with one picture #

Before getting started, first understand the five core concepts of Herdr:

conceptPopular understanding
Session (Session)Herdr’s “background program”, all panes and processes live in it
WorkspaceA project is a workspace, equivalent to a “project folder”
TabDifferent views in the workspace, like browser tabs
PaneThe terminal actually running in the tab page can be split into multiple screens
AgentAn AI coding assistant running in a pane (such as claude, codex)

A session can contain several workspaces for different projects. Each workspace has tabs for different tasks, and each tab can be split into panes running agents or other processes.

The documentation shows a typical scenario: “Three workspaces, four agents, two of which are performing tasks. No one is connected at the moment - this is the key.”

Step 1: Install Herdr #

Installation takes one command. Herdr provides several platform-specific options:

macOS (Homebrew):

brew install herdr

Linux / macOS (official script):

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

Windows (PowerShell):

powershell -ExecutionPolicy Bypass -c "irm https://herdr.dev/install.ps1 | iex"

is completed, run herdr --version to confirm that the installation is successful.

Step 2: Get started quickly—you can do it with the mouse #

Herdr is extremely newbie friendly. The official documentation clearly states: “First time coming into contact with terminal multiplexer? No need to learn shortcut keys to get started. Herdr puts the mouse first: click on the pane, drag the border, split and switch through the right-click menu.”

specific operation method:

  • Click on any pane to switch focus
  • Drag the dividing line between panes to resize.
  • Right-click to pop up the context menu for splitting panes, creating tabs, etc.
  • **Drag and drop to select ** text to be copied automatically,double-click word to copy directly - no need for Ctrl+C at all

Enter your project directory and run herdr directly to start:

cd ~/my-project
herdr

when it is run for the first time. You can complete the basic configuration by following it.

Step 3: Start your first AI agent #

Start the AI programming assistant in the Herdr window, exactly the same as an ordinary terminal:

  1. Click on the pane you want to run
  2. Enter the startup command, such as claude or codex
  3. Herdr will automatically detect it and display the status in the sidebar

Herdr supports out-of-box detection agents including: Claude Code, Codex, Cursor Agent CLI, GitHub Copilot CLI, Devin CLI, Kimi Code CLI, Qoder CLI, OpenCode, Pi, OMP, etc.

Herdr tracks whether there are agents in each pane and summarizes their status into tabs and workspaces. The sidebar will display three statuses:

  • Blocked: The agent is waiting for your input (such as permission confirmation, asking questions)
  • Working (working): The agent is executing the task
  • Done (Complete): The task has been completed and is waiting for your review

This is the core workflow of Herdr:Start multiple agents and let them work in parallel. Use the sidebar to see which projects require decision-making, which ones are still running, and which ones are ready for review.

Step 4: Keyboard shortcuts (prefix key Ctrl+b) #

Although the mouse is easy to use, mastering the shortcut keys is more efficient. Herdr uses a prefix key mode similar to tmux,**defaults to Ctrl+b **.

How to use: Press Ctrl+b first, release it, and then press the function key.

Functionshortcut key
Split pane to the rightCtrl+b then press v
Split pane downwardsCtrl+b Then press -
New tab pageCtrl+b Then press c
next/previous tabCtrl+b Then press n / p
Open workspace navigationCtrl+b then press w
Detach client (Detach)Ctrl+b then press q
Open the help panelCtrl+b then press ?

All shortcut keys can be customized in the configuration file.

Step 5: Session state and recovery—the strongest persistence #

This is the most powerful feature of Herdr. The official documentation details four recovery paths:

1. Normal separation and reconnection (strongest) #

When you press Ctrl+b q or directly close the terminal window, you just **disconnect the client . The Herdr server and all agents ** continue to run . Rerunning herdr instantly returns you to the previous state - The original process never stopped.

2. Snapshot recovery after server restart #

If the Herdr server unexpectedly stops and then restarts, although the original pane process is no longer there, Herdr will restore the saved session form: workspace, tabs, panes, directories, layouts and focus. Each pane will come back as a new shell in the directory where it was saved.

3. Pane screen history playback #

After a full server restart, Herdr can restore recent terminal content if the pane screen history feature is turned on. But this functionOff by default, because the pane output may contain sensitive information such as keys, tokens, and prompt words. Can be turned on in the configuration file.

4. Agent native session recovery (the strongest intelligent experience) #

Some agents can resume their own dialogue sessions. Herdr uses the session reference reported by the official integration, after the server restartsAutomatically restart supported agent panes。

include:

  • Claude Code: claude --resume
  • Codex: codex resume
  • Cursor Agent CLI: cursor-agent --resume
  • Pi: pi --session
  • Kimi Code CLI: kimi --session
  • and OMP, Devin, Droid, Qoder, OpenCode, etc.

Run herdr integration status to view the installed integration version.

5. Real-time handover (experimental) #

When updating Herdr, you can request the old server to transfer the real-time pane to the new server, so that the process can continue to run across server replacements. This is an experimental feature and needs to be actively turned on.

Step 6: Configuration - according to your habits #

Herdr works without a configuration file. You can add one to customize it.

The configuration file location can be viewed via herdr --help. The configuration format is TOML, which can be hot reloaded after modification:

herdr server reload-config

or select “reload config” through the global menu.

Common configuration items #

Set the default shell:

shell = "zsh"

If you omit this setting, Herdr will use $SHELL, /bin/sh, or PowerShell in that order.

Set shell mode:

shell_mode = "auto"  # 或 "login" 或 "non_login"

auto mode will launch a login shell on macOS, allowing settings such as PATH to take effect.

Set the working directory of the new pane:

new_cwd = "follow"  # 或 "home"、"current",或指定固定路径

By default follow will inherit the directory of the source pane or workspace.

Custom key binding:

[keys]
focus_pane_down = "prefix+j"
focus_pane_up = "prefix+k"

key string supports ctrl+a, shift+n, alt+1, cmd+k and other modified key combinations.

Git Worktree support #

Herdr has built-in Git worktree support:

  • New worktree: Create a new checkout, if the branch already exists, checkout, otherwise create a branch
  • Open worktree: List existing Git worktree checkouts in the warehouse
  • still works like a normal workspace and can be focused, renamed, and closed
  • Closing the parent workspace closes the entire group, but does not delete the checkout directory or branch

Step 7: API and Automation #

Herdr provides a powerful CLI and native socket API to control Herdr from scripts, tools and agents.

Most commands output JSON responses, suitable for automation. Commonly used commands include:

# 创建工作区
herdr workspace create --cwd ~/my-project

# 创建标签页
herdr tab create

# 分割窗格
herdr pane split --right

# 关闭工作区
herdr workspace close

The complete CLI reference can be found in the official documentation.

Step 8: Plug-in system - unlimited expansion #

Herdr’s plug-in system is one of its highlights. The official documentation states: “The plug-in is a shareable, executable workflow package. The plug-in can be a Bash script, a JavaScript application, a Lua script, a Rust binary, or any argv command that can be run on your machine.”

The core design concept of the plug-in: Keep Herdr streamlined, with the core focus on the terminal workspace, panes and agents; the plug-in turns this set of extensions into a reusable workflow.

Install plug-in:

herdr plugin install owner/repo

plugin install only accepts GitHub abbreviation, will clone the warehouse, display the preview in the interactive terminal, and run the build command.

Link a local plugin during development:

herdr plugin link ./my-plugin

The plugin declares actions, event hooks, and link handlers via the herdr-plugin.toml manifest. When running, Herdr will inject a series of environment variables: HERDR_SOCKET_PATH, HERDR_BIN_PATH, HERDR_PLUGIN_ID, etc.

Example plugin repository: ogulcancelik/herdr-plugin-examples, including agent-telegram-notify, github-link-preview, dev-layout-bootstrap and other examples.

Final thoughts #

Herdr solves a real and specific pain point:makes the AI programming agent truly “alive” instead of having to restart every time.

Whether you’re developing locally, running tasks on a cloud server, or working remotely via SSH, Herdr keeps your agents running. Its design philosophy is very clear -keeps the core streamlined, lowers the threshold through the mouse and shortcut keys, and provides infinite expansion possibilities through plug-ins and APIs.

If you are using an AI programming assistant and are tired of launching it repeatedly, losing context, and being confused about task status, try Herdr. Install with one command, get started with just a few clicks of the mouse, and then let your agents truly “live”.

This article is based on the official Herdr documentation. For more detailed information, please visit herdr.dev/docs.


Written by Jermine. View original text.