<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/"><channel><title>Code Review on Oleksii M.</title><link>https://welldonesoftware.dev/tags/code-review/</link><description>Recent content in Code Review on Oleksii M.</description><generator>Hugo -- 0.154.5</generator><language>en-us</language><lastBuildDate>Wed, 08 Jul 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://welldonesoftware.dev/tags/code-review/index.xml" rel="self" type="application/rss+xml"/><item><title>Automate AI Code Reviews Before Human Review</title><link>https://welldonesoftware.dev/posts/automate-ai-code-reviews-before-human-review/</link><pubDate>Wed, 08 Jul 2026 00:00:00 +0000</pubDate><guid>https://welldonesoftware.dev/posts/automate-ai-code-reviews-before-human-review/</guid><description>&amp;lt;no value&amp;gt;</description><content type="text/html" mode="escaped"><![CDATA[<h2 id="tldr">TL;DR<a href="#tldr" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<pre class="mermaid">flowchart TD
    A[User prompt] --> B[Coding agent]

    B --> C{Tests, lint,<br/>type checks pass?}

    C -- No --> B

    C -- Yes --> D[Spawn review agent]

    D --> E{Valid review<br/>feedback?}

    E -- Yes --> F[Apply feedback]
    F --> C

    E -- No --> G[Ready for<br/>human review]
</pre><h2 id="the-problem">The Problem<a href="#the-problem" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>When a coding agent finishes implementing a change, the next step is usually a human code review. Unfortunately, that often means humans spend time finding mistakes that another AI could have detected first.</p>
<h2 id="the-solution">The Solution<a href="#the-solution" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>Before handing the code to a human, instruct your coding agent (for example, Claude Code or Codex) to launch another coding agent in non-interactive mode to review the changes and automatically apply valid feedback.</p>
<p>This creates an AI feedback loop before human review. The result is code that is more likely to pass manual review on the first attempt, reducing reviewer time spent on obvious bugs, style issues, or missed edge cases.</p>
<p>A note on autonomy: in this workflow the agent applies any feedback it considers valid, including design-level changes. That is acceptable precisely because a human review still follows—nothing merges unreviewed, and the human remains the final safety boundary. If your human reviews tend to be quick sanity checks rather than thorough reads, tighten the loop instead: instruct the agent to flag security- and architecture-level suggestions in its report for your decision rather than silently applying them.</p>
<h2 id="why-use-a-different-model">Why Use a Different Model?<a href="#why-use-a-different-model" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>If the original implementation was based on a poor prompt or an XY problem, asking the same model with the same conversation history to review it often leads to the same blind spots. Garbage In, Garbage Out (GIGO) still applies.</p>
<p>Using a different model increases the chance of catching incorrect assumptions, alternative implementations, or subtle bugs that the original model overlooked.</p>
<h2 id="why-use-a-fresh-context">Why Use a Fresh Context?<a href="#why-use-a-fresh-context" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>A fresh context avoids context rot and eliminates unnecessary conversation history that may bias the review.</p>
<p>However, the reviewing agent still needs enough information to understand the project&rsquo;s conventions and the motivation behind the change. Useful sources include:</p>
<ul>
<li><code>AGENTS.md</code> (or equivalent project instructions).</li>
<li>Git commit history.</li>
<li>An issue or ticket describing the problem being solved.</li>
</ul>
<p>These provide the reviewer with the &ldquo;why&rdquo; without forcing it to inherit the entire implementation conversation.</p>
<h2 id="tips">Tips<a href="#tips" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<p>A good git commit message already explains <em>why</em> the change exists. Hopefully you are writing meaningful commit messages.</p>
<p>If the review is performed before the work is committed, consider providing the reviewing agent with:</p>
<ul>
<li>An issue or ticket URL.</li>
<li>A short explanation of the problem being solved.</li>
</ul>
<p>Without this context, even an excellent reviewing agent may produce only superficial feedback because it lacks the reasoning behind the implementation.</p>
<h2 id="faq">FAQ<a href="#faq" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<h3 id="why-not-let-a-ci-reviewer-review-the-pull-request-merge-request">Why not let a CI reviewer review the Pull Request (Merge Request)?<a href="#why-not-let-a-ci-reviewer-review-the-pull-request-merge-request" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>A CI reviewer is still valuable, but it operates in a much more constrained environment than a local coding agent.</p>
<p>Depending on the CI setup, it may only receive the diff instead of the full repository. It usually cannot inspect installed dependencies, examine sibling repositories in a monorepo or workspace, or verify assumptions by exploring the local development environment. In many cases, it also cannot execute arbitrary command-line workflows beyond those explicitly defined by the CI job.</p>
<p>A local reviewing agent has access to the complete working tree and can investigate the project much more thoroughly before the changes ever reach CI.</p>
<h3 id="why-not-run-the-reviewer-manually">Why not run the reviewer manually?<a href="#why-not-run-the-reviewer-manually" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h3>
<p>You certainly can.</p>
<p>The benefit of making it part of the coding agent&rsquo;s workflow is automation. While the agent performs the review, you are free to work on something else instead of waiting for the implementation to finish and remembering to launch a review yourself.</p>
<p>The review becomes another automatic quality gate rather than an extra manual step, reducing context switching and making the workflow easier to follow consistently.</p>
<h2 id="claudemd-example"><code>CLAUDE.md</code> Example<a href="#claudemd-example" class="anchor" aria-hidden="true"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
      stroke-linecap="round" stroke-linejoin="round" class="feather">
      <path d="M15 7h3a5 5 0 0 1 5 5 5 5 0 0 1-5 5h-3m-6 0H6a5 5 0 0 1-5-5 5 5 0 0 1 5-5h3"></path>
      <line x1="8" y1="12" x2="16" y2="12"></line>
   </svg></a></h2>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-md" data-lang="md"><span style="display:flex;"><span># Code Review
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>After working with any code, always:
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">1.</span> Run a code review non-interactively.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#e6db74">```bash
</span></span></span><span style="display:flex;"><span>codex --sandbox<span style="color:#f92672">=</span>read-only -c model_reasoning_effort<span style="color:#f92672">=</span><span style="color:#e6db74">&#34;high&#34;</span> --strict-config review --uncommitted
</span></span><span style="display:flex;"><span><span style="color:#e6db74">```</span>
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>(Codex CLI shown as an example; any coding agent with a non-interactive mode works.)
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>Tips:
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Use a <span style="font-weight:bold">**10-minute timeout**</span> (600000 ms) on the Bash tool call for this command.
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">-</span> Codex calls may be costly. Rerun the review on major changes or after fixing bugs, but not on minor fixes like typos. Set a hard cap tuned to your repository and budget—for example, 5 calls per session—and require explicit user approval beyond it.
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">2.</span> Apply relevant suggestions.
</span></span></code></pre></div>]]></content></item></channel></rss>