Settings

Theme

Show HN: Revdiff – TUI diff reviewer with inline annotations for AI agents

github.com

17 points by bumpa 2 months ago · 7 comments · 2 min read

Reader

I built a terminal diff viewer for a workflow I couldn't do comfortably with existing tools: reviewing AI-generated code changes without leaving the terminal session where the agent runs, annotating what needs to change, and feeding those annotations straight back to the agent. Plenty of diff viewers exist, and some can even feed notes back to an agent, but none of them fit that flow for me - they pulled me out of the terminal into a separate app, or the round-trip back to the agent was clunky.

Revdiff is how I solved it. From a Claude Code session I type `/revdiff main` or just say "review diff for last 3 commits" - it opens as a terminal overlay on top of the agent session. I read the diff, drop annotations on any line, hunk, or file, then quit. The annotations go straight back to the agent, which picks them up and starts working on them. When the agent is done, revdiff reopens on the new changes so I can annotate again - and this loop continues until I quit without leaving any annotations.

The same flow turned out to be useful for plans too. There's a separate `revdiff-planning` plugin that hooks into Claude Code's plan mode - the moment the agent finishes a plan and calls ExitPlanMode, revdiff opens automatically on the plan text. I annotate the parts I disagree with or want expanded, quit, and the agent revises the plan before writing any code.

It's a two-pane TUI: file tree on the left, syntax-highlighted diff on the right. Vim-style navigation, /search, hunk jumping, word-level change highlighting, blame gutters, collapsed diff mode. Fully customizable - 7 bundled color themes, remappable keybindings, and per-color overrides via CLI flags, env vars, or config file. Works with git and Mercurial.

It's a single binary - just `revdiff HEAD~3` to review your last 3 commits. Ready-to-use plugins are available for Claude Code (terminal overlay via tmux, Zellij, kitty, wezterm, Kaku, cmux, ghostty, iTerm2, or Emacs vterm - whichever you're in), Codex, and pi.

Written in Go, open source (MIT). Install via brew: `brew install umputun/apps/revdiff`

GitHub: https://github.com/umputun/revdiff Site: https://revdiff.com

Would love to hear how others approach reviewing AI-generated diffs and PRs, any unusual use cases, and ideas for what to improve or add.

r13v 2 months ago

Awesome tool, thank you. I use it with Claude Code, mostly in plan mode to comment on a plan and then return to CC for further work. It allows me to point out things in the plan that we need to elaborate on without leaving the terminal.

bumpaOP 2 months ago

Author here, happy to answer questions or dig into the technical details.

hackmajoris 2 months ago

I use it within OpenCode. I’m happy.

temphaaa 2 months ago

Great work, I like it!

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection