# Herdr vs tmux vs Zellij

> Compare Herdr, tmux, and Zellij for persistent terminal sessions, remote work, layouts, plugins, and running multiple coding agents.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2026-08-23 | Topics: [AI](https://flaviocopes.com/tags/ai/) | Canonical: https://flaviocopes.com/herdr-vs-tmux-zellij/

Herdr, tmux, and Zellij can all keep terminal programs running after you detach.

They all provide panes, tabs or windows, and persistent sessions.

But they are designed around different priorities.

tmux is a mature, general-purpose terminal multiplexer.

Zellij is a friendlier terminal workspace with layouts and a rich WebAssembly plugin system.

Herdr is a terminal runtime built around coding agents.

The best choice depends on whether you mainly want durable shells, a polished workspace for yourself, or a way to run and coordinate several agents.

## The short answer

Use **tmux** when you want the smallest, most established tool for persistent terminal sessions and you are happy to configure it.

Use **Zellij** when you want strong defaults, visible shortcut hints, reusable layouts, floating panes, and plugins aimed at a human terminal workspace.

Use **Herdr** when coding agents are the main processes in your terminal and you want agent state, agent-aware waits, direct attach, and an API they can control.

All three keep your existing terminal emulator. None requires you to replace Ghostty, Kitty, iTerm2, Alacritty, Windows Terminal, or another terminal application.

## 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 |
| 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 |

The table does not make one tool universally better.

Agent state is irrelevant if you only run shells and editors. A large ecosystem is less useful if the thing you need is lifecycle-aware agent coordination.

## How the concepts map

The names are slightly different:

| Herdr | tmux | Zellij |
| --- | --- | --- |
| Workspace | Session | Session |
| Tab | Window | Tab |
| Pane | Pane | Pane |
| Attached client | Client | Client |

Herdr also has a separate concept for a recognized coding agent inside a pane.

That extra layer is the important difference.

A pane is a terminal. An agent is a process Herdr can classify as `working`, `blocked`, `done`, `idle`, or `unknown`.

tmux and Zellij see the pane. Herdr also tries to understand the agent running inside it.

## Starting a session

With Herdr:

~~~bash
herdr
~~~

With tmux:

~~~bash
tmux
~~~

With Zellij:

~~~bash
zellij
~~~

Each command starts a session or connects you to its interface.

Named sessions differ:

~~~bash
# Herdr
herdr session attach work

# tmux
tmux new -s work

# Zellij
zellij --session work
~~~

Herdr recommends using workspaces inside the default session first. Named sessions are useful when you need completely separate servers, sockets, panes, and runtime state.

## Detach and reattach

This is the shared foundation.

In Herdr, press `ctrl+b`, then `q`.

Reattach with:

~~~bash
herdr
~~~

In tmux, press `ctrl+b`, then `d`.

Reattach with:

~~~bash
tmux attach
~~~

In Zellij, the default detach action is available from its session mode. Reattach with:

~~~bash
zellij attach
~~~

While the background server remains alive, the original processes remain alive too.

This is not the same as restoring after the server exits.

Herdr restores the workspace shape after a full server restart, but arbitrary shells, servers, and tests restart as new shells. Supported coding agents can resume their own conversations when an official integration reported their session IDs.

Zellij has built-in session resurrection. It serializes the layout and commands, and can optionally save pane viewports and scrollback. Resurrected commands wait for confirmation by default before running again.

tmux is strongest when the tmux server never stops. It does not turn arbitrary processes into a checkpoint that survives a server exit.

## tmux is the durable Unix default

tmux has been around for a long time and is installed on an enormous number of servers.

Its model is small and consistent:

- a server owns sessions
- sessions contain windows
- windows contain panes
- clients attach to sessions

It is extremely scriptable. The command language, formats, hooks, options, and control mode can support very advanced workflows.

The tradeoff is that tmux starts fairly plain.

Many people build a personal configuration for mouse support, pane navigation, status bars, session management, and plugins. This is a strength if you want full control and friction if you want polished defaults immediately.

I would choose tmux when:

- I need a dependable multiplexer on a Unix server
- the machine already has tmux
- I want to share a small configuration across many hosts
- I need mature terminal scripting
- coding agents are just another process in the panes

tmux can run ten coding agents. It simply does not know which one is waiting for approval.

## Zellij is the friendly terminal workspace

Zellij focuses on a good experience without requiring a large configuration first.

The default interface shows available key actions. It has floating and stacked panes, a session manager, reusable layouts, and built-in plugins.

Layouts are written in KDL:

~~~kdl
layout {
  pane
  pane split_direction="vertical" {
    pane
    pane command="npm" {
      args "run" "dev"
    }
  }
}
~~~

Start it with:

~~~bash
zellij --layout project.kdl
~~~

Zellij’s plugins are WebAssembly/WASI programs. They can render interfaces, react to application state, and control the workspace. Zellij itself uses plugins for parts of its UI.

I would choose Zellij when:

- I want good mouse support and visible shortcut help
- I want declarative project layouts
- floating panes and session management matter to me
- I want a rich terminal UI for human use
- I prefer strong defaults over building a tmux configuration

Zellij can also host many agents. Like tmux, it treats them as terminal programs rather than semantic agent processes.

## Herdr is built around agents

Herdr inherits the persistent-terminal model from multiplexers.

The background server owns real pseudo-terminals. The TUI is a client. I can detach every client and the panes keep running.

Then Herdr adds an agent layer.

It can detect supported coding agents and show whether they are working, blocked, done, idle, or unknown. Official integrations can report native agent session IDs for restore.

The CLI can target an agent by name:

~~~bash
herdr agent prompt reviewer \
  "Review the current diff" \
  --wait
~~~

It can wait for an approval:

~~~bash
herdr agent wait reviewer \
  --until blocked \
  --timeout 120000
~~~

It can read recent output:

~~~bash
herdr agent read reviewer \
  --source recent-unwrapped \
  --lines 120
~~~

This is different from sending keystrokes to a pane and sleeping for ten seconds.

Herdr also lets an agent control the workspace through the [Herdr skill](https://flaviocopes.com/herdr-skills/).

I would choose Herdr when:

- I regularly run several coding agents
- I need to see which agent needs attention
- one agent should be able to start or wait for another
- I want to attach directly to one agent
- I work locally, over SSH, and sometimes from a phone
- I want a terminal runtime, not a desktop agent manager

The tradeoff is maturity.

Herdr is much newer than tmux and Zellij. Its plugin marketplace is young, native Windows support has platform-specific caveats, and some advanced surfaces are still evolving.

## Layouts and automation

The three tools solve repeatable setup differently.

With tmux, I usually write a shell script or use a session tool that calls tmux commands.

With Zellij, I describe tabs and panes in a KDL layout.

With Herdr, I can use the CLI directly, let an agent create the layout, or package the workflow as a plugin.

For example:

~~~bash
herdr workspace create \
  --cwd ~/project \
  --label project \
  --no-focus
~~~

Then a script or agent can capture the returned IDs, create tabs and panes, run commands, and wait for results.

Herdr plugins are normal executable workflows with a `herdr-plugin.toml` manifest. Read my [practical guide to Herdr plugins](https://flaviocopes.com/herdr-plugins/) for the complete flow.

## Remote work

All three work well after a normal SSH login:

~~~bash
ssh you@server
herdr
~~~

Replace `herdr` with `tmux` or `zellij` for the other tools.

Herdr also has a thin-client remote mode:

~~~bash
herdr --remote workbox
~~~

The local client connects over SSH to a Herdr server on the remote host. This keeps local keybindings and can bridge local clipboard images to the remote session.

The simple SSH-first path is still the most universal.

If SSH is new to you, my [free SSH course](https://flaviocopes.com/courses/ssh/) explains keys, host configuration, and remote commands.

## Can I nest them?

Yes, but I avoid it unless there is a clear reason.

Nested prefix keys, mouse handling, colors, and resize events can become confusing.

One useful case is connecting to a server that already uses tmux while you use Herdr locally. Decide which layer owns persistence and which layer owns the interface.

If Herdr needs to detect an agent, do not put another multiplexer between the Herdr pane and that agent. Herdr may only see tmux or Zellij as the foreground process.

## Which one would I pick?

For a small server utility, I would still be happy with tmux.

For a human-centered terminal workspace with polished defaults and reusable layouts, Zellij is excellent.

For my current workflow, where several coding agents run at the same time, I would use Herdr.

The reason is not prettier panes.

It is the ability to address an agent by name, wait for its actual lifecycle state, and let agents build and control the same terminal workspace I use.

You can read the primary guides in the [tmux getting started documentation](https://github.com/tmux/tmux/wiki/Getting-Started), the [Zellij user guide](https://zellij.dev/documentation/), and the [Herdr documentation](https://herdr.dev/docs/).
