Show HN: I made a heatmap diff viewer for code reviews
23 comments
·October 30, 2025n2d4
> https://0github.com/stack-auth/stack-auth/pull/988
Very fun to see my own PR on Hacker News!
This looks great. I'm probably gonna keep the threshold set to 0%, so a bit more gradient variety could be nice. Red-yellow-green maybe?
Also, can I use this on AI-generated code before creating a PR somehow? I find myself spending a lot of time reviewing Codex and Claude Code edits in my IDE.
lawrencechen
Yeah we definitely want to make the gradient and colors configurable.
What form factor would make the most sense for you? Maybe a a cli command that renders the diff in cli or html?
kburman
It’s an interesting direction, but feels pretty expensive for what might still be a guess at what matters.
I’m not sure an LLM can really capture project-specific context yet from a single PR diff.
Honestly, a simple data-driven heatmap showing which parts of the code change most often or correlate with past bugs would probably give reviewers more trustworthy signals.
lawrencechen
Yeah this is honestly pretty expensive to run today.
> I’m not sure an LLM can really capture project-specific context yet from a single PR diff.
We had an even more expensive approach that cloned the repo into a VM and prompted codex to explore the codebase and run code before returning the heatmap data structure. Decided against it for now due to latency and cost, but I think we'll revisit it to help the LLM get project context.
Distillation should help a bit with cost, but I haven't experimented enough to have a definitive answer. Excited to play around with it though!
> which parts of the code change most often or correlate with past bugs
I can think of a way to do the correlation that would require LLMs. Maybe I'm missing a simpler approach? But agree that conditioning on past bugs would be great
ramonga
Maybe add some caching? I clicked one of the example PRs and it kept loading forever...
lawrencechen
Shoot, we should have caching in place already. Taking a look now
lawrencechen
Getting rate limited GitHub, gonna add caching here as well. Temporary workaround is to sign in manually and return to example page: https://0github.com/handler/sign-in
timenotwasted
This is very cool and I could see it being really useful especially for those giant PRs. I'd prefer it if instead of the slider I could just click the different heatmap colors and if they indicated what exactly they were for (label not threshold). I get the underlying premise but at a glance it's more to process unless I was to end up using this constantly.
lawrencechen
Currently tooltips are shown when hovering on highlighted words. Need to make it visible on mobile though. Was wondering if you were thinking of another way to show the labels besides hovering?
timenotwasted
I was referring to something more akin to a legend like you have in the examples "(examples: hard-coded secret, weird crypto mode, gnarly logic)." where I could click "hard-coded secret" (not the best label but you get the idea) and it would filter on those instead of the slider.
cdiamand
This is something I have found missing in my current workflow when reviewing PR's. Particularly in the age of large AI generated PR's.
I think most reviewers do this to some degree by looking at points of interest. It'd be cool if this could look at your prior reviews and try to learn your style.
Is this the correct commit to look at? https://github.com/manaflow-ai/cmux/commit/661ea617d7b1fd392...
lawrencechen
https://github.com/manaflow-ai/cmux/blob/main/apps/www/lib/s...
This file has most of the logic, the commit you linked to has a bunch of other experiments.
> look at your prior reviews and try to learn your style.
We're really interested in this direction too of maybe setting up a DSPy system to automatically fit reviews to your preferences
cdiamand
Thank you. This is a pretty cool feature that is just scratching the surface of a deep need, so keep at it.
Another perspective where this exact feature would be useful is in security review.
For example - there are many static security analyzers that look for patterns, and they're useful when you break a clearly predefined rule that is well known.
However, there are situations that static tools miss, but a highlight tool like this could help bring a reviewer's eyes to a high risk "area". I.e. scrutinize this code more because it deals with user input information and there is the chance of SQL injection here, etc.
I think that would be very useful as well.
austinwang115
This is a very interesting idea that we’ll definitely look into.
wiether
I like the idea!
File `apps/client/electron/main/proxy-routing.ts` line 63
Adding a comment to explain why the downgrade is done would have resulted in not raising the issue?
Also two suggestions on the UI
- anchors on lines
- anchors on files and ability to copy a filename easily
jtwaleson
This is really useful. Might want to add a checkbox at a certain threshold, so that reviewers explicitly answer the concerns of the LLM. Also you can start collecting stats on how "easy to review" PR's of team members are, e.g. they'd probably get a better score if they address the concerns in the comments already.
nzach
I think this "'should review' threshold" is a really great idea, but I probably wouldn't be able to trust it enough to make it useful.
skeptrune
I feel like this is really smart. Going to have to set it up!
austinwang115
Just prepend 0 in front of github in your PR link and it should work
skeptrune
Ah, I see now.
austinwang115
This makes reading long PRs not instantly LGTM… now the heatmap guides my eyes so I know where to look.
petralithic
Change the domain name, you will likely get a cease and desist otherwise.
383toast
Reminds me of this one, highlighting for text https://github.com/mattneary/salience
0github.com is a pull request viewer that color-codes every diff line/token by how much human attention it probably needs. Unlike PR-review bots, we try to flag not just by "is it a bug?" but by "is it worth a second look?" (examples: hard-coded secret, weird crypto mode, gnarly logic, ugly code).
To try it, replace github.com with 0github.com in any pull-request URL. Under the hood, we split the PR into individual files, and for each file, we ask an LLM to annotate each line with a data structure that we parse into a colored heatmap.
Examples:
https://0github.com/manaflow-ai/cmux/pull/666
https://0github.com/stack-auth/stack-auth/pull/988
https://0github.com/tinygrad/tinygrad/pull/12995
https://0github.com/simonw/datasette/pull/2548
Notice how all the example links have a 0 prepended before github.com. This navigates you to our custom diff viewer where we handle the same URL path parameters as github.com. Darker yellows indicate that an area might require more investigation. Hover on the highlights to see the LLM's explanation. There's also a slider on the top left to adjust the "should review" threshold.
Repo (MIT license): https://github.com/manaflow-ai/cmux