Get Moshi
multiplexer

Rex

Reach the agents running in your Rex sessions from your phone or browser — session picker, terminal view, live agent status, and Chat View, through moshi-hook.

updated yesterday5 min readpage 11 / 45

Rex is a terminal and multiplexer from Superlogical. A Rex server holds sessions, each with windows, each split into terminal blocks, and keeps them running after the Rex app closes. Moshi supports it as a third agent-ready multiplexer next to tmux and Herdr. See Multiplexers for how it compares.

local

Rex support is experimental. It needs moshi-hook 0.4.38 or newer on the host and Moshi 4.2.0 or newer on iOS. Rex itself is in beta. Its sessions, Moshi's attach behavior and the features listed here may change between releases.

How it fits together

Unlike tmux and Herdr, Rex puts no command-line client on your PATH for Moshi to attach with. moshi-hook does that job instead: it talks to the Rex server running on the same host, lists its sessions for the picker, and streams a block into Moshi's terminal view. Without moshi-hook on the host, Moshi does not see Rex at all.

So the setup is:

  1. Install and run Rex on the host. On a Mac, the Rex app includes its own local server. Rex also offers a server for Linux to beta testers. See Rex's installation docs.
  2. Install moshi-hook on the same host, version 0.4.38 or newer, and pair it with Moshi.
  3. Start your agents in Rex blocks. Their hooks report status and events to Moshi the same way they do under tmux or Herdr.

Native Windows hosts are not supported. Rex and moshi-hook's Rex bridge run only on macOS and Linux.

Open a Rex session

When Moshi connects to a host where a Rex server is running, the session picker shows a Rex tab. It lists each session by name, with its window count. Tap one to attach.

To check what the picker will see, run the same listing by hand:

host
$moshi-hook rex ls --json

If the output shows "running": false, no Rex server answered on this host. If it shows the server running but sessions is empty, there's nothing to attach yet. Open a session in Rex first.

The terminal view shows the session's focused block and follows Rex's focus. When you switch blocks from the Sidebar or in the Rex app, the view repaints on the new block. When the block you're watching closes, the view moves to the next one. While Moshi is showing a block, the block takes Moshi's terminal size. The Rex app gets it back when you leave.

Agent workflow

Start an agent in any Rex block:

inside a rex block
$cd ~/projects/app
$claude

From there, the usual Moshi features work as they do under tmux and Herdr:

  • Agent status — each agent shows as working, blocked or idle in the Sidebar. An agent waiting for its first prompt, or just after /new or Stop, reads as idle.
  • Chat View — prompts, Stop, and /new reach the agent's block. Stop is recorded in the agent's own conversation, and /new switches Chat View to the new conversation.
  • Approvals and questions — Approve, Deny and question answers from the Inbox go to the exact block that asked, after moshi-hook checks that the prompt on screen is still the one you saw.
  • Notifications, Inbox and Live Activity — events show the Rex session's name. On Moshi 4.2.1 and newer, opening a Rex event from the Inbox attaches that session and shows the agent's block.

The Sidebar maps a Rex host as sessions, their windows, and the blocks inside them, with each agent's status. Tap a row to focus it on the host. Rex sessions, windows and blocks can also be renamed, moved and closed from the Sidebar where Rex allows it. Herdr-only extras such as worktrees aren't available for Rex.

Web app

The Moshi web app sidebar lists Rex sessions, windows and blocks next to tmux and Herdr. This needs moshi-hook 0.4.39 or newer.

By default the web terminal follows Rex's focus, the same way the phone does. To pin the view to the block you pick instead, turn on Settings → Terminal → Rex → Single-pane view. Switching blocks then reconnects, and the block takes the size of the browser window while it's shown.

What's not there yet

Rex is newer to Moshi than tmux and Herdr, and some of their extras don't apply to it yet:

  • No Rex shortcut panel tab, and no swipe gestures for windows or blocks. Switch with the Sidebar instead.
  • No session deep links (moshi://) for Rex.
  • No moshi DIR project launcher. It opens tmux sessions only.
  • No native Windows hosts.

Troubleshooting

No Rex tab in the session picker

The picker lists Rex sessions through moshi-hook, so check both:

laptop
$ssh <host> 'command -v moshi-hook; moshi-hook version'
$ssh <host> 'moshi-hook rex ls --json'
  • command -v moshi-hook prints nothing. moshi-hook isn't on the non-interactive SSH PATH. See Debugging the session picker.
  • The version is older than 0.4.38. That version doesn't know about Rex. Update moshi-hook.
  • "running": false — no Rex server is running on this host, or it runs under another user account. Start Rex as the same user that you SSH in as.

moshi-hook doctor also reports whether it can reach a Rex server and which version is running.

The view shows a different block than I expected

The terminal view follows the session's focused block, so focusing a block in the Rex app also moves the view in Moshi. In the web app, turn on Single-pane view to keep the view on one block.