
lazydiff — a terminal-native diff reviewer with semantic diffs, persistent notes, and 60fps rendering
When I need to review a lot of ai generated code or code in general, I either open a browser tab and lose my context, or pipe it through git diff and scroll through a wall of red and green that forgets everything the moment I close it. No way to leave notes, no way to jump between files, no way to come back later and pick up where I left off.
So I built lazydiff. The core idea was simple, a diff reviewer that lives in the terminal, remembers state, and actually understands code structure.
The first decision was rendering. I went with ratatui and virtualized scrolling — only the visible rows get drawn each frame. This matters because agent-generated diffs can be massive. The benchmark fixture I test against is an 11k-line Node.js PR diff, and it renders at 60fps with sub-2ms frame times. I didn't want to build something that felt sluggish on real-world diffs.
For syntax highlighting I use tree-sitter(a thing I have been loving for so long now), but the tricky part with diffs is that deleted code needs to be highlighted in its original language context, not just painted red. So lazydiff reconstructs both sides of the file independently and maps highlights back through the diff. Inline diffs tokenize each changed line pair and run LCS to show exactly which words changed, you immediately see the meaningful difference without scanning the whole line.
The part I'm most excited about is semantic diffs. lazydiff uses https://github.com/Ataraxy-Labs/sem, which I open-sourced separately and got a lot of love from the Rust community. Instead of just showing line by line level diffs, it parses changes into semantically meaningful entity graphs for functions added, methods modified, classes moved. You see the structure of your changes and how they connect to each other. This is the same engine behind https://github.com/Ataraxy-Labs/weave, the semantic merge driver I built
The agent workflow is what motivated the whole project. You can leave threaded comments anchored to exact lines questions, instructions, notes and review quite fast, which was the utmost desire of the community. Agents also read them via lazydiff agent list and reply via CLI. The whole review session persists to SQLite locally, so you can close the terminal, come back the next day, and everything is exactly where you left it.
License:MIT Licensed
Open Source Repo: https://github.com/Ataraxy-Labs/lazydiff