
Why I built it
AI has exponentially increased how much code gets written, and reviewing it has quickly become one of the key bottlenecks in the development cycle.
I still believe in reading through the code myself (for now). So I decided to focus on making the reading itself a better experience. GitHub shows a pull request as a list of files sorted by path, which is almost never the order the change makes sense in. You end up jumping between files to find where a new function is defined, or reading a caller before the thing it calls. And unless the author has heavily commented their work, it can often be quite difficult to follow exactly what the changes are meant to be doing.
What it is
PR Story Mode reads a pull request as a story instead of a pile of files. It puts the changes in an order that makes sense, like a new type before the code that uses it or a helper before its callers. It explains each step in plain language, with the code right below the words that describe it.
Every changed line appears exactly once, so you can still review line by line and nothing gets skipped. Formatting, renames, reordered imports and lockfiles are set aside in their own section, so the steps show the real changes.
It comes in two forms:
- A Chrome extension that adds a Story mode button to pull requests on GitHub. You can highlight code to ask about it, and leave review comments without leaving the story.
- A command-line tool that writes a story as a single HTML page, for local branches and scripts.
It uses your own model API key, and a typical pull request costs about 11 cents to turn into a story.
How it works
- Split the change into pieces. tree-sitter parses both versions of every changed file, and each changed line is matched to the smallest piece of code around it, such as a function, a method or a config key.
- Find what depends on what. A symbol graph links pieces together: if one piece defines something another uses, the definition has to come first.
- Set aside mechanical changes. Formatting-only edits, consistent renames, import shuffles, lockfiles and generated files go to their own section.
- Plan the order. The model groups the pieces into steps and orders them so they read well. The plan is then checked in code: every line must appear exactly once, and no step may come before something it depends on unless the model says why. A plan that fails goes back to the model to fix, up to three times, before falling back to plain dependency order.
- Find helpful unchanged code, such as the definitions the changed lines use and existing callers of code that changed, and show it collapsed above each step.
- Explain each step in short beats: a few sentences, then the lines of code they describe. Words in the explanation link to the exact lines they’re about.
The first step usually appears in about 15 seconds, and you can start reading while the rest are written.
Measuring it
An evaluation benchmark of 60 real PRs scores the output with LLM-as-judge rubrics, calibrated against hand labels and blind pairwise comparisons with raw diffs. A separate run over 40 recent Flask and ky pull requests checks the mechanics: every changed line covered in all 40, and no plan breaking dependency order without saying why.
Next projectDig Deeper →