How to review code an AI agent wrote
Reviewing code an AI agent wrote is a volume problem before it’s a comprehension problem. The tools built for it split on one axis, which is where you read the diff: hunk and revdiff keep you in the terminal, cmux’s built-in cmux diff opens a pane, and DiffHub opens a browser tab that refreshes while you keep editing. DiffHub is the browser answer. If you never want to leave the terminal, it’s the wrong one.
| Fact | Value | Source |
|---|---|---|
| Where the review happens | A browser tab, or a cmux browser split | first-party |
| Published package | diffhub 0.3.3 | npm registry |
| Install cost | 35.7 MB unpacked, 1,827 files | npm registry, dist.unpackedSize |
| Runtime floor | Node 20.11, or Bun 1.0.23 | apps/cli/package.json engines |
| Default port | 2047 | apps/cli/bin/diffhub.mjs |
| Inline render ceiling, per file | 500 changed lines, or 500,000 bytes of patch | apps/cli/lib/diff-file-stat.ts |
| Review comment tags | 4, plus untagged | apps/cli/lib/comment-types.ts |
| Comment store | .git/diffhub-comments.json, written atomically | apps/cli/lib/comments.ts |
Every row measured 2026-08-10 against diffhub 0.3.3.
What makes reviewing agent-written code different from reviewing a teammate’s pull request?
Reviewing agent-written code differs from reviewing a colleague’s pull request in three ways, and none of them is that the code is worse. The change arrives all at once rather than accreting over days. There is no author to ask, so anything you can’t work out from the diff you have to work out from the repository. And the code keeps moving while you read it, because the agent is still going.
That third one is what breaks a normal review tool. A viewer you have to re-run after every edit turns reviewing into a loop of reopening. cmux users have asked for exactly this: issue #7101 requests live reload for cmux diff and names watching an agent’s file modifications as the reason. It was still open on 2026-08-10.
Should you read the diff in the terminal or the browser?
Read the diff wherever you are going to act on it. Four of the five options below are terminal-shaped and one is not, and that single difference matters more than any difference in how they render a diff.
| Tool | Where it runs | Verdict |
|---|---|---|
| revdiff | TUI, Go binary | Best if you want the annotations piped straight into Claude Code or Codex. |
| hunk | Terminal, npm or Homebrew | Best if you want agent notes rendered inline and never leave the terminal. |
| cmux diff | cmux pane | Best for a quick pass. Already installed, costs nothing, no watch yet. |
git diff main...HEAD | Any shell | Best when you have exactly one question. Nothing to install. |
| DiffHub | Browser tab, or cmux split | Best for a large change you will read, edit, and re-read in one sitting. |
hunk describes itself as “Terminal diffs for humans & agents” and ships a watch mode, so on the refresh question it and DiffHub agree; they disagree about the terminal. revdiff is “a TUI for reviewing diffs, files, and documents with inline annotations”. Both are MIT licensed and free. Both quotes are from their own pages, read 2026-08-10.
How do you hand review comments back to the agent?
Handing review comments back to the agent works the same way in all three tools: you annotate lines, then export the annotations as text the agent can act on. This is not a DiffHub differentiator and the page would be wrong to claim it is. revdiff writes structured annotations to stdout on quit and ships plugins for Claude Code and Codex. hunk renders agent notes inline with a summary, rationale and author.
DiffHub stores comments in .git/diffhub-comments.json in the repository you are reviewing, and copies them out as markdown. Each comment can carry one of four tags, [must-fix], [suggestion], [nit] or [question], or none. The tag is what stops an agent treating a passing thought as a blocking instruction.
## Code Review Comments
Please address the following:
- [must-fix] **apps/cli/lib/git.ts:118**: this swallows the spawn error
- [question] **apps/web/lib/config.ts:12**: is this base branch rule intentional?That is the whole format, produced by exportCommentsAsPrompt in apps/cli/lib/export-comments.ts. Paste it into the agent that wrote the code.
What does DiffHub measure, and what does it refuse to render?
DiffHub refuses to render a file inline once it crosses either of two thresholds: 500 changed lines, or 500,000 bytes of patch. Both live in apps/cli/lib/diff-file-stat.ts. Binary files are excluded from the check entirely rather than counted as large.
DiffHub diffs against the merge base with the detected base branch, preferring origin/main over local main so unpushed commits still appear. That preference is the difference between seeing what your branch introduced and seeing every difference between two tips.
Comments are written to a temp file and renamed over the store, so an interrupted write cannot leave you with a half-written review. Mutations are queued rather than concurrent.
npx diffhub@latest cmuxWhen is DiffHub the wrong answer?
DiffHub is the wrong answer in five specific cases, and they are worth stating plainly because a tool with no stated limits is a tool nobody has used in anger.
- It is 35.7 MB unpacked against revdiff's single Go binary. If install weight matters to you, that is a real reason to pick something else.
- It needs Node 20.11 or Bun 1.0.23 on the machine. There is no standalone binary.
- cmux mode is macOS only and expects cmux.app at /Applications/cmux.app. Everywhere else, it is an ordinary browser tab.
- A file with 500 or more changed lines, or a patch of 500,000 bytes or more, is not rendered inline. Generated lockfiles and vendored bundles hit this constantly.
- It does not review anything for you. If you want findings generated rather than somewhere to read the diff, this is the wrong category, and CodeRabbit or Greptile is the thing you are describing.
What else do people ask about reviewing AI-generated code?
Do any of these tools review the code for you?
No. hunk, revdiff, cmux diff and DiffHub all show you a diff and let you annotate it. If you want findings generated for you, that’s a different category, and you’re describing CodeRabbit or Greptile.
Are these tools free?
revdiff, hunk and DiffHub are MIT licensed and free. cmux diff ships with cmux. git diff is git. Licences read from the projects’ own pages on 2026-08-10.
Should you review agent-written code if the tests pass?
Tests tell you the code does what the tests say. They don’t tell you the agent touched forty files where three would’ve done, or that it deleted a check it couldn’t satisfy. Read the diff.
Changelog
- : First published. Competitor claims quoted from hunk.dev, github.com/umputun/revdiff and the two cmux issues, all checked on this date.
Related: how to view a git diff in cmux compares the three cmux-specific options in more detail. DiffHub is the tool itself.