DEV Community

Cover image for Rex vs tmux vs Zellij vs Herdr for Coding Agents
jamilxt
jamilxt

Posted on Originally published at jamilxt.com

Rex vs tmux vs Zellij vs Herdr for Coding Agents

On December 3, 2026, Superlogical opened Rex to everyone. Rex is a free terminal app with a multiplexer (a program that keeps many terminal sessions running and lets you split, detach and reattach them) built in. The Hacker News thread reached 908 points and 303 comments within a day. Many of those comments asked one question: is Rex vs tmux even a real choice, and where do Zellij and Herdr fit?

The question matters because coding agents changed what a terminal pane holds. Often it is an agent that works for ten minutes and then stops to ask for approval. With three of those on two machines, you need to know which one is waiting.

This comparison is built from each project's documentation, release notes and the HN discussion. Rex, Zellij and Herdr were not run for this article. The tmux script further down was tested on tmux 3.4.

What does a terminal for coding agents need to do?

The job comes down to three things:

  1. Keep work alive. An agent should keep running when you close the laptop, lose Wi-Fi or update the app, and you should be able to pick it up from another device.
  2. Tell you who is waiting. The expensive moment is an agent blocked on a question for twenty minutes without you noticing.
  3. Let programs drive it. A script or an orchestrating agent should be able to start a command in a pane, wait for it to finish, and read what it printed. Call this the run, wait, read loop.

tmux has done the first and third jobs for years. The newer tools compete mostly on the second job, on remote access, and on setup effort.

What is Rex?

Rex comes in two parts. The Rex docs describe a server that runs your shells and keeps each terminal's screen and history, and clients that connect to servers and show what is running. The Mac client is a native app built around the libghostty core (the terminal engine from the Ghostty project).

The current lineup, from the launch post:

  • Rex for macOS (macOS 15 or later), which runs its own local server.
  • Rex for iPhone and iPad (iOS 26 or later), to check a job or answer a waiting agent from your phone.
  • Rex Server for Linux, Windows and FreeBSD, for a dev box, build server or homelab.

A Windows client is in alpha. In the HN thread, Superlogical co-founder Mitchell Hashimoto (posting as mitchellh) wrote that about 5,000 users were testing it, that an Android client exists but is internal only, and that a Linux client is still in progress. So Linux and Windows machines can host Rex sessions today, but the full clients are on Mac and iPhone.

Rex is free, needs no account, and the privacy page says it collects no telemetry. The Mac app does check for updates at launch and once a day, sending your IP address and a user agent, and that check cannot be turned off. Rex is not open source: the launch post says you can self-host it, but it offers no source code, a point several HN commenters raised.

Rex vs tmux: what is actually different?

tmux runs a server process too, so the base idea is the same: sessions live on the server, and clients attach to them. The difference is in what sits on each side.

With tmux, you run a terminal emulator (iTerm2, Ghostty, Windows Terminal) and tmux draws its own panes inside it, as text. To work on a remote box, you SSH in and attach. One HN commenter described this as "essentially running a terminal within a terminal".

With Rex, the client is the terminal, and it talks to the server over Superlogical's own protocol. Splits and tabs are native UI, not text drawn by a program inside your terminal. Mitchell Hashimoto went further in his HN reply: "the Rex Server has no concept of a terminal." In Rex's model, a terminal is one kind of "block", and he expects future versions to host other kinds.

That design gives Rex features that are hard to copy with tmux over SSH. One commenter described two: clicking a localhost link that a remote dev server printed opens a tunnel so your local browser loads it, and pasting a screenshot into a remote Claude Code session just works.

Here is what tmux still has going for it:

  • It is everywhere. tmux is ISC-licensed, packaged by the major Linux distributions, and runs inside whatever terminal you SSH from.
  • It is still moving. tmux 3.8 (September 9, 2026) added floating and modal panes, built-in light and dark themes, and an events system: wait-for -E can wait on hooks, and OSC 133 shell markers (escape codes that shells send around each prompt and command) now fire pane-command-started and pane-command-finished events. new-pane -W also waits for the pane's command to exit.
  • Latency on bad links. One Rex user wished Rex connections felt more like mosh (a remote shell that predicts your typing locally) when working across the Atlantic. tmux over mosh is a well-known combination for that case.

What tmux lacks is a built-in idea of "this pane is an agent waiting for you." Hooks and bells can approximate it, but nothing sorts panes into working, waiting and done.

The run, wait, read loop in plain tmux

You do not need a new terminal to let a script drive panes. The script below uses only commands that have been in tmux for years: new-window to run, wait-for to wait, and capture-pane to read. It was tested on tmux 3.4. The fake test command prints a failure line and exits with code 3.

#!/bin/sh
# run / wait / read with plain tmux (tested on tmux 3.4)
S=agentlab
tmux new-session -d -s "$S" -n main

# 1. run: start the command in its own window, save its exit code,
#    then signal a channel named "$S-tests-done"
tmux new-window -d -t "$S" -n tests \
  "sh -c 'echo running tests; sleep 2; echo \"--- FAIL: TestLogin\"; exit 3'; \
   tmux set-option -p -t $S:tests @exit \$?; tmux wait-for -S $S-tests-done; sleep 600"

# 2. wait: block until the window signals, then read the saved exit code
tmux wait-for "$S-tests-done"
echo "tests exited with $(tmux show-options -p -v -t "$S:tests" @exit)"

# 3. read: print the window's screen plus scrollback, keep the failures
tmux capture-pane -p -t "$S:tests" -S - | grep -- '--- FAIL'

tmux kill-session -t "$S"
Enter fullscreen mode Exit fullscreen mode

The output was:

tests exited with 3
--- FAIL: TestLogin
Enter fullscreen mode Exit fullscreen mode

Two details make it work. The exit code is stored in a user option on the pane (@exit), because wait-for only signals and carries no status. The trailing sleep 600 keeps the window open so capture-pane has something to read. It is more ceremony than Rex needs, but it runs on any server you can SSH into.

The same loop in Rex, Zellij and Herdr

The newer tools turn those three steps into first-class commands.

Rex. The shell scripting docs show the loop directly. rex wait exits with the program's own status, and --for sets a timeout:

rex run --label tests --split=below -- make test
rex wait --for 10m tests; echo "make exited with $?"
rex capture -b tests | grep -- '--- FAIL'
Enter fullscreen mode Exit fullscreen mode

rex capture reads the screen and scrollback (about 64 MiB per terminal). Commands that create things return stable IDs with --json, and the CLI docs list fixed exit codes, such as 3 for a missing target and 4 when the server cannot be reached.

Zellij. zellij action new-pane prints the new pane's ID, and dump-screen reads a pane by ID (both from the CLI recipes):

PANE_ID=$(zellij action new-pane --name tests -- make test)
zellij action dump-screen --pane-id "$PANE_ID" --full | grep -- '--- FAIL'

# or run and block until the command exits
zellij run --name tests --block-until-exit -- make test
Enter fullscreen mode Exit fullscreen mode

zellij run also has --block-until-exit-success and --block-until-exit-failure, documented on the run page. The docs describe when these flags unblock. They do not say that the CLI passes on the command's exit code, so do not build logic on $? here without testing it.

Herdr. The socket API docs show herdr pane run w1:p2 "npm test" and herdr pane read w1:p2 --source recent --lines 50. Herdr's wait is about agents, not commands: herdr agent wait w1:p1 --until done waits for the agent's state, and the docs say plainly that "agent waits observe semantic state, not arbitrary command completion."

Zellij 0.46: built-in terminal and attention inbox

Zellij is an MIT-licensed multiplexer written in Rust. Version 0.46.0 (November 11, 2026) added two things that matter for agents.

The first is a built-in desktop terminal (zellij terminal) for Linux, macOS and Windows, with a tray icon that shows your sessions. Zellij still runs inside any other terminal, and its author writes that "absolutely nothing changes" for people who use it that way.

The second is an attention inbox: a list of which pane, in which tab, in which session needs you. The inbox integrations page lists what it watches: program status reports, the terminal bell, desktop notifications, shell prompt markers and exit codes. Version 0.46.1 (November 24) added zellij events, which streams events as JSON for scripts, and a web client lets you reach a session from a browser.

For agent work, Zellij covers much of Rex's feature set while staying open source and running on Linux desktops today.

Herdr: open source and agent-first

Herdr calls itself "the runtime your coding agents live on." It is a Rust multiplexer under the Apache 2.0 license, created in March 2026, with about 54,000 GitHub stars at the time of writing. The README lists the features that overlap with Rex:

  • A background server keeps terminals running when you close the client or lose SSH.
  • Every pane is marked working, blocked or idle.
  • Several machines appear in one window, with one combined agent list.
  • Agents can drive it through a CLI and socket API, and there is a plugin system.

It runs inside whatever terminal you already use, and HN commenters also mentioned a native GUI client and a mobile app. In the thread, Herdr users gave two reasons for staying. One wrote that being open source "is basically a prerequisite for being able to use it at my workplace." Another preferred Herdr's single dashboard for agents spread over three or four machines.

A fifth name came up often: cmux, a macOS terminal built on Ghostty with vertical tabs, a notification panel and a socket API. Its apps and CLI are GPL-3.0-or-later, per its license file. Being macOS only, it competes with the Rex Mac app more than with tmux.

OSC 7501: how agents report that they are waiting

There is one development that crosses tool lines. Superlogical published a Program Status Protocol, an escape sequence called OSC 7501. A program prints it to say it is idle, working, blocked (waiting on you), done or failed, and why. The spec is written to be generic, with no Superlogical-specific parts.

Zellij's inbox reads the same sequence. Its integrations page (last checked November 9, 2026) lists agents that already send it, including Claude Code from 2.1.295, Codex CLI from 0.163.0, OpenCode from 2.1.0, GitHub Copilot CLI and Qwen Code. Gemini CLI, Cursor CLI and Aider do not yet, so Zellij falls back to their desktop notifications or bell.

Your own scripts can report status too. This function is adapted from the Zellij docs (with \033 instead of \e, so it also works in sh, which was checked with od); the message text must be base64-encoded:

status() {
  printf '\033]7501;state=%s:msg=%s\033\\' "$1" "$(printf '%s' "$2" | base64 | tr -d '\n')"
}

status working "Running migrations"
./migrate.sh && status done "Migrations applied" || status error "Migration failed"
Enter fullscreen mode Exit fullscreen mode

Terminals that do not understand the sequence ignore it, so the function is safe to leave in a script that also runs elsewhere. The tmux 3.8 change log does not mention OSC 7501, so do not count on it inside tmux yet.

Rex vs tmux vs Zellij vs Herdr: side by side

License and source

  • Rex: free, closed source, self-hosted servers.
  • tmux: ISC, open source.
  • Zellij: MIT, open source.
  • Herdr: Apache 2.0, open source.

Where the client runs

  • Rex: macOS and iOS today; Windows in alpha; servers on Linux, Windows and FreeBSD.
  • tmux: inside any terminal on Linux, macOS and BSD.
  • Zellij: inside any terminal, as its own desktop terminal on Linux, macOS and Windows, or in a browser.
  • Herdr: inside any terminal, plus native and mobile clients.

Knowing which agent waits on you

  • Rex: OSC 7501 status on tabs and in the session picker.
  • tmux: no built-in agent status; hooks and bells only.
  • Zellij: attention inbox using OSC 7501, bells, notifications and exit codes.
  • Herdr: working, blocked and idle on every pane, combined across machines.

Remote access

  • Rex: SSH (recommended), Unix sockets or Tailscale.
  • tmux: SSH in, then attach; pairs well with mosh.
  • Zellij: SSH, or its web client.
  • Herdr: saved SSH machines in one window.

Which one should you pick?

Pick Rex if you work on a Mac, want to check agents from an iPhone, and are comfortable with closed-source software that sees every keystroke. Read the remote access page first. It says Rex "trusts a caller based only on how they connect today", which is why servers listen only locally by default and SSH is the recommended path. A full authentication system is planned. On Linux, also note that your personal server's socket goes away when you log out, which kills your sessions, unless you run loginctl enable-linger.

Pick Zellij if you want an open-source tool that covers most of the same ground, including Linux desktops, and you like a text interface. The inbox reads the same OSC 7501 signal Rex does.

Pick Herdr if your main job is supervising many agents across several machines and you want an open-source tool you can extend with plugins.

Stay on tmux if your agents run on servers you SSH into from many places, if you need mosh-level resilience on poor links, or if a closed-source tool is not allowed where you work. The script above shows that the run, wait, read loop is already possible.

The trust question deserves its own line. One HN commenter put it plainly: "One does all of his work (including secrets) on the terminal." Rex's privacy page lists every outbound connection, and its team says the business model will not involve selling the client or server. Still, you cannot read the code. For a company laptop, check your security policy before you install it.

FAQ

Is Rex a replacement for tmux?
For session persistence, often yes: sessions live on a Rex server that survives client restarts, and you can attach from other devices. But Rex does not run inside another terminal the way tmux does, its full clients are macOS and iOS today, and it is not open source.

Can tmux show which coding agent needs me?
Not out of the box. tmux 3.8 adds events for shell prompt markers and command start and finish, which you can hook into. It has no built-in idea of a blocked agent, and its change log does not mention OSC 7501.

What is OSC 7501?
A terminal escape sequence, published by Superlogical as the Program Status Protocol, that lets a program report idle, working, blocked, done or failed. Rex and Zellij both read it, and agents such as Claude Code and Codex CLI already send it.

Does Rex work on Linux?
Rex Server runs on Linux (x86-64 with SSE4.2 or ARM64, glibc 2.26 or later, or musl on Alpine 3.21 or later). A native Linux client is planned but not yet released.

Which of these does your agent setup need most: sessions that survive, a clear "waiting on you" list, or a loop your scripts can drive?

Top comments (0)