Get Moshi
diff

Diff viewer

Review what your agent just changed, right from the iOS app. Served by moshi-hook, diff contents stay on the host.

updated 1 week ago25 min readpage 24 / 32

The diff viewer is the fastest way to see what a coding agent did to your repository without leaving the terminal session. It's an embedded git diff served by moshi-hook on the host, rendered in the Moshi app over an authenticated local connection.

What it is

moshi-hook ships a small web app that renders the current state of a git repository — staged, unstaged, and untracked changes — as a side-by-side diff. The Moshi app surfaces it as a button in the terminal title and opens it inline; nothing is uploaded, and nothing is published. Diff data is read directly from the working tree on the host you are connected to.

You can also start the same viewer from the shell without the app, which is handy when you want to keep reviewing on a desktop browser.

Requirements

  • moshi-hook installed and running on the host. See Hooks for setup.
  • A git repository as the agent's working directory. The diff viewer detects the active cwd from the running session.
  • A Pro subscription — the diff viewer and browser preview together form the host gateway, which is gated on Pro.

If moshi-hook is missing, the diff button stays muted and tapping it surfaces an install hint.

Open from the terminal

In an active session, the terminal title shows a small button with a branch icon on the right side. The button reflects the host's state:

muted dot
No git repo detected, or moshi-hook is not reachable.
orange dot
Git repo detected. Tap to open the diff viewer.
orange + accent badge
Git repo with uncommitted changes — there is something to review.

Tap the orange button to open the diff in-app. The viewer remembers which file you were on, so jumping back into a long agent session does not lose your spot.

Open from the CLI

The same viewer can be launched from any shell on the host. It is useful when you want to keep the diff open on a desktop browser while continuing to drive the session from iOS.

anywhere on the host
$moshi diff .
$moshi diff ~/projects/some-repo

The CLI uses a stable local port — 24543 by default — and binds to 127.0.0.1 only. Running moshi diff again for a different workspace re-points the same server at the new repo and reopens the existing local URL, so you do not accumulate tabs.

What's in the diff

The viewer shows everything git status would, grouped sensibly:

  • Staged changes (what would land if you ran git commit).
  • Unstaged changes (what's modified but not yet git add-ed).
  • Untracked files (new files git has not seen before).

The file list on the left lets you jump between changes. Each file renders side-by-side with line-level highlights for added, removed, and modified hunks. Binary files are listed but not rendered.

Privacy

The viewer is local-first by design:

  • The HTTP server binds to 127.0.0.1 only. Nothing is exposed to the network beyond the host itself.
  • The Moshi app reaches it through the same authenticated host gateway used by the browser preview, tunneled over your existing SSH session.
  • Diff contents never reach Moshi's servers.

If you stop the daemon (moshi-hook stop on Linux, brew services stop moshi-hook on macOS), the diff viewer goes away with it.

Troubleshooting

A few common cases:

  • Button is muted, won't open. The agent's session has no git repo as its cwd, or moshi-hook has not detected one yet. Run pwd in the shell — if it is not inside a git repository, cd into one.
  • "Diff unavailable" toast with "Start moshi-hook on the server". The daemon is not running. Start it with brew services start moshi-hook on macOS or moshi-hook serve on Linux. See Hooks.
  • Button stays muted right after pairing. Reconnect the session once — context detection runs at session start.
  • CLI says port 24543 is in use. Another moshi diff is already running. Either reuse it (open the URL it prints) or stop the existing one first.