Coding agents hand me pull requests with 30 changed files, listed in alphabetical order. The code is usually fine. What is slow is understanding it well enough to say "yes, ship it".
GitHub's review page was designed for changes a person wrote over a few days. An agent's change is different: it is spread across many files, small functions get moved around, and the description rarely tells you where to start.
So I built Trail: a command-line tool and a local web page for reviewing pull requests, with Claude Code next to the diff. It is free, it runs on your own machine, and it uses the GitHub and Claude Code logins you already have.
Read the change as a story
Press Generate walkthrough and Claude reads the change and the code around it, then sorts the hunks into chapters in the order the logic runs: data shapes first, then the core change, its callers, the tests, and the mechanical follow-ups last.
Each chapter says what that step does, how risky it is, and what you should check. You also get a list of things to look at: possible bugs, missing edge cases, behaviour the description does not mention.
Every hunk appears in exactly one chapter. Anything Claude did not place gets a chapter of its own, so the walkthrough can reorder the change but never hide part of it.
I tried it on a real open-source pull request with 29 files and 105 hunks. It became 8 chapters.
Skip the code that only moved
Agents love moving functions between files. A normal diff shows that as a big deletion and a big addition, and you end up comparing them by eye.
Trail detects blocks that moved without being edited and folds each one into a single line that links to where it went. In that same pull request, 273 lines turned out to be code that had only moved.
It is deliberately strict: a moved function whose body was also edited shows the edited lines as real changes.
Follow the code without leaving the review
Underlined names in the diff are links. Click one to see its definition and where it is used, and keep clicking to follow the chain.
This is a name-based index over the repository, not a language server, so it works on any language with no setup. The trade-off is that functions sharing a name all show up.
Ask Claude, which reads the real code
Claude Code sits beside the diff. Select some code and press Explain or Find problems, or just ask. It reads the repository at the head of the change before answering, and its answers link back to the exact lines.
In Ask mode it can only read. In Edit mode it changes files in Trail's own checkout of the pull request. You see the resulting diff and decide whether to discard it or commit and push.
Finish the review
- Leave notes on any line as you read. When you are done, post them to GitHub as one normal review, or hand them to Claude as a change request.
- Tick Viewed on each hunk. The mark is tied to the content of the hunk, so your progress survives new commits and only what actually changed comes back.
Find what to review
Leave out the pull request number and Trail lists them in the terminal:
trail my-repo # pick from the repository's open pull requests trail --list # everything waiting for your review trail . # the current branch of a local repository The last one is how I check an agent's work before it becomes a pull request at all.
Reviewing code you do not trust
A pull request can contain anything. In a pull request's checkout, Claude Code runs with --restricted --safe-mode: no shell, no hooks, no project settings, and file tools limited to that checkout. The page is served on localhost only and refuses requests from other websites.
It is not a sandbox, and the README lists what these measures do not cover. For example, the local server has no password, so do not run it on a machine you share.
Try it
You need Node.js 22.13 or newer, the GitHub CLI and Claude Code.
npm install -g @mermaid-company/trail trail doctor trail doctor checks that everything Trail needs is installed and logged in, and tells you how to fix what is missing. Then:
trail owner/repo If the package gives you trouble on your system, run it from source:
git clone https://github.com/John-Diego/trail cd trail && npm install && npm run build npm run trail -- owner/repo Trail is at version 0.1.0 and has been used on macOS so far. Linux should work. The source is public under the Apache 2.0 licence with the Commons Clause: free to use and change, but not to sell.
Tell me what you think
- Code and issues: https://github.com/John-Diego/trail
- npm: https://www.npmjs.com/package/@mermaid-company/trail
- Discussion: I am collecting feedback on this LinkedIn post, and in the comments below.
I would especially like to hear how the chapter ordering works on your own pull requests.
Trail is an independent project.





