Skip to content

cmux diff viewer: three ways to review a branch

Author of DiffHubLast updated

Run cmux diff for a quick look, or git diff main...HEAD in a pane for one question. While an agent is still editing the branch, run DiffHub: it opens in a split, notices each edit and refreshes when you say.

npx diffhub@latest cmux
Browse a real PR in DiffHub

Which cmux diff viewer should you use?

Why doesn’t cmux diff refresh while you edit?

It doesn’t watch the filesystem yet. cmux diff arrived in v0.64.11 with a base-branch picker, syntax highlighting, ⌘F search and review comments, but checking a fix still means reopening it. Live reload is #7101, and choosing the pane it opens in is #7102, which #7134 would fix with a --here flag. All three were open on 1 October 2026, in cmux v0.64.25.

Once cmux closes #7101, its built-in diff may be all you need. Until then I keep DiffHub open in a split.

How does DiffHub work in a cmux split?

It opens beside your agent and starts on everything you haven’t committed; switch the scope to All to compare the branch against origin/main. When files change, a dot pulses on the refresh button and nothing moves until you press r. Comment on any line, and Copy & clear turns every comment into one prompt to paste into the agent’s pane.

Working tree review

packages/diff-core/src/git.ts

Up to date
4242const base = await detectBaseBranch(repo);
+43return diffFromMergeBase(repo, base);

DiffHub watches the repository, signals a change, and lets you refresh when you are ready.

How do you install DiffHub for cmux?

You don’t have to: npx fetches it. To keep it, run npm install -g diffhub and then diffhub cmux. It needs macOS with cmux in /Applications, and Node 20.11+ or Bun 1.0.23+. Pass --base <branch> when your base isn’t main, master, develop or dev. If the diff is empty, you have nothing uncommitted: switch the scope to All.

What else do people ask about git diffs in cmux?

How is DiffHub different from cmux-hub?

Both open a browser diff beside your terminal. cmux-hub redraws as files change, shows commit history and GitHub PR status, and sends each review comment straight to the cmux terminal. DiffHub marks the refresh button and waits for you, so a hunk you’re reading never moves, and collects every comment into one prompt you paste when you’re done. Pick cmux-hub for PR status next to the diff, DiffHub for long reviews of a branch an agent is still editing.

Does cmux have a file viewer?

Yes. cmux open <file> opens a file in a cmux preview tab, and Markdown files in a Markdown preview. It shows one file, not what changed, so for a diff use cmux diff or DiffHub.

Does DiffHub send your code anywhere?

No. It serves the viewer from 127.0.0.1, makes no outbound requests while it runs, and keeps comments in .git/diffhub-comments.json inside your repository.

What is the difference between two dots and three dots in git diff?

Two dots compares the two branch tips. Three dots compares from the merge base, so you see what your branch introduced, not everything that’s landed on main since. Three dots is almost always the one you want.

Which cmux diff viewers have syntax highlighting?

All of them except cmux-git-diff and a plain git diff, which colour added and removed lines but not the code. cmux diff and DiffHub both render with Pierre’s diff viewer and Shiki, cmux-hub and cmux-diff use Shiki, and revdiff uses Chroma.