Herdr vs tmux vs Zellij
By Flavio
Updated
Tagged: AI
Compare Herdr, tmux, and Zellij for persistent terminal sessions, remote work, layouts, plugins, and running multiple coding agents.
Herdr, tmux, and Zellij all do the same core job: they give you panes, tabs or windows, and persistent sessions that keep running after you detach.
If you’re looking at a native Mac terminal with a built-in browser instead, check Herdr vs cmux. Here we’re comparing multiplexers that run inside whatever terminal you already use.
Where they differ is what they optimize for. tmux is the classic, general-purpose terminal multiplexer. Zellij aims for a friendly workspace with declarative layouts and a WebAssembly plugin system. Herdr is built around coding agents.
The short answer
Use tmux if you want the smallest, most established tool for persistent terminal sessions and you don’t mind writing your own config.
Use Zellij if you want strong defaults out of the box, visible shortcut hints, reusable layouts, floating panes, and plugins built for a human workspace.
Use Herdr if coding agents are the main things running in your terminal and you want agent status, agent-aware waits, direct attach, and an API those agents can drive themselves. Since Herdr 0.9, it can also show several SSH machines in one TUI.
None of these replaces your terminal emulator. You keep using Ghostty, Kitty, iTerm2, Alacritty, Windows Terminal, or whatever else you prefer.
Practical comparison
| Capability | Herdr | tmux | Zellij |
|---|---|---|---|
| Persistent live terminals | Yes | Yes | Yes |
| Main organization | Workspaces, tabs, panes | Sessions, windows, panes | Sessions, tabs, panes |
| Default prefix | ctrl+b | ctrl+b | Mode-based shortcuts |
| Mouse-first use | Yes | Available, usually configured | Yes |
| On-screen shortcut guidance | Help and workspace UI | Minimal by default | Strong default status bar |
| Agent lifecycle state | Built in | No | No |
| Agent-aware waits and prompts | Built in | No | No |
| General terminal scripting | CLI and socket API | Extensive command language | CLI actions |
| Declarative layouts | Workspace and plugin workflows | Scripts and config | KDL layouts |
| Plugin model | Local executable workflows | Config, scripts, hooks, external tools | WebAssembly/WASI plugins |
| Normal SSH workflow | Yes | Yes | Yes |
| Thin client over SSH | herdr --remote | Attach after SSH | Attach after SSH |
| Multi-machine client | herdr machine add (Herdr 0.9) | No | No |
| Direct attach to one agent | Yes | No | No |
| Session shape after server exit | Restored; agent resume when supported | Not a live-process checkpoint | Built-in session resurrection |
| Project maturity | New | Very mature | Established |
Agent state doesn’t matter if you only run shells and editors. On the other hand, if you’re juggling several coding agents and need to track when they finish or get stuck waiting for input, a huge plugin ecosystem matters less than having that built in.
How the concepts map
Each tool uses slightly different names for the same pieces:
| Herdr | tmux | Zellij |
|---|---|---|
| Workspace | Session | Session |
| Tab | Window | Tab |
| Pane | Pane | Pane |
| Attached client | Client | Client |
On top of that, Herdr tracks recognized coding agents inside panes as their own thing. A pane is just a terminal, while an agent is a process Herdr can classify as working, blocked, done, idle, or unknown. Where tmux and Zellij only see the pane, Herdr also tracks what the agent inside it is doing.
Starting a session
To start Herdr:
herdr
To start tmux:
tmux
To start Zellij:
zellij
Each command starts a new session or drops you into its interface. If you want named sessions instead, the flags look slightly different:
# Herdr
herdr session attach work
# tmux
tmux new -s work
# Zellij
zellij --session work
With Herdr, you’re usually better off using workspaces inside the default session first. Save named sessions for cases where you want completely separate servers, sockets, panes, and runtime state.
Detach and reattach
In Herdr, press ctrl+b and then q to detach. You can reattach with:
herdr
In tmux, press ctrl+b and then d, and reattach with:
tmux attach
In Zellij, detach from its session mode, then reattach with:
zellij attach
As long as the background server stays running, all of your processes keep running too. That’s a different thing from restoring your setup after the server itself exits, and the three tools handle restarts differently.
Herdr restores the workspace layout after a full server restart, though plain shells, dev servers, and test runs come back as fresh shells. Supported coding agents can pick up their previous conversations when an official integration recorded their session IDs.
Zellij ships with built-in session resurrection. It saves your layout and commands (and optionally pane viewports and scrollback), and resurrected commands wait for your confirmation before running again.
tmux works best when the server stays up. It doesn’t checkpoint arbitrary running processes across a server exit.
tmux is the durable Unix default
tmux has been around for a long time and is already installed on a huge number of servers. Its mental model is small and consistent:
- a server owns sessions
- sessions contain windows
- windows contain panes
- clients attach to sessions
It’s also deeply scriptable. Between its command language, formats, hooks, options, and control mode, you can automate almost anything.
The tradeoff is that tmux feels bare out of the box. Most people end up maintaining their own config file for mouse support, pane navigation, status bars, session management, and plugins. That’s great if you want full control, and a bit of friction if you just want something comfortable right away.
Pick tmux when:
- you need a dependable multiplexer on a Unix server
- the machine already has tmux installed
- you want to carry a tiny config across lots of hosts
- you rely on mature terminal scripting
- coding agents are just ordinary processes in your panes
tmux can happily run ten coding agents at once, but it has no idea which one is stuck waiting for your approval.
Zellij is the friendly terminal workspace
Zellij gives you a comfortable setup without asking you to write a big config file first. Out of the box, the UI shows available keybindings on screen, and you get floating and stacked panes, a session manager, reusable layouts, and built-in plugins.
You write layouts in KDL:
layout {
pane
pane split_direction="vertical" {
pane
pane command="npm" {
args "run" "dev"
}
}
}
Then launch that layout with:
zellij --layout project.kdl
Zellij’s plugins are WebAssembly/WASI programs that can draw UI, react to state changes, and control the workspace. Zellij even uses plugins for parts of its own interface.
Choose Zellij when:
- you want good mouse support and on-screen shortcut hints
- you like declarative project layouts
- floating panes and a built-in session manager matter to you
- you want a richer terminal UI for everyday human work
- you’d rather have strong defaults than maintain a tmux config
Zellij can host plenty of coding agents too, though like tmux it treats them as regular terminal programs and doesn’t know what they’re doing inside.
Herdr is built around agents
Under the hood, Herdr uses the same persistent-terminal architecture as a regular multiplexer. The background server owns real pseudo-terminals, the TUI is a client, and you can detach every client while the panes keep running.
Where Herdr goes further is its agent layer. It detects supported coding agents and tracks whether each one is working, blocked, done, idle, or unknown, and official integrations can report native session IDs so conversations can resume after a restart.
From the CLI, you can target a specific agent by name:
herdr agent prompt reviewer \
"Review the current diff" \
--wait
You can also wait until an agent needs approval:
herdr agent wait reviewer \
--until blocked \
--timeout 120000
Or pull its recent output:
herdr agent read reviewer \
--source recent-unwrapped \
--lines 120
That wait command checks real agent state instead of sending keystrokes and sleeping for ten seconds. An agent can also drive the workspace itself using the Herdr skill.
Go with Herdr when:
- you regularly run several coding agents at the same time
- you need to see at a glance which agent needs your attention
- you want one agent to be able to start or wait on another
- you want to attach straight to a single agent
- you work locally, over SSH, and sometimes from a phone
- you want a terminal runtime rather than a desktop app for managing agents
Keep in mind that Herdr is much newer than tmux and Zellij. Its plugin marketplace is still small, native Windows support has some quirks, and a few of the more advanced features are still changing.
Layouts and automation
Each tool handles repeatable setups differently. With tmux, I usually write a shell script or reach for a session tool that wraps tmux commands. With Zellij, you describe tabs and panes in a KDL layout file. With Herdr, you can call the CLI directly, let an agent spin up the layout, or package the workflow as a plugin.
For example, with the Herdr CLI:
herdr workspace create \
--cwd ~/project \
--label project \
--no-focus
From there, a script or an agent can grab the returned IDs, open tabs and panes, run commands, and wait for results. Herdr plugins are regular executable workflows paired with a herdr-plugin.toml manifest. Check out my practical guide to Herdr plugins for the full walkthrough.
Remote work
All three work well over a normal SSH login:
ssh you@server
herdr
Swap herdr for tmux or zellij to do the same with the other two.
Herdr also includes a thin-client remote mode:
herdr --remote workbox
Your local client connects over SSH to a Herdr server on the remote host, which keeps your local keybindings and can bridge local clipboard images into the remote session.
Herdr 0.9 (September 2026) went a step further by letting you save multiple SSH machines and switch between them from one TUI. You add a machine once:
herdr machine add workbox
After that, opening Herdr locally shows Local plus every saved machine and its workspaces in the sidebar. Each machine runs its own Herdr server, sessions, and processes, so dropping the connection to one machine doesn’t affect the others. tmux and Zellij don’t have an equivalent: you SSH into each server and attach there, or nest one multiplexer inside another.
The plain SSH-first workflow is still the most universal option. --remote fits a single host, and machine add pays off when you bounce between a few machines during the day.
If SSH is new to you, my free SSH course covers keys, host configuration, and remote commands. For a longer Herdr walkthrough, see my deep dive into Herdr.
Can I nest them?
Yes, though I avoid it unless there’s a clear reason. Nested prefix keys, mouse handling, colors, and resize events get messy fast.
One reasonable exception is connecting to a remote server that already runs tmux while you use Herdr locally. Just be clear about which layer owns persistence and which one owns the interface.
If you want Herdr to detect an agent, don’t put another multiplexer between the Herdr pane and that agent. Otherwise Herdr may only see tmux or Zellij as the foreground process.
Which one would I pick?
For a lightweight tool on a remote server, tmux is still hard to beat. Zellij is a great choice when you want polished defaults and reusable layouts without tweaking a config file.
For my current workflow, with several coding agents running at once, Herdr is the one that fits best. Being able to address an agent by name, wait on its real state, and let agents build and control the same terminal workspace makes a noticeable difference.
If you want to go straight to the docs, check the tmux getting started documentation, the Zellij user guide, and the Herdr documentation. For tools beyond these three, see Herdr alternatives.
Want me to talk about your product? You can sponsor this site.
Related posts about ai: