An AI tool I find useful

last updated: Jul 28, 2025

One of the tasks that I do most often is to review code. I've written a review command that asks an AI to review a code sample, and I've gotten a lot of value out of it.

I ignore most of the suggestions that the tool outputs, but it has already saved me often enough from painful errors that I wanted to share it in the hope that others might find it useful.

How to install it

How it works

The main job of the script is to generate context from a git diff and pass it to llm for code review.

If you run review with no arguments, it will:

The result looks like this in my terminal:

How I use it

My main use of the command is to review a PR I'm preparing before I file it. The biggest value I've gotten out of it is that it frequently catches embarrassing errors before I file a PR - misspellings, DELETEMEs I forgot to remove, and occasionally logic errors.

It also often suggests features that make sense to add before finishing the PR, or as next steps.

It is very important to use it intelligently! The LLM is just an LLM, and it also may be missing context. The screenshot above has two examples of mistaken suggestions that I read and ignored; you have to apply your own understanding and taste to its output.

Keep in mind that it is tasked via its system prompt with finding problems and making suggestions; no matter how good your code is it will try to find and suggest something.

I also use it for reviewing other people's PRs, with review origin/main origin/some-feature-branch. In these cases, I really am just using it for clues as to some things that I may need to investigate with my actual human brain. Please do not just dump llm suggestions into a PR! That's both rude and likely to be unhelpful.

How it differs

That last point brings me to why I prefer this tool to github's own copilot review tool.

Areas for improvement

Postscript

Thanks to a suggestion on lobste.rs from davidcrespo, I added the ability to provide context via stdin. Thanks for the suggestion!

↑ up