All articles
Engineering · 8 min read

I don't read every line of AI code. Here is how we review instead

Line-by-line syntax inspection was built for human typing speed. When generation is free, proportionality and deterministic gates do the heavy lifting.

A dark architectural inspection table where an oversized glowing blueprint full of tangled auxiliary loops is filtered down into a single clean structural beam passing through four illuminated gates.
Contents

When I tell other engineering leaders that Pelaris spans five repositories, 127 Dart services, 143 Cloud Function services and a 21-tool MCP server operated by a lean product team running specialized AI agent squads, the first question is almost always the same. How on earth do you review all of that code?

The honest answer is that I do not read every line of code. I stopped trying months ago.

There is a polite fiction in software engineering right now where teams use agents to generate thousands of lines of code a week, and everyone nods along pretending a human still reads every character of every diff with the same care they gave a 150-line pull request in 2019. Anyone who has watched a senior engineer approve a 1,400-line pull request in four minutes knows what is actually happening.

Pretending to read every line gives you the ceremony of safety without the substance, burning your sharpest human attention on boilerplate before you even reach the twenty lines that can actually take production down.

Instead of reading everything line by line, we review the quantity and proportionality of the code against the feature, rely on cross-model agent reviews across Claude and Gemini, and enforce hard deterministic gates in our local harness and GitHub Actions. It is not perfect, and occasionally something slips through, but it works reliably at a scale that manual line-by-line inspection never could.

Where the 59% throughput gain actually leaks

Over the past year, empirical studies on AI developer tools have converged on the same bottleneck shift. As I broke down in AI lifted engineering throughput 59%, where it goes, once coding agents lift raw code generation by 59%, the constraint moves immediately from writing code to reviewing and verifying it. Faros AI’s telemetry study across more than 10,000 developers found that engineers using coding assistants merged roughly 98% more pull requests, yet pull request review times jumped by 91% and overall organisational delivery barely moved. Bain’s Technology Report observed the same gap: teams see 10% to 15% gains on coding tasks, then lose the time waiting on downstream review, testing and deployment.

Traditional code review was designed for a world where typing code was expensive and slow, and where the bugs were human bugs: typos, off-by-one errors, forgotten null checks. AI coding agents invert both assumptions. Generation is cheap, syntax is clean, and the failure modes look completely different.

The real AI failure mode: an edge case on an edge case

When AI-generated code bites you, it is rarely because the model forgot a semicolon. The compiler and linter catch those in seconds.

The most frustrating thing AI coding agents do is design for imaginary edge cases and enterprise scale. Left unconstrained, an agent will take a simple utility meant for one person - something that could honestly be HTML sitting over an Excel sheet - and quietly engineer it to survive a Black Friday traffic spike at a global bank.

An agent will pause mid-task and ask me to clarify an architectural trade-off that makes no sense. When I dig into why it is asking, I find that the agent designed a feature to handle an edge case, inside a new helper service it invented, to cover an edge case in the original design.

“Reading every line puts your eyes too close to the trees to notice that the agent planted an entire forest you never asked for.”

If you review that pull request line by line from the top of the file, the code looks impressive. The types are clean and the unit tests pass. You can spend forty-five minutes reading every function, leave two nitpicks on variable names, and hit approve - completely missing the fact that the agent just added 900 lines of permanent maintenance debt for a scenario that cannot happen in your product.

Flowchart of the four-gate Pelaris code review process: Gate 1 checks diff proportionality against feature scope and rejects imaginary edge-case scaffolding; Gate 2 runs deterministic hooks, sharded tests and ledger verification; Gate 3 runs cross-model review with a fresh Claude session and a Gemini architectural lens; Gate 4 routes only proportional diffs and critical paths to human judgment

How we review instead: four gates before human eyes

When we rebuilt our multi-repo engineering foundation in our Harbour release, we turned code review into a four-gate filter where human attention sits at the very end, protected by three earlier layers.

Gate 1: The proportionality check (scope before syntax)

Before looking at a single line of implementation, we inspect the shape of the diff: how many files were touched, how many net lines were added versus deleted, and whether the agent extended an existing service from docs/CODEBASE_MAP.md or invented three new helper classes.

If we ask for a small tweak to how a workout summary card renders and the pull request comes back touching eight files with 650 new lines of Dart, we do not read the 650 lines. An out-of-proportion diff is rejected on sight in thirty seconds: name the existing service you are extending, strip out defensive infrastructure not in the acceptance criteria, and bring back a diff that matches the size of the problem.

Gate 2: Deterministic harness and CI proof

Anything that can be checked by a deterministic script should never consume human review bandwidth. Building on our self-managing CI/CD support pipeline, we pulled verification left into the agent’s local execution loop using five shared lifecycle hooks:

  • PreToolUse blocks dangerous actions upfront: Stops direct pushes to main, local production deploys, or live Vertex AI evaluations outside local emulators
  • PostToolUse formats edited files immediately: Records every shell command, exit code and commit SHA into a local session log
  • Stop runs flutter analyze --no-fatal-infos: Guarded behind a lock file so parallel agent sessions never spawn colliding analyzer processes
  • Structured ledger verification (ledger.jsonl): Requires the pull request to cite the exact test run bundle or CI URL rather than taking an agent’s word that tests passed

Gate 3: Cross-model adversarial review (Claude + Gemini)

An AI model reviewing its own output inside the same context window that wrote the code is grading its own homework. To break that context symmetry, we match review depth to blast radius using a three-rung validation ladder:

Validation RungWhat It CoversDeterministic ChecksAI Review LensesHuman Review Depth
Rung 0 (Self-check)Copy edits, CSS tweaks, isolated docs, read-only researchHooks + single-file format + CI buildNone requiredGlance at diff stat and rendered preview
Rung 1 (Fresh session)Standard features, UI screens, non-critical service extensionsFull Stop-hook analyzer + sharded test suite + ledger citation1 fresh Claude session (zero shared authoring context)Proportionality check + skim structural wiring
Rung 2 (Two lenses + cross-model)Auth, PII scrubbing, deterministic IDs, billing, Cloud Function pipelinesFull harness + emulator suite + security rules verification2 independent lenses + Gemini CTO reviewRead every critical line and verify failure paths by hand

When Claude Code writes a complex backend change or multi-repo plan, we pass the diff and architectural context to Gemini acting as an adversarial CTO and Enterprise Architect lens. Where Claude might focus on clean local abstractions, Gemini routinely flags async race conditions, expensive Firestore query fan-outs, or unnecessary abstraction layers before a human ever opens the diff.

Gate 4: Targeted human attention where blast radius lives

Once Gates 1 through 3 have filtered the diff, human review divides cleanly into three buckets:

  • What we trust outright: Formatter output, standard test boilerplate, generated serialization code, and mechanical wiring verified by the sharded test suite
  • What we skim by shape: Standard service methods, state plumbing, and repository queries
  • What we still read line by line: Security boundaries, OAuth and token verification, our two-pass PII scrubber, billing and entitlement logic, deterministic ID generation, and anything that touches how the interface feels to an athlete

What has bitten us (and how the harness learned)

Being honest about this approach means being honest about when it fails. Earlier in the year, while building our MCP server for persistent workout memory, a concurrency bug slipped through where concurrent async tool calls could read stale request context before we wrapped execution in Node’s AsyncLocalStorage. Another time, in our workout generation engine, multi-step running and swimming interval structures drifted between the coach’s prose and the structured steps sent to an athlete’s watch because the agent wrote unit tests that mirrored its own permissive assumptions.

“Whenever a bug gets through, we do not respond by vowing to read more lines of code harder next week. We encode the failure into the harness.”

If a bug came from a path-specific invariant, it goes into a path-scoped rule in .claude/rules/critical-systems.md or .claude/rules/workout-engine.md so every future agent session sees the constraint the millisecond it opens that file. If it can be caught mechanically, it becomes a deterministic test or a PreToolUse / Stop hook, following the same paved-road governance we use for vibe coding in the enterprise.

How to upgrade your team’s review loop

If your pull request queue is backing up because AI made code generation fast while code review stayed manual, start here:

  • Make proportionality the first gate on every PR: Require pull requests to state which existing service they extended, and bounce bloated diffs before anyone reads the syntax
  • Never let the authoring session be the only reviewer: Spin up a fresh agent session with zero shared history, and bring in a second model family on high-risk changes
  • Require tool-written evidence, not agent summaries: Log test results, analyzer exit codes, and commit SHAs to an immutable ledger rather than trusting a PR summary
  • Save line-by-line human reading for the 10% of code carrying 90% of the risk: Focus your deepest human concentration on auth, privacy, billing, and core domain invariants

Written by Bradley Hunt. For more on AI-first building and enterprise architecture, see the writing index.

aicode-reviewai-coding-agentsclaude-codegeminiengineering-leadershipsoftware-architectureci-cdharness-engineeringpelarisdevopspull-requests
Share

Read next

BH

Bradley Hunt

AI, engineering & leadership