Automating Adversarial Code Review for Claude Code
Chase AIgo watch the original →
the gist
The author adds an iterative adversarial review layer to Claude Code using a custom 'grill-me-codex' skill, forcing Claude Code to refine its plans against a secondary model before execution.
Iterative Adversarial Review
The author addresses the limitation of Claude Code acting as both the architect and the sole evaluator of its own plans. By extending Matt Pocock's 'grill-me' skill, the author introduces an adversarial review phase where Claude Code and a secondary model (Codeex) iterate on a project plan up to five times. This process generates two primary artifacts: plan.mmd, which serves as the final source of truth, and plan_review_log.md, which documents the back-and-forth critique and subsequent refinements.
Implementation Workflow
- The process begins with the standard 'grill-me' phase, where the user and Claude Code define project requirements through a series of prompted questions.
- Once the initial plan is established, the 'grill-me-codex' skill triggers an automated review cycle where Codeex analyzes the plan for security, correctness, and architectural flaws.
- Claude Code is required to update the
plan.mmdbased on specific findings from Codeex, such as identifying unbounded client-side slugs, potential DDoS vectors, or incorrect database targeting. - The system maintains session memory across iterations, allowing the models to track whether previous 'fixes' actually resolved the identified issues or were merely superficial.
- The process concludes when both models reach a consensus, typically resulting in a more robust plan that catches errors before any code is written or executed in the environment.
Context
Developers often struggle to articulate requirements clearly, leading to mediocre AI outputs. Even when a plan is established, non-expert users may lack the technical background to verify if the generated code is optimal or secure. By bolting an adversarial review layer onto existing planning skills, the author creates a mechanism to bridge the gap between initial intent and high-quality, verified implementation.