# Rex vs Herdr: comparing two terminal servers for coding agents

> Compare Rex and Herdr for running coding agents: client-server architecture, desktop and mobile apps, OSC 7501 status, session resume, CLI automation, customization, and remote servers.

Author: [Flavio Copes](https://flaviocopes.com/about/) | Published: 2026-12-03 | Topics: [AI](https://flaviocopes.com/tags/ai/) | Canonical: https://flaviocopes.com/rex-vs-herdr/

On the surface, [Rex](https://flaviocopes.com/rex/) and [Herdr](https://flaviocopes.com/herdr/) look like the same tool.

Both run a background server so your shells and coding agents survive when you close the window or drop a network connection. Both have native desktop and mobile apps, both ship a scriptable CLI for agents, and both even read agent status through the same `OSC 7501` terminal protocol.

I have both installed on my MacBook Pro (`Rex.app` `1.0.0` with `rex` `1.0.1`, alongside `Herdr.app` `0.1.15`, `herdr-core` `0.1.20`, and the `herdr` terminal app).

Once you use them for real work, you notice they are solving the same daily problem from two very different directions.

Rex is a general-purpose terminal and multiplexer from Superlogical (Mitchell Hashimoto's company) that happens to work great with coding agents.

Herdr is an open-source, agent-first workspace manager built around herding multiple coding agents across machines, with an interface your agent can rewrite on the fly.

## The quick comparison

Here is how Rex and Herdr compare across the pieces that matter when you run coding agents every day:

| Dimension | Rex | Herdr |
| --- | --- | --- |
| Core focus | General-purpose "multiplexer for all work" (sessions, windows, blocks) | Agent-first workspace manager, attention inbox, and agent orchestration |
| Interface and rendering | Native macOS app built on `libghostty` (replaces your terminal) | Decoupled stack: native desktop app (`Herdr.app`), terminal UI (`herdr`) inside any emulator, or headless `hc` CLI |
| Desktop apps | macOS available now; Windows in alpha; Linux in development | macOS (Apple Silicon), Linux (x86-64 and ARM64), and Windows (x64) available now |
| Remote server platforms | macOS, Linux, FreeBSD, Windows (Personal, Shared, and Login modes) | macOS, Linux, Windows (`herdr-core` or `herdr` server) |
| Mobile apps | iOS and iPadOS | iOS, iPadOS, and Android |
| Agent status | `OSC 7501` (`idle`, `working`, `blocked`, `done`, `error`) | `OSC 7501` in `herdr-core` (pane inspection in the `herdr` TUI) |
| Reboot and cold restart | `OSC 7577` signed resume with 8 built-in agent rules | `herdr-core` brings kept panes back as fresh shells; the `herdr` TUI can resume supported agents |
| CLI and API | `rex` CLI (`--json`), self-documenting RPC API, `/llms.txt` | `hc` CLI (auto-JSON when piped) + OpenRPC schema (`hc schema`), separate `herdr` TUI CLI |
| Customization | Lua 5.1 (`~/.config/rex/init.lua`), `rex do` scripts, native Command Palette pickers | Plain-text config, layouts, and JS mods in `~/.config/herdr-app/` edited by your agent |
| Remote transport | SSH, built-in Tailscale (`tsnet`), Tailscale Serve, built-in `rex cp` and `rex forward` | SSH or custom command (`hc machine --via ...`), plus `hc exec` and `hc file` |
| License and pricing | Free forever, no account, closed source (MIT `libghostty`) | Open source (Apache 2.0), free, no account |
| Telemetry | Zero usage telemetry | `Herdr.app` release builds send telemetry by default (toggle in Settings); TUI sends none |

If you are only comparing tools that live inside an existing terminal emulator, I already covered that in [Herdr vs tmux vs Zellij](https://flaviocopes.com/herdr-vs-tmux-zellij/).

And if you are looking at a Mac terminal with an embedded browser, see [Herdr vs cmux](https://flaviocopes.com/herdr-vs-cmux/).

## Architecture: one vertical stack vs a split runtime

Both tools keep your processes in a background daemon rather than inside the GUI window, so closing the app never kills a running build or coding agent.

The difference is in how the layers fit together.

```mermaid
flowchart TD
  accTitle: Rex architecture compared to Herdr
  accDescr: Rex connects its Mac app, iOS app, and CLI to one Rex Server that owns terminal, file, and tunnel blocks. Herdr splits between herdr-core for the desktop app, mobile app, and hc CLI, and a separate server for the herdr terminal app.
  subgraph Rex
    RMac["Rex macOS app (libghostty)"] --> RServ["Rex Server"]
    RIOS["Rex iOS app"] --> RServ
    RCLI["rex CLI and Lua"] --> RServ
    RServ --> RTerm["Terminal blocks"]
    RServ --> RFS["File and tunnel blocks"]
  end
  subgraph Herdr
    HApp["Herdr desktop app"] --> HCore["herdr-core"]
    HMob["Herdr iOS and Android app"] --> HCore
    HCLI["hc CLI and scripts"] --> HCore
    HCore --> HTerms["Managed agent terminals"]
    HTUI["herdr TUI (inside any terminal)"] --> HTServ["herdr TUI server"]
    HTServ --> HTPanes["TUI workspaces and panes"]
  end
```

In Rex, everything talks to one **Rex Server**. Your Mac app, your iPhone app, and the `rex` CLI all see the same sessions, windows (tabs), and blocks (panes).

Because Rex replaces your terminal emulator using `libghostty`, there's no outer terminal layer fighting with an inner multiplexer over scrollback, mouse selection, keybindings and so on.

![Rex workspace with three split panes and live status indicators in the tab bar](https://images.flaviocopes.com/rex/workspace-splits.webp?v=e3e64aa8)

Herdr has a more modular architecture, and right now it has a split that you should know about before you dive in.

Herdr started as a Rust terminal UI (`herdr`) that runs inside Ghostty, iTerm2, Kitty or over plain SSH. Later Herdr added `herdr-core` (driven by the `hc` CLI), a native desktop app (`Herdr.app`) and mobile apps for iOS and Android.

Those two worlds do not share one server yet. Terminals you start inside `Herdr.app` or with `hc` live in `herdr-core` and appear on your phone. Terminals you start in the `herdr` terminal app live on that app's own server, and are separate.

![Herdr terminal workspaces showing project spaces, tabs, and split agent panes](https://images.flaviocopes.com/herdr/workspaces.webp?v=06003316)

That flexibility is also Herdr's biggest strength. Because `herdr-core` exposes an OpenRPC schema (`hc schema`) and draws no UI of its own, you can drive it from `Herdr.app`, from the `hc` command line, from your phone, or from third-party clients built on top of the same daemon.

## Running a task from the CLI: `rex` vs `hc`

You can feel the difference between the two tools in 10 seconds, by running the same small task through each CLI.

Let's start with Rex (`1.0.1`).

We create a session, run a command in a labeled block with `--keep-open --wait`, capture its output, and kill the session:

```bash
rex version
rex new compare-demo --json
rex run -s compare-demo --label check --keep-open --wait -- echo 'hello from rex'
rex capture -s compare-demo -b check --trim
rex kill compare-demo
```

Here is the real output from running those commands on my MacBook Pro:

![Running rex version, creating a session, running a wait block, capturing output, and killing the session](https://images.flaviocopes.com/rex-vs-herdr/rex-cli-run.webp?v=c8e1ccb8)

Notice 2 details right away. First, Rex models everything as a tree of immutable UUIDv7 resources (`session:...`, `window:...`, `block:...`) with optional human labels.

Second, `rex run --wait` closes the block as soon as the command exits, unless you pass `--keep-open`. Once the block stays open, `rex capture -s compare-demo -b check --trim` reads back the screen (`hello from rex`).

Rex considers terminals as just one kind of block.

Running `rex api call block_creator.list` on my machine, I see all 4 built-in block creators:

```text
com.superlogical.fs          Files
com.superlogical.onboarding  Onboarding
com.superlogical.terminal    Terminal
com.superlogical.tunnel      Tunnel
```

Because of those built-in blocks, Rex gives you file transfers (`rex cp`), TCP and Unix socket port forwarding (`rex forward`), and `rex open` to open remote `localhost` links in your local browser.

Now let's run the same task through `herdr-core` using `hc` (`0.1.20`):

```bash
hc --version
hc run --bg --name check sh -c "echo 'hello from herdr-core'"
hc wait check
hc read check
hc get check
hc rm check
```

Here is what `hc` printed when I ran it in the same scratch folder:

![Running hc version, starting a named background terminal, waiting on it, reading output, inspecting metadata, and removing it](https://images.flaviocopes.com/rex-vs-herdr/herdr-core-cli-run.webp?v=5dcd327a)

See how different the mental model is.

There is no session or window hierarchy to set up first. `hc run --bg --name check` creates a flat named terminal (`t5`), keeps the finished terminal around after it exits so `hc read check` can pull its screen text, and waits for you to clean it up with `hc rm check`.

When stdout is not an interactive terminal (e.g. in a script or an agent tool call), `hc` switches automatically to JSON output.

Look closely at the fields `hc wait` and `hc get` return:

- `"turn": 0` tracks agent turns directly inside the runtime
- `"parent": null` and `"children": []` model parent-child agent trees (`hc wait --children` lets a coordinator wait for helper agents, and children stop when the parent exits unless you pass `--outlive-parent`)
- `"die_with_parent": false` and `"notify": true` bake supervision right into the terminal object

`hc` also ships 2 commands that skip terminals completely: `hc exec` runs a command locally or on a remote machine, and returns raw stdout and its exit code. `hc file read`, `write` and `edit` let an agent inspect or patch files on remote machines through the same CLI.

If you want a solid foundation in shells, pipes, exit codes and scripting before wiring agents into either CLI, check out the free [CLI Handbook](https://flaviocopes.com/ebooks/cli-commands-handbook/).

If you are setting up skills for Claude Code or Codex to call `rex` or `hc`, the [Agent Skills Handbook](https://flaviocopes.com/ebooks/agent-skills-handbook/) explains how those skill files work.

## Agent status and what survives a reboot

Here is a pleasant surprise: both Rex and `herdr-core` converged on the same open escape-sequence protocol, **OSC 7501**, to report the live program status (`idle`, `working`, `blocked`, `done`, `error`).

Instead of guessing from the screen text using regexes, a coding agent (or its hook) writes an OSC 7501 sequence to the terminal, and both tools turn that into structured status indicators and notifications. (Herdr's older terminal app still inspects the pane on its own server to detect the agent state.)

Where the two tools part ways is what happens when the background server itself restarts, or when your laptop reboots.

Rex pairs OSC 7501 with a second open protocol, **OSC 7577** (the Program Resume Protocol). Each terminal gets a per-PTY secret token (`OSC7577_TOKEN`) so a running program can register a cryptographically signed resume command, and Rex still cross-checks that command against trust rules and flag filters before running anything on restart.

Running `rex config check` on Rex `1.0.1` shows 8 built-in agent resume rules ready out of the box:

![Output of rex config check showing the 8 built-in OSC 7577 resume rules for Claude, Codex, Copilot, Crush, Gemini, OpenCode, Pi, and Vibe](https://images.flaviocopes.com/rex-vs-herdr/rex-resume-rules.webp?v=7df88ead)

You can tighten any of those rules in `~/.config/rex/init.lua`, for example restricting auto-resume to `~/code` or dropping `--dangerously-skip-permissions` when Claude Code resumes.

`herdr-core` handles live updates cleanly (`hc update` upgrades the daemon without interrupting running terminals), and closing or crashing `Herdr.app` leaves everything running.

After a full machine reboot or a core crash, though, kept panes in `herdr-core` come back as fresh shells in their previous directories, so you restart the coding agents yourself. (Herdr's separate terminal app can still run a resume command for supported agents on a cold restart.)

## Customization: Lua scripting vs "shape by asking"

Both apps give you deep customization, and they pick completely different ways to do it.

Rex takes the Neovim and WezTerm path: a single optional **Lua 5.1** config file at `~/.config/rex/init.lua`, which you can validate with `rex config check` and apply live with `rex config reload`.

You can define tmux-style key chords, exclusive modes (like a pane resize mode), trust rules, and custom actions that pop up native pickers (`rex.ui.pick`) or text prompts (`rex.ui.input`) inside the Command Palette. Those prompts broadcast to every connected Rex client, including your iPhone, and dismiss everywhere as soon as one device answers. You can also run standalone event-driven scripts against a live server with `rex do ./watch.lua`.

`Herdr.app` takes a very different bet that Herdr calls **"shape by asking"**.

Every piece of the desktop interface lives as editable files inside `~/.config/herdr-app/`:

```text
~/.config/herdr-app/
├── AGENTS.md
├── gpui-kit.d.ts
├── herdr.d.ts
├── settings.json
├── keys.json
├── layouts/
├── mods/
└── themes/
```

That `AGENTS.md` file (over 60 KB in my local install) together with the TypeScript definitions tells your coding agent how to edit layouts, keybindings, themes, and custom mods.

Instead of writing Lua yourself, you ask Claude Code or Codex to add a live checklist panel beside your terminal, or install a community layout like Board (agents as Kanban cards) or Chat (spaces as channels), and the desktop app reloads the UI directly.

If you like writing clean, deterministic config files you can version-control and reason about, Rex's Lua setup feels right at home.

If you like letting your coding agent build custom UI widgets around your workflow, Herdr's desktop app goes way further than a traditional terminal ever could.

## Remote machines and mobile apps

Both tools work on your laptop, remote servers, and your phone, and each has a clear advantage in one spot.

Rex is amazing on **remote infrastructure**. You can install Rex Server on Linux, FreeBSD and Windows, and Linux and FreeBSD have 3 server modes: Personal, Shared, and a PAM-backed Login Server for multi-user hosts.

Even better, Rex embeds a `tsnet` Tailscale node in the Mac app and server, and I paired my iPhone to my MacBook Pro with a single QR code scan, with no separate VPN daemon running. Add `rex cp`, `rex forward`, `rex open`, and remote Linux hosts feel almost local. (If you want to know more about the networking behind this, read my [Tailscale tutorial](https://flaviocopes.com/tailscale/), [SSH for developers](https://flaviocopes.com/ssh-for-developers/) or the free [Linux Server Handbook](https://flaviocopes.com/ebooks/linux-server-handbook/).)

Herdr is amazing on **platform reach and the mobile inbox**.

Herdr connects machines over plain SSH or any custom command (`hc machine add prod --via 'fly ssh console -a my-app --pty=false -C'`), and its desktop app is already available on macOS, Linux and Windows today (while Rex's Windows app is still in alpha, and the Linux desktop app is still in the works).

On mobile, Herdr supports **iOS and Android**, while Rex is currently iOS and iPadOS only.

Herdr's mobile app is centered around an Inbox, sorted by what needs your attention, with swipe gestures and on-device voice dictation.

Rex's iOS app is a full desktop tab and split-pane experience, with Compose Input, a customizable Key Bar, and a Virtual Arrow Joystick.

## Open source, privacy, and telemetry

This part is easy, and it might be a deciding factor on its own.

**Rex** is free, and Superlogical says it will always be free. You don't need an account, and there's no usage telemetry. The core terminal engine (`libghostty`) is MIT licensed, while Rex is closed source.

**Herdr** is completely open source, under Apache 2.0, and is split into 3 repositories (`herdr-app`, `herdr-core`, `herdr`). You don't need an account, and there's no relay server in between. Release builds of `Herdr.app` do send usage telemetry by default (you can turn it off under Settings, then Privacy), while the terminal app does not send any.

## How I would choose between them

Both are good enough that the choice is really up to what you want your terminal layer to be.

Go with **Rex** if:

- you live on macOS and iOS and want a polished, `libghostty`-powered native terminal that replaces both [Ghostty](https://flaviocopes.com/ghostty/) and [tmux](https://flaviocopes.com/tmux/)
- you want signed session resume (`OSC 7577`) across reboots with strict flag filtering for [Claude Code](https://flaviocopes.com/claude-code-guide/) and [Codex](https://flaviocopes.com/codex/)
- you manage remote Linux or FreeBSD boxes and want built-in Tailscale pairing, port forwarding, and file transfers in one tool
- you prefer Lua configuration and zero telemetry

Go with **Herdr** if:

- you want an Apache 2.0 open-source stack you can inspect and fork
- you need a native desktop app on Linux or Windows today, or an **Android** mobile client
- you want to keep your existing terminal emulator and run a multiplexer inside it (via the `herdr` TUI or `hc`)
- you want an agent-first runtime with parent-child supervision, an attention inbox, and a desktop UI your coding agents can reshape on demand

Right now on my own Mac, I reach for Rex when I want a fast native terminal with remote shells and iPhone access over Tailscale, and I keep `herdr-core` around when I want lightweight CLI orchestration across agents.

Neither tool replaces everything. When I want inline Git diff reviews, PR review guides, or an embedded browser preview beside my agents, I still use [T3 Code](https://flaviocopes.com/t3-code/). And when I just need one quick local shell window with nothing running in the background, plain [Ghostty](https://flaviocopes.com/ghostty/) stays simpler than both.
