Skip to content

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 cmux
Open the live demo

Preserve diff side in agent review prompts #52

Open

mainfix/review-comment-side

apps/cli/lib/export-comments.ts−1+2

1

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)` : "";

Should file-level comments name a side too?

L10 · 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?

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

Try it on a public pull request

Paste a GitHub pull request URL and read it in the DiffHub viewer. No account or install.

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
Read the install guide