Get Moshi
terminal

tmux

Use tmux as the durable workspace behind Moshi, including attach patterns, window switching, and agent workflows.

updated 2 days ago7 min readpage 6 / 23

tmux is the recommended host-side workspace for Moshi. It keeps shells and agents running on the host even when the mobile terminal disconnects.

Start or attach

After installing moshi-hook, you also get a short moshi command for project sessions:

host
$cd ~/projects/app
$moshi .
$moshi ~/a/b/name

It resolves the directory, names the tmux session from the directory basename, and replaces itself with tmux new-session -A -s <name> -c <dir>. That means no Moshi wrapper process stays running; from the shell's point of view, you started tmux normally.

Start a session the first time:

host
$tmux new -s moshi

Reattach later from any new SSH or mosh connection:

host
$tmux a -t moshi

If you'd rather use tmux directly, the equivalent attach-or-create form is tmux new-session -A -s moshi.

Agent workflow

Inside tmux, start your agent normally:

inside tmux
$cd ~/projects/app
$claude
$codex

tmux keeps the shell, working directory, and agent process alive when Moshi reconnects.

Windows and panes

tmux windows are useful for separating projects, agents, logs, and servers. Panes are useful when you need a compact split, but on phone screens a one-window-per-task layout is usually easier to control.

Common tmux commands:

CtrlBC
Create a new window.
CtrlBN
Next window.
CtrlBP
Previous window.
CtrlB%
Split pane horizontally.
CtrlB"
Split pane vertically.
CtrlBD
Detach from the session.

Mobile-friendly tmux tips

  • Use short session and window names.
  • Keep one agent per window when possible.
  • Increase shell history on the host if you rely on command recall.
  • Use tmux copy mode for large output instead of selecting huge terminal regions on iOS.
  • Pair tmux with moshi-hook so approvals and turn completion reach the Moshi inbox.

When tmux is not needed

You can use Moshi without tmux for short commands, SSH administration, and quick shell checks. For any long-running agent, build, test suite, or server process, tmux is the safer default.