tmux
Use tmux as the durable workspace behind Moshi, including attach patterns, window switching, and agent workflows.
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:
$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:
$tmux new -s moshi
Reattach later from any new SSH or mosh connection:
$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:
$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:
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-hookso 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.