Herdr + Hunk: How to Run and Review Multiple AI Coding Agents in Your Terminal (2026 Guide)

Your coding agents are out of hand. Good.

Claude Code is refactoring something. Codex is halfway through a test run. A third agent has been sitting on an approval prompt for eleven minutes, waiting for a keystroke you didn’t know it wanted. And in a tab you forgot existed, a benchmark has been running since lunch. 🫠

Running multiple AI coding agents in parallel is the fastest way to ship right now, and the fastest way to lose track of everything. This guide shows two open-source terminal tools that fix both halves of the problem: Herdr to run and watch your agents, and Hunk to review what they wrote.

πŸ§ͺ Tested, not just read about

Every command and every screenshot marked real in this guide comes from Herdr 0.9.1 and Hunk 0.22.0 on Linux, tested in September 2026. Both tools ship updates often, so check herdr --version and hunk --version if something looks different.

TL;DR (for the scrollers)

  • πŸ‘ Herdr is a terminal multiplexer that knows whether each agent is working, blocked, done or idle. Agents keep running when you close the terminal, and agents can drive Herdr themselves.
  • 🌳 Git worktrees are built in: one command gives each agent its own branch and folder.
  • πŸ” Hunk is a review-first diff viewer. The agent’s reasoning sits above the code it explains, and your comments flow back to the agent.
  • πŸ”Œ One plugin connects them, so review opens in a keystroke.

⏱️ In a hurry? Jump to the 5-minute setup.

πŸ‘‹ Is this for you?

Yes if you regularly run two or more agents (Claude Code, Codex, Gemini CLI, opencode, Cursor agent…) at once, or you’ve ever lost an agent in a forgotten tab.
Not yet if you run one agent at a time and watch it work. Your current setup is fine. Bookmark this for when that changes.

😡 Why running multiple AI coding agents gets messy

Four terminal tabs with sticky notes: done?, waiting on me?, since lunch, nobody noticed
Four tabs. Zero idea what’s going on.

The problem isn’t too many terminals. It’s state you can’t see.

tmux will happily show you six panes. It has no idea whether the thing in pane 3 is compiling, waiting for your approval, or finished twenty minutes ago. You find out by looking. With one agent that’s fine. With five, looking is the job.

Example: “Before Herdr, I checked my agent tabs about 30 times in a two-hour session. With the sidebar, I switched context 4 times, each time because something was actually red.”

πŸ‘ What is Herdr? A terminal multiplexer built for AI agents

Herdr (GitHub) is a terminal workspace manager for AI coding agents. Think tmux, if tmux knew what an agent was. It’s a single Rust binary, open source under Apache 2.0.

Step 1: How to install Herdr

curl -fsSL https://herdr.dev/install.sh | sh   # or: brew install herdr / mise use -g herdr
herdr

Linux and macOS, with a Windows preview build. The first launch walks you through notifications and optional agent integrations. herdr update keeps it current.

The refreshing bit: Herdr doesn’t replace your terminal. It runs inside Ghostty, Kitty, WezTerm, Alacritty, even inside tmux. No Electron app, no web dashboard.

πŸ’‘ Pro tip: let your agent onboard you

Paste this into the agent you already use:
Help me understand and set up Herdr. Read https://herdr.dev/agent-guide.md first, then walk me through it step by step.

Step 2: Workspaces, tabs and panes

Real Herdr 0.9.1 screenshot: sidebar with three workspaces, a shell pane with git status, a tests pane with pytest passing, and Hunk running in a review pane
Real screenshot: a Herdr workspace with a shell, a passing test run, and Hunk reviewing changes live.

A workspace is a project. It names itself after the git repo. Tabs group panes inside it. Every pane is a real terminal: vim, htop and SSH all work, and you see the agent’s actual screen.

Press ctrl+b, then…What it does
shift+nNew workspace
shift+gNew worktree workspace
cNew tab
n / pNext / previous tab
1–9Jump to tab 1–9
shift+tRename tab
v / -Split pane
zZoom a pane
xClose pane
bToggle sidebar
qDetach (agents keep running)
?Show every keybinding

Prefer the mouse? Click the sidebar, drag borders to resize, right-click for menus.

Step 3: How Herdr detects agent status

Illustration of the Herdr sidebar with workspaces and agents coloured by status, and a blocked codex pane highlighted
Illustration: one glance tells you codex is blocked, so that’s where you go.
DotMeaningWhat you do
πŸ”΄Blocked: needs input or approvalGo now
πŸ”΅Done, and you haven’t looked yetReview soon
🟑WorkingLeave it alone
🟒Idle: done and seenNothing
βšͺPlain shell or unknownNothing

The top of the sidebar rolls each workspace up into its most urgent dot. The bottom lists which agent is responsible. Scan, jump to red, act.

πŸ€“ How does it know? No hooks needed

Herdr finds the process running in each pane, matches it against known agents, and reads the screen for spinners, prompts and approval boxes. Version 0.9.1 recognises over 20 agent CLIs, including Claude Code, Codex, Gemini CLI, Cursor agent, Copilot CLI, opencode, Droid and Amp.
Want more precise states? herdr integration install claude (also codex, opencode and others).

Step 4: Detach and let your agents keep running

Two loops compared: babysitter mode with one agent versus tech-lead mode with five agents
The upgrade isn’t more agents. It’s not having to watch them.
herdr                        # start, or reattach to your session
# ctrl+b then q              # detach: close the terminal, go get coffee
herdr --session experiments  # a separate named session
herdr server stop            # stop everything, on purpose

A background server owns every process, so closing the terminal or the laptop lid kills nothing. Notifications are tab-aware: the tab you’re looking at stays quiet, background tabs can still alert you.

Step 5: Let agents control Herdr

A lead agent runs real herdr commands to start a codex reviewer, prompt it, and wait for a coder agent
A lead agent staffing its own team, with real Herdr 0.9.1 commands.

The same CLI you use is open to your agents. A lead agent can split panes, start other agents, send them prompts and wait for them:

herdr pane split w1:p1 --direction right
herdr agent start reviewer --kind codex --pane w1:p2
herdr agent prompt reviewer "Review src/auth.ts" --wait
herdr agent wait coder --until done
herdr pane wait-output w1:p3 --match "passed"   # wait for text in any pane

Give an agent the full playbook with herdr --skill, which prints Herdr’s built-in agent skill.

You’ve stopped prompting an agent. You’ve started staffing a team.

Share this line: 𝕏 Post it Β· LinkedIn

Step 6: Agents on other machines

Running a long job on a workstation or cloud VM? herdr --remote user@host attaches to a Herdr server over SSH, and herdr machine manages saved machines, so remote agents land in the same sidebar.


🌳 How to run parallel agents safely with git worktrees

Two agents in the same folder will eventually edit the same file. The fix is a git worktree: a second checkout of your repo on its own branch. Herdr builds this in:

herdr worktree create --branch retry-cap   # new branch + folder + workspace
herdr worktree list
herdr worktree remove ...                  # clean up when merged

In our test, that command created a real git worktree under ~/.herdr/worktrees/payments-service/retry-cap, opened it as a workspace, and nested it under its repo in the sidebar (you can see it in the plugin screenshot below). One agent per worktree, zero collisions. From the keyboard it’s ctrl+b then shift+g.

πŸ›‘οΈ A word on approvals

πŸ”΄ usually means an agent wants permission to run something: a migration, a delete, a network call. Read the prompt before approving, especially when agents are starting other agents. Herdr helps here: herdr agent prompt refuses to send to an agent that’s already blocked, so a script can’t accidentally type into someone’s approval prompt.

πŸ” What is Hunk? A diff viewer built for AI-written code

Your agents just touched 37 files. Hunk (GitHub) is a review-first terminal diff viewer made for exactly that moment. MIT licensed, and it works with git, Jujutsu and Sapling.

Step 7: Install Hunk and open your first review

curl -fsSL https://hunk.dev/install.sh | sh   # or: brew install hunk
                                              # or: npm i -g hunkdiff
hunk diff
hunk diff --watch                    # live-reloads while the agent keeps editing
hunk diff --staged                   # only what's staged
hunk show HEAD~1                     # an older commit
hunk log                             # browse history
hunk diff --files before.ts after.ts # two files, directly
git diff --no-color | hunk patch -   # any patch from stdin

πŸ’‘ Pro tip: make it your default pager

git config --global core.pager "hunk pager" and every git diff opens in Hunk.

Step 8: Review the whole changeset in one stream

Normal terminal diffs give you a firehose. Hunk gives you one top-to-bottom stream with a file sidebar.

  • [ and ] jump between hunks
  • Click a file in the sidebar to land on it
  • --mode split, unified or auto to fit your terminal width
  • t opens the theme picker
  • --watch turns review into a live document while the agent is still typing

Step 9: See the agent’s reasoning next to the code

Real Hunk screenshot: a note from claude sits above the auth.ts change, explaining why token validation moved before body parsing
Real screenshot: the agent’s note sits right above the line it explains.

This is my favourite idea in either tool. πŸ’œ An agent in another terminal can pin a note to any line of your live review:

hunk session comment add --repo . --file src/auth.ts --new-line 8 \
  --author claude --summary "Validate the token before parsing the body" \
  --rationale "Unauthenticated requests were being parsed first..." --focus

That’s exactly how the screenshot above was made. Agents can also write notes to a JSON file and you load them with hunk diff --agent-context notes.json. To teach an agent all of this, tell it: Load the Hunk skill. Run hunk skill path to get the skill path.

AI-written code isn’t the deliverable. Your understanding of it is.

Share this line: 𝕏 Post it Β· LinkedIn

Step 10: Comment on a hunk and let the agent fix it

Spot something odd? Press c on the line, type, press ctrl+s.

Real Hunk screenshot: a draft note on retry.py line 8 says the backoff is uncapped and asks to cap it at 30 seconds with jitter
Real screenshot: your comment, drafted right on the line. Ctrl+S saves, Esc cancels.

The agent picks up only your comments, fixes the code, and replies in the same thread:

hunk session comment list --repo . --type user
# ...agent edits src/retry.py...
hunk session comment add --repo . --reply-to <note-id> --author claude \
  --summary "Capped each wait at 30s and added up to 1s of random jitter"
Real Hunk screenshot: line 8 now reads min(2 ** attempt, 30) plus random jitter, with your note and the agent's threaded reply below it
Real screenshot: –watch reloaded the fixed line, and the agent’s reply sits under your note.
Loop: agent writes code, Hunk shows the diff live, you comment, agent fixes, agent explains
Review stops being a one-way inspection and becomes a conversation.

πŸ” Your voice stays yours

Hunk tracks where every note came from. Your notes are stored as yours, agent notes arrive through the session API, and the session CLI has no command to edit your notes. Agents can clear notes when tidying up, but they can’t put words in your mouth.

πŸ”Œ Connect Herdr and Hunk with one plugin

You can run Hunk in any Herdr pane by hand. Or let a plugin do it. We tested cevr/herdr-hunk: one key opens a review, another sends your notes back to the agent that made the changes.

herdr plugin install cevr/herdr-hunk   # needs Bun installed
herdr plugin list

Then add two keys to ~/.config/herdr/config.toml and run herdr server reload-config:

[[keys.command]]
key = "prefix+alt+h"
type = "plugin_action"
command = "cvr.herdr-hunk.open"
description = "open Hunk review"

[[keys.command]]
key = "prefix+alt+s"
type = "plugin_action"
command = "cvr.herdr-hunk.send"
description = "send Hunk notes"

⚠️ Don’t copy the plugin README’s keys blindly

The plugin’s README suggests prefix+h and prefix+s. In Herdr 0.9.1 those already mean focus pane left and settings. The prefix+alt keys above are free, and we confirmed they work.
Real Herdr screenshot: the plugin opened Hunk in a new tab 2, and the retry-cap worktree is nested under payments-service in the sidebar
Real screenshot: ctrl+b, alt+h opened this review tab. Note the retry-cap worktree in the sidebar.

When you send notes, the plugin types them into the agent pane that opened the review, never broadcasts to other agents, and doesn’t press Enter for you, so you read the prompt first.

Other community plugins worth a look: yuucu/herdr-hunk (auto-refreshes the review when an agent finishes) and jhochenbaum/herdr-hunk-diff (opens the right worktree and routes comments back).


🀝 A real workflow, start to finish

Herdr panel with agent status leads to Hunk panel with review stats, then to ship it
Herdr runs the team. Hunk runs the review. You make the call.
  1. herdr, then herdr worktree create --branch retry-cap for the new feature.
  2. Start Claude Code on the feature in that worktree and Codex on tests in another.
  3. Detach with ctrl+b q. Go to your meeting. β˜•
  4. Come back. One dot is πŸ”΄: Codex wants to run a migration. Read it, approve it.
  5. Claude’s dot is πŸ”΅. Press ctrl+b alt+h to open the review.
  6. Read the stream. The agent’s notes explain the tricky bits. Press c on anything suspicious.
  7. Press ctrl+b alt+s to send your notes to Claude. Watch the fix land live.
  8. Happy? Merge the worktree. You were the tech lead, not the typist.

βš–οΈ Herdr vs tmux: do you need both?

Herdrtmux
Built forAI coding agentsAny terminal work
Knows if an agent is blocked or doneYes, per paneNo
Keeps processes running after you detachYesYes
AutomationCLI and socket API designed for agents to useMature command set, built for humans and scripts
Git worktreesBuilt in (herdr worktree)Manual
Pluginsherdr plugin installLarge ecosystem via TPM
MaturityNew and moving fastDecades of stability

Verdict: keep tmux for servers and general work. Use Herdr when agents are the thing you’re juggling. Herdr even runs inside tmux, so you don’t have to choose.

βš–οΈ Hunk vs delta vs difftastic

Hunkdeltadifftastic
Interactive review screenYesNoNo
Whole changeset in one stream with sidebarYesNoNo
Agent notes and comments inlineYesNoNo
Syntax highlightingYesYesYes
Syntax-aware (structural) diffingNoNoYes
Works as your git pagerYesYesYes
Best forReviewing agent changesetsPrettier everyday git diffsUnderstanding tricky refactors

Verdict: delta and difftastic make diffs nicer to read. Hunk makes them something you can review and discuss with an agent.


πŸ“‹ Cheat sheet

I want to…Command
Install Herdrcurl -fsSL https://herdr.dev/install.sh | sh
Start or reattachherdr
Detach, keep agents runningctrl+b then q
New worktree for an agentherdr worktree create --branch NAME
Start an agent in a paneherdr agent start NAME --kind claude --pane ID
Wait for an agentherdr agent wait NAME --until done
Teach an agent Herdrherdr --skill
Switch tabsctrl+b n / p, or ctrl+b 1–9
Install Hunkbrew install hunk or npm i -g hunkdiff
Live reviewhunk diff --watch
Teach an agent Hunkhunk skill path
Agent adds a notehunk session comment add --repo . --file F --new-line N --summary "..."
Agent reads your commentshunk session comment list --repo . --type user
Connect themherdr plugin install cevr/herdr-hunk

πŸ“„ Get this as a one-page PDF

Print it, pin it next to your monitor. Download the Herdr + Hunk cheat sheet (PDF)

⚠️ Before you install

Know these going in

  • Licences: Herdr is Apache 2.0. Hunk is MIT.
  • Platforms: Herdr runs on Linux and macOS, with a Windows preview. Hunk runs on macOS, Linux and Windows.
  • Status detection reads the screen. Unusual agent setups can confuse it. Integrations make it more reliable.
  • They move fast. Commands changed between versions while we wrote this. Check --help if something doesn’t match.

🎯 Key takeaways

  • With many agents, the bottleneck is seeing what they’re doing, not starting them.
  • Herdr turns check every terminal into scan one sidebar.
  • Worktrees plus Herdr stop parallel agents from colliding.
  • Hunk puts the agent’s reasoning next to its code, and turns review into a conversation.
  • One plugin joins the two into a single loop.

❓ FAQ

Do I have to give up tmux to use Herdr?

No. Herdr runs inside your existing terminal, including inside tmux.

Can I run Claude Code and Codex at the same time?

Yes. Run each in its own Herdr pane, ideally in its own worktree. Herdr tracks both and shows which one needs you.

How do I stop two AI agents editing the same file?

Give each agent its own git worktree. In Herdr that’s one command: herdr worktree create –branch NAME.

Does Hunk only work with AI-written code?

No. It’s a full diff viewer for any changes. The agent features are an extra layer.

Are Herdr and Hunk free?

Yes. Both are open source: Herdr under Apache 2.0 and Hunk under MIT.


πŸ” Bonus: agent in one tab, review in the other

My favourite everyday setup is the simplest one. One workspace, two tabs: the agent lives in tab 1, Hunk lives in tab 2, and you flip between them with one shortcut. Each tab gets the full screen, so the diff never has to squeeze next to the chat.

Real Herdr screenshot in two parts: tab 1 named agent runs opencode, detected as idle in the sidebar; tab 2 named review runs hunk diff --watch; keyboard shortcuts for switching tabs sit between them
Real screenshots: the same workspace, tab 1 and tab 2. Shortcuts shown in the middle were tested on Herdr 0.9.1. (opencode is idle here because my test machine had no AI provider connected.)

Set it up in 20 seconds

  1. Start your agent in the first tab. Rename the tab agent with ctrl+b shift+t.
  2. Press ctrl+b c for a new tab and name it review.
  3. In the review tab, run hunk diff --watch.
  4. Flip between them whenever you like. The agent keeps running in the background tab, and the review keeps reloading as it edits.

Prefer scripting it? The same setup from the command line:

herdr tab rename w1:t1 agent
herdr tab create --workspace w1 --label review --focus
# then, inside the new tab:
hunk diff --watch

Keyboard shortcuts for switching tabs

ShortcutWhat it does
ctrl+b then nNext tab
ctrl+b then pPrevious tab
ctrl+b then 1–9Jump straight to tab 1–9
ctrl+b then cNew tab
ctrl+b then shift+tRename the current tab
ctrl+b then shift+xClose the current tab
MouseClick a tab name at the top

⚑ Pro tip: switch tabs with one keystroke

Add this to the [keys] section of ~/.config/herdr/config.toml, then run herdr server reload-config:
switch_tab = "alt+1..9"
Now alt+1 is your agent and alt+2 is your review, no prefix needed. Two things we found while testing: this replaces the default ctrl+b 1–9, and on macOS your terminal must treat Option as Alt (it’s a setting in iTerm2, Ghostty, Kitty and most others).

Why this works so well: while you’re reading the diff, Herdr’s tab-aware notifications still tell you if the agent in the other tab gets blocked or finishes. You never miss a beat, and you never have to split the screen.


🧠 The part that stuck with me

Herdr’s author had never written Rust before starting it. The tool was built almost entirely by AI coding agents, the same ones it exists to herd, with a human supervising the architecture.

That’s the whole thesis, running live: someone directed a team of agents to build the tool for directing teams of agents, in a language they didn’t know.

We got dramatically better models before we got anywhere good to put them. Herdr and Hunk are early work on that missing layer: the runtime, the review screen, the human-in-the-loop plumbing. That layer is where the next interesting year of developer tooling happens.

Share this line: 𝕏 Post it Β· LinkedIn

πŸ”— Try them: herdr.dev and hunk.dev

Running three agents at once with your own duct-tape setup? Tell me about it in the comments. πŸ‘‡

Leave a Comment