Rex vs agterm: What a Programmable Terminal Needs for Agents

On 3 December 2026 Superlogical, whose team includes the creator of Ghostty, opened Rex to everyone: no waitlist, no account, and "Rex is free and always will be." Rex is a terminal frontend on top of a multiplexer backend, built on libghostty. The obvious comparison is agterm, a native macOS terminal with "a deliberately small interface and a full control API" that already lets agents draw HTML pages over a session.
Comparing screenshots is the wrong test. An operator who runs coding agents for days needs sessions that outlive the window, a control surface scripts and agents can drive, and output richer than scrollback. Below: Rex and agterm on those three, then a checklist for any terminal.
What Each Tool Is
Rex. Superlogical's vision page says it wants "a durable session around the work itself" that can "be driven by software while remaining visible and controllable by people", and starts with "a terminal multiplexer". Your shells run on a Rex Server, local or remote. Clients run on macOS 15+ and iOS 26+, the server on Linux, FreeBSD and Windows; the Windows app is in alpha and a Linux client is planned. Clients connect "over SSH, Unix sockets or Tailscale."
agterm. An MIT-licensed terminal for Apple Silicon Macs on macOS 14 or later. A Linux host can run agterm-server for remote sessions. Everything goes through agtermctl, which "drives a running agterm over a local unix socket, one command per invocation." It ships an agent skill (Help, then Install Agent Skill) that teaches Claude Code or Codex the command set. Rex ships a built-in agent skill too.
Durable Sessions
Rex keeps state in the server, not the app. Per the session restore docs, a client restart "restores all your sessions as-is with full history. This is because the Rex Server is what stores all that state." A server restart restores "all your sessions, tabs, and panes with their labels", and then each program comes back in one of three ways: the program reports its own restart command through the Program Resume Protocol, a detection rule matches it, or Rex "will restart your shell in the working directory you were in."
agterm offers three restore modes in its docs: fresh shells (the default), re-run commands, and live sessions. Live sessions let you "quit, update or relaunch agterm while shells, servers and agents keep running." They need zsh or fish and a bundled per-pane helper called zmx, which you manage with agtermctl zmx list|screen|prune|kill|reset. Its restore denylist lists programs that never re-run, and agterm writes a commented starter with tmux, screen and zellij.
The failure mode is the same in both. A running agent is a process with an in-memory conversation. If the process dies, Rex's own docs say "Program resumption is a hint, not a guarantee." The pane comes back; the agent's context comes back only if the agent can resume its own session. Test this before you trust it: start an agent, restart the server or helper, and see what you get.
Scriptable Control
Rex's CLI works on labeled blocks, and the commands read like a CI step (the first three are from the launch page):
rex run --label tests --split=below -- make test
rex wait tests; echo $?
rex capture -b tests | grep -- '--- FAIL'
rex send -b codex #39;api/sync is failing. Fix it.\n'
rex events -s api
rex capture prints screen and scrollback as text, HTML or raw VT (--format). One trap: rex send sends text "exactly as given, with no newline added", so either end the string with \n or use --submit. Beyond the CLI, configuration is Lua in a single init.lua. A custom action is "a named Lua function defined in the configuration file with rex.action", rex.bind maps it to a key, rex.on subscribes to events, rex.ui.input and rex.ui.pick add prompts, and rex do runs an action or a Lua script. Search is built in: Find over scrollback, a command palette, and Go to Anything.
agterm's control is a flat command set over the socket:
ws=$(agtermctl workspace new demo)
sid=$(agtermctl session new --workspace "$ws" --cwd "$PWD" --no-select)
agtermctl session split on --axis horizontal --target "$sid"
agtermctl session text --target "$sid" --lines 10
agtermctl msg send "build done" --to "$sid:bottom"
Custom commands live in keymap.conf, for example command "Open in Finder" ctrl+a>o open "$AGT_SESSION_PWD". agtermctl ask puts a question with buttons in front of the user. One trap here too: for an agent, the active session is the user's selected one, so scripts should pass --target "$AGTERM_SESSION_ID", or they will type into whatever pane you happen to be looking at.
Rich Output
agterm has HTML overlays built in. Version 0.33.0 added session overlay open --html FILE and --url URL to show "a generated report, chart or explainer, or a running dev server" in session-wide, floating or per-pane slots. The defaults are cautious: a page runs none of its own JavaScript unless opened with --js, a local file gets no file access unless --cwd DIR grants it, and a browser open started by the page asks first. Version 0.34.0 closed the loop: buttons and forms tagged data-agterm="<command>" send requests with JavaScript off, and --block waits for the page, "exiting 0 when answered and 2 when the page closes unanswered." An agent can render a diff summary with Approve and Reject buttons and block on your answer.
Rex has no built-in HTML rendering in the docs we read. The community fills the gap: rexweb adds "browser panes for Rex", where "each pane is a real WebKit browser." It is not a native overlay. A borderless WebKit window lies over the pane's area and follows the layout through Rex's API and rex events. It installs a Lua module into init.lua, listens on 127.0.0.1 with a token, and offers rexweb open, snapshot, type and eval. Its README is clear: "Superlogical does not maintain or endorse it."
Decision Table
| Need | Rex | agterm |
|---|---|---|
| Sessions outlive the app | Yes, server owns state | Opt-in live sessions via zmx |
| Remote sessions | SSH, Unix sockets, Tailscale | agterm-server on Linux |
| Platforms | macOS, iOS; Windows alpha | Apple Silicon macOS |
| Script surface | rex CLI, Lua config, events, API |
agtermctl over a socket |
| Custom actions | rex.action in Lua |
command lines in keymap.conf |
| HTML output | Community rexweb (WebKit window) | Built in, with --block answers |
| Cost and license | Free, no account needed | MIT-licensed open source |
Pick Rex if your agents run on remote boxes for days and you reach them from a laptop and a phone. Pick agterm if you work on one Mac and want agents to show you pages and wait for a decision.
The Agent Terminal Checklist
Score any terminal against these before you move a week-long agent workflow into it:
- Kill the UI. Quit the app mid-run. The agent keeps running and the scrollback is intact when you reopen.
- Restart the backend. Restart the server or helper. You know which programs resume, which come back as a bare shell, and how the agent recovers its context.
- Address by name. Scripts target panes by label or ID, never by "the focused one."
- Wait for an exit code. A script can block on a command and get its exit status, like
rex wait. - Read the screen as data. Capture scrollback as text for
grep, and the format is stable. - Subscribe, don't poll. An event stream tells you when a session changes state.
- Render, then ask. The agent can show a report and receive a structured answer, not only a y/n in the prompt.
- Untrusted output stays untrusted. HTML the agent wrote runs without JavaScript or file access by default, and a token or socket permission guards the control API.
Item 8 is the one teams skip: an overlay that runs agent-written JavaScript with a control bridge is a new path from model output to your machine.
Where the Terminal Stops
A terminal is where you watch and steer agents. It should not be the only record of what they did. For incident work, Akmatori keeps that record on the server: per the architecture docs, the agent worker streams output to the API server, "which saves the run and posts the root cause in the incident's chat thread." Closing a laptop does not lose an investigation. The checklist covers the agents you run by hand. For notification-first setups, see our cmux guide, and for tmux-style persistent panes, Herdr.
Conclusion
Rex bets on a durable server that every client and script attaches to. agterm bets on a small Mac terminal that agents can drive and draw on. Rex has no native HTML output yet, agterm's live sessions are opt-in, and its app is Mac-only. Run the eight checks, especially the restart and untrusted-output tests, before a three-day agent run depends on them.
If your team wants AI-assisted incident workflows where every run is saved on the server instead of in a terminal pane, Akmatori helps SRE teams investigate alerts, coordinate response, and automate safe infrastructure actions. Powered by Gcore for global infrastructure reliability.
