<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: John Diego</title>
    <description>The latest articles on DEV Community by John Diego (@johndiego).</description>
    <link>https://dev.to/johndiego</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4269994%2F29fbc624-1c6f-44db-8fa0-6f7b2cdc6917.jpg</url>
      <title>DEV Community: John Diego</title>
      <link>https://dev.to/johndiego</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/johndiego"/>
    <language>en</language>
    <item>
      <title>AI writes code faster than I can review it, so I built Trail</title>
      <dc:creator>John Diego</dc:creator>
      <pubDate>Sat, 28 Nov 2026 04:15:56 +0000</pubDate>
      <link>https://dev.to/johndiego/ai-writes-code-faster-than-i-can-review-it-so-i-built-trail-4jha</link>
      <guid>https://dev.to/johndiego/ai-writes-code-faster-than-i-can-review-it-so-i-built-trail-4jha</guid>
      <description>&lt;p&gt;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".&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;So I built &lt;strong&gt;Trail&lt;/strong&gt;: 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Read the change as a story
&lt;/h2&gt;

&lt;p&gt;Press &lt;strong&gt;Generate walkthrough&lt;/strong&gt; 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjxadm4hckxe6scxqp9dp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fjxadm4hckxe6scxqp9dp.jpg" alt="Trail's overview of a pull request: a summary, a list of things to check, and chapters in the sidebar" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;I tried it on a real open-source pull request with 29 files and 105 hunks. It became 8 chapters.&lt;/p&gt;

&lt;h2&gt;
  
  
  Skip the code that only moved
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1zo7oje9snu8n8ztdzcm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1zo7oje9snu8n8ztdzcm.jpg" alt="A diff in Trail where moved blocks are folded into single lines such as '4 lines moved unchanged from another file'" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It is deliberately strict: a moved function whose body was also edited shows the edited lines as real changes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Follow the code without leaving the review
&lt;/h2&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxikchpudm96k04hsxm01.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fxikchpudm96k04hsxm01.jpg" alt="Clicking a function name in the diff opens its definition in a side panel, with a tab for usages" width="800" height="456"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Ask Claude, which reads the real code
&lt;/h2&gt;

&lt;p&gt;Claude Code sits beside the diff. Select some code and press &lt;strong&gt;Explain&lt;/strong&gt; or &lt;strong&gt;Find problems&lt;/strong&gt;, or just ask. It reads the repository at the head of the change before answering, and its answers link back to the exact lines.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcph5b17pbpwfi6mb3609.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fcph5b17pbpwfi6mb3609.jpg" alt="Claude answering a question in a panel beside the diff, with links to the hunks it refers to" width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In &lt;strong&gt;Ask&lt;/strong&gt; mode it can only read. In &lt;strong&gt;Edit&lt;/strong&gt; 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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Finish the review
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;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.&lt;/li&gt;
&lt;li&gt;Tick &lt;strong&gt;Viewed&lt;/strong&gt; 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.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Find what to review
&lt;/h2&gt;

&lt;p&gt;Leave out the pull request number and Trail lists them in the terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trail my-repo        &lt;span class="c"&gt;# pick from the repository's open pull requests&lt;/span&gt;
trail --list         &lt;span class="c"&gt;# everything waiting for your review&lt;/span&gt;
trail .              &lt;span class="c"&gt;# the current branch of a local repository&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The last one is how I check an agent's work before it becomes a pull request at all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reviewing code you do not trust
&lt;/h2&gt;

&lt;p&gt;A pull request can contain anything. In a pull request's checkout, Claude Code runs with &lt;code&gt;--restricted --safe-mode&lt;/code&gt;: 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.&lt;/p&gt;

&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Try it
&lt;/h2&gt;

&lt;p&gt;You need Node.js 22.13 or newer, the GitHub CLI and Claude Code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm install -g @mermaid-company/trail
trail doctor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;trail doctor&lt;/code&gt; checks that everything Trail needs is installed and logged in, and tells you how to fix what is missing. Then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;trail owner/repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the package gives you trouble on your system, run it from source:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;git clone https://github.com/John-Diego/trail
&lt;span class="nb"&gt;cd&lt;/span&gt; trail &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm install &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; npm run build
npm run trail -- owner/repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;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.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tell me what you think
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Code and issues: &lt;a href="https://github.com/John-Diego/trail" rel="noopener noreferrer"&gt;https://github.com/John-Diego/trail&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;npm: &lt;a href="https://www.npmjs.com/package/@mermaid-company/trail" rel="noopener noreferrer"&gt;https://www.npmjs.com/package/@mermaid-company/trail&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Discussion: I am collecting feedback on &lt;a href="https://www.linkedin.com/feed/update/urn:li:activity:7532271099074539521/" rel="noopener noreferrer"&gt;this LinkedIn post&lt;/a&gt;, and in the comments below.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I would especially like to hear how the chapter ordering works on your own pull requests.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Trail is an independent project.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>ai</category>
      <category>codereview</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
