DiffHub, a git diff viewer for cmux
Review agent code in cmux
For people running coding agents in cmux: review the whole branch, comment on any line, then copy every note into the agent’s next prompt.
npx diffhub@latest cmuxPreserve diff side in agent review prompts #52
Openmainfix/review-comment-side
apps/cli/lib/export-comments.ts−1+2
6 unmodified lines
const lines = comments.map((c) => { const tag = c.tag ? `${c.tag} ` : ""; const loc = c.lineNumber > 0 ? `:${c.lineNumber}` : "";Removed: return `- ${tag}**${c.file}${loc}**: ${c.body}`;Added: const side = c.lineNumber > 0 ? ` (${c.side === "left" ? "old" : "new"} side)` : "";Added: return `- ${tag}**${c.file}${loc}**${side}: ${c.body}`; }); return `## Code Review Comments\n\nPlease address the following:\n\n${lines.join("\n")}`;};Agent prompt · 1 comment
## Code Review Comments Please address the following: - **apps/cli/lib/export-comments.ts:10** (new side): Should file-level comments name a side too?
Stop scrolling through diffs.
Terminal output disappears as soon as it scrolls past. DiffHub keeps the whole branch open beside your agent.
01
See every changed file
Compare the branch with its base and jump between changed files from the tree.
02
Keep the diff open while the agent works
DiffHub watches the repository and tells you when the agent changes a file. You refresh when you’re ready, so the code never moves mid-review.
Working tree review
packages/diff-core/src/git.ts
DiffHub watches the repository, signals a change, and lets you refresh when you are ready.
03
Review from the keyboard
Move between files, switch views, filter and refresh without the mouse.
- Move between filesjk
- Switch diff views
- Filter the tree/
- Refresh changesr
- Collapse a filec
04
Try it on a public pull request
Paste a GitHub pull request URL and read it in the DiffHub viewer. No account or install.
You review. Your agent fixes.
DiffHub doesn’t review code for you. You read the diff, it keeps your notes and hands them to the agent. No account, and your code stays on your machine.
- Network requestsCLI source
- 0
- Portbin/diffhub.mjs
- 2047
- Node.jspackage.json
- 20.11+
- LicenceGitHub
- MIT
Facts checked 23 Sep 2026.
A few things to know.
Do you need cmux to use DiffHub?
No. npx diffhub@latest opens DiffHub in a normal browser tab. Add cmux to open it in cmux on macOS. That option needs cmux.app in /Applications.
How do review comments get to the agent?
Hover a line, click the plus and write the note. When you’re done, Copy & clear turns every comment into one Markdown prompt to paste into your agent. Each line names the file, the line number and the side of the diff. Copying clears the list for the next pass.
Does DiffHub send your code anywhere?
No. DiffHub runs on localhost:2047 and stores comments in .git/diffhub-comments.json. It does not make network requests.
Which branch does DiffHub compare against?
By default it shows everything you haven’t committed, against HEAD, plus untracked files. Switch the scope to All for the whole branch from its merge base with main, master, develop or dev, whichever it finds first. Pass --base <branch> to pick another.
Can you try DiffHub without installing it?
Yes. The live demo opens any public GitHub pull request in the DiffHub viewer, with no account or install. Comments need the local CLI, because they are saved inside your repository.
When is git diff enough?
Use git diff for quick checks and scripts. Use DiffHub when you need to review several files or leave comments for the next agent pass.
Review before you push.
Run DiffHub in any git repository. It finds the base branch and opens the diff on localhost.
npx diffhub@latest cmux
Should file-level comments name a side too?
L10 · new side