· 6 min read

Coding Agents in My Pocket: Moshi on iOS with Herdr on the Macs

How I keep Claude Code and other coding agents running on my MacBook Pro and Mac mini with Herdr, and monitor and approve them from an iPhone or iPad with Moshi.

I run coding agents on two machines: Claude Code and Codex sessions on my MacBook Pro, and longer-running jobs on a Mac mini that sits headless on my network. The problem with agents is that they do not need you constantly. They need you for thirty seconds, at unpredictable moments, to approve a command or answer a question. Sitting at the desk waiting for those moments is a waste of an afternoon. So I put two tools together: Herdr keeps the agents alive on the Macs, and Moshi puts them on my iPhone.

Herdr keeps the agents running

Herdr is an open source terminal multiplexer built specifically for coding agents. It is a Rust binary (Apache 2.0, past 30k GitHub stars, installable with brew install herdr) that borrows the pane, tab, and session model from tmux and adds one thing tmux never had: it knows what an agent is. Processes running in Herdr panes are identified as agents, and a sidebar shows the state of each one at a glance: working, idle, or blocked waiting on input. With four or five sessions open, that sidebar replaces the pane-by-pane hunt for the one agent that stalled twenty minutes ago.

The architecture matters for my setup. Herdr is not an app you keep open; it is a server running in the background, and the terminals live inside it. Quit the terminal app, detach, lose the SSH connection, and the agents keep going, because they belong to the server, not to whatever window was watching them. The limit is physical: an agent only runs while its machine is awake, so closing the MacBook lid still pauses everything on the MacBook. That is exactly what the Mac mini is for. It never sleeps, so I start a session on it over SSH, detach, and the work continues whether or not anything is connected to it. Better Stack’s guide makes the point I would make too: unlike the wave of AI-first terminal apps, Herdr runs inside the terminal you already use, so your fonts, colors, and shell config all survive. It also has a listing on Terminal Trove if you want the short version.

The whole pitch fits in one screen: workspaces down the left, an agents panel with one agent working and one idle, and full agent TUIs rendering properly in their panes.

Herdr's terminal interface: a workspace sidebar and agents panel on the left showing one agent working and one idle, with a code review session and a Claude Code session running in panes

Moshi is the terminal on the phone

Moshi is an iOS terminal (there is an Android build too) that connects to those machines over SSH or mosh. The mosh support is the reason I picked it: sessions survive the walk from wifi to cellular and back without dropping, which is the whole point of a phone terminal. It renders full-screen TUIs properly, so Claude Code looks like Claude Code, not a scrambled approximation. And it ships a picker that understands multiplexers, Herdr included, so connecting to the mini drops me straight into a list of my running sessions instead of a bare shell. I run it on the iPhone and on the iPad, where a Magic Keyboard makes it a workable thin client.

Moshi's home screen on iPhone: active mosh sessions shown as live thumbnails, with saved SSH connections listed below

The developer describes it as a baby monitor for AI agents, which is accurate. Beyond the terminal itself there is an Agents feed, Live Activities on the lock screen, an Apple Watch app for approvals, an in-app diff viewer for reviewing what an agent just changed, and voice input running on-device Whisper for dictating prompts. Reviews back this up: the app holds 4.7 stars from about 470 ratings on the App Store, and the recurring theme in them is that it was built for this workflow rather than adapted to it.

Moshi on iPad in split view, with the Moshi website in Safari on the left and an htop session over mosh on the right

moshi-hook is the bridge

The terminal alone would already be useful, but the piece that changes the workflow is moshi-hook, a small daemon that runs on each Mac (docs here). It installs hooks into the agents’ own config files (Claude Code’s ~/.claude/settings.json, Codex’s ~/.codex/hooks.json, and so on), listens on a local Unix socket, and holds a WebSocket to Moshi’s gateway. When an agent needs a permission decision, the hook fires, the daemon sends a structured event capped at 256 characters, and my phone gets a push notification. I tap approve or deny, the answer routes back through the WebSocket to the socket to the agent, and the session continues. The same channel carries task-complete events and session starts, which is what feeds the Agents inbox and the lock screen Live Activities.

Here is what the daemon reports on my MacBook, trimmed to the agents I actually have installed:

$ moshi-hook status
status: paired
display name: Amun.local
server: Moshi Pro attached
secret store: keychain
socket: ~/Library/Application Support/Moshi/moshi-hook.sock
multiplexers (daemon):
tmux: /opt/homebrew/bin/tmux
herdr: /opt/homebrew/bin/herdr
hooks:
claude current ~/.claude/settings.json
codex current ~/.codex/hooks.json
cursor current ~/.cursor/hooks.json

Setup on macOS is Homebrew: the tap is rjyo/moshi, then brew services start moshi-hook, then pair with a token from the app’s settings. Two practical notes. Homebrew now requires trusting third-party taps (brew trust --formula rjyo/moshi/moshi-hook), and agent sessions that were already open when the hooks were installed will not pick them up until restarted. The daemon runs paired on both the MacBook and the mini, so approvals reach the phone no matter which machine the agent lives on.

The day-to-day loop

The combination works like this. I kick off work in Herdr workspaces, one per project, on whichever machine makes sense. I leave. When an agent hits a permission wall, the phone buzzes and I answer from the notification. When a task finishes, the Live Activity on the lock screen says so. If I want to actually look at something, I open Moshi, attach to the Herdr session over mosh, scroll the terminal, check the diff viewer, and give the next instruction by voice if I am walking. The agents never stopped; I just stopped being chained to them.

There is also a watchOS companion that surfaces the same approvals on the wrist. I have not set it up yet; it is next on the list, because answering a sudo prompt from a watch face is exactly the right amount of ceremony for a thirty-second interruption.

Moshi on Apple Watch showing a pending approval to write to /etc/hosts and a running task

What it costs

Herdr is free and open source. Moshi is free to try with no account required; the full agent workflow (approvals, voice, diff review, unlimited hosts) is behind Moshi Pro at $7.99 a month, $69.99 a year, or a one-time $199 lifetime license. I paid for Pro. For a tool that turns dead waiting time back into usable time, the yearly price is an easy call. The honest caveat: this whole stack is young. Herdr is at version 0.8 and moving fast, Moshi ships new builds constantly, and some of what I described this week will look different by winter. That is also what makes it fun.

The Herdr screenshot is from the project’s GitHub README; the Moshi screenshots are from the developer’s App Store listing and demo material; the terminal output is from my own machine.