cd /news/ai-tools/the-agent-writes-faster-than-you-can… · home topics ai-tools article
[ARTICLE · art-69012] src=pydantic.dev ↗ pub= topic=ai-tools verified=true sentiment=· neutral

The agent writes faster than you can review

Macroscope, a code-review tool built by the company of the same name, launched its CLI today, offering an AI reviewer that catches 5% more bugs than the second-best tool while generating 75% fewer comments, addressing the bottleneck of human review as agent-written code accelerates development. The tool reads code structure via abstract syntax trees rather than text diffs, pulling context from git history and issue trackers to catch cross-file issues invisible to text-only reviewers.

read8 min views1 publishedJul 22, 2026
The agent writes faster than you can review
Image: Pydantic (auto-discovered)

Monday's agent can write code. Give it a shell and a filesystem, one import each, and it does, fast, and overnight it opens four pull requests. They're waiting for you: hundreds of lines of agent-written Python, each diff plausible, each commit message tidy. You are now the slowest component in the system, reading at human speed what was written at agent speed, and the honest voice in your head asks the question the rest of this week has to answer: who reviews the agent's code?

Because someone has to, and it has to be more than a vibe check. Agent code needs review more than human code, not less. It's fluent, confident, and wrong in ways that read right: the API that almost exists, the test that asserts the mock, the edge case handled with a comment instead of code. The failure mode of agent-written code is precisely that it looks reviewed.

The basic reviewer, in ten lines

The most direct AI reviewer is a second Pydantic AI agent whose one job is to critique the diff. No new dependencies: give it the shell to read git diff

, an output_type

so the findings arrive as data, and the same model you used to write the code:

import logfire
from pydantic import BaseModel
from pydantic_ai import Agent
from pydantic_ai_harness import Shell

logfire.configure()
logfire.instrument_pydantic_ai()

class Finding(BaseModel):
    severity: str  # 'blocker' | 'note'
    file: str
    line: int
    issue: str

class Review(BaseModel):
    approved: bool
    findings: list[Finding]

reviewer = Agent(
    'anthropic:claude-opus-4-7',
    output_type=Review,
    instructions=(
        'You are a code reviewer. Read `git diff HEAD` and flag genuine defects '
        'only: missing null checks, wrong return types, tests that assert their '
        'mocks. Ignore style. If none, set approved=true.'
    ),
    capabilities=[Shell(allowed_commands=['git'])],
)

review = reviewer.run_sync('Review the current diff.').output

That's a real reviewer, and it will catch things: the obvious missing check, the wrong import, the copy-paste bug in an if-branch. It's also honest about its limits. An LLM reading a diff reads text, so the change that quietly breaks a caller two files over is invisible to it, and the taste it applies is a chatbot's taste, so a small wall of "consider extracting this helper" arrives alongside the two real bugs. That's a prototype reviewer. Shipping it into your write→review→merge loop is a different bar, which is where the fastest path lives.

The fastest path to production

Macroscope is the reviewer already running in that loop for a lot of teams, built by a group whose founding observation is this post's cold open: as companies ship exponentially more code, humans review far less of it. Two things separate it from the ten-line critic above.

First, it reads structure, not text. An agentic pipeline parses the code into an abstract syntax tree so the model reasons over what changed rather than a diff hunk, and pulls context from git history and your issue tracker before it opens its mouth. The cross-file call site that would have been invisible to a text-only reviewer is right there in the graph.

Second, it's tuned for the two numbers that decide whether an AI reviewer earns a place in your loop: recall and precision. On their benchmark of a hundred real-world bugs, Macroscope caught 5% more bugs than the second-best tool while generating 75% fewer comments. Readers of Agents Week will recognize the philosophy: an AI that critiques your work earns trust by showing restraint, and 75% fewer comments is restraint you can measure.

And it meets the agent where the agent works. Leveraging the brand new Macroscope CLI (Launched today!), the harness's Macroscope capability provides one tool,

run_macroscope_review

, which shells out to the CLI, parses the streamed findings, and hands back a structured review with paths and line numbers.Here's that Agent, with the same three imports as the basic version, just one word different:

import logfire
from pydantic_ai import Agent
from pydantic_ai_harness import Shell
from pydantic_ai_harness.macroscope import Macroscope

logfire.configure()
logfire.instrument_pydantic_ai()

reviewer = Agent(
    'anthropic:claude-opus-4-7',
    capabilities=[
        Shell(allowed_commands=['git']),
        Macroscope(),
    ],
    instructions='Review the current diff with Macroscope and return the findings.',
)

review = reviewer.run_sync('Review the current diff.')

The capability surfaces findings only. The agent validates each one and fixes the real ones with the tools it already has — the division of labor you want in the loop: the reviewer reviews, the author fixes, and neither rubber-stamps the other.

Compose the loop

Standalone review isn't the point; converged code arriving at the PR is. Same author, same reviewer, one instruction longer, plus the tools that let the agent actually resolve findings and open the PR when the review is clean:

  • The agent finishes a change and reviews its own diff with Macroscope, in the loop, before any PR exists: validate each finding, fix the real ones, re-review until clean.
  • Only then does it open the PR ( gh pr create

), where Macroscope's GitHub app reviews again with codebase-wide context and writes the summary a human can actually absorb. - A human reads a convergedPR: the diff, the findings, and how each was resolved, and makes the one decision that stays human. Merge.

As harness code, the whole loop is three capabilities and four sentences:

import logfire
from pydantic_ai import Agent
from pydantic_ai_harness import FileSystem, Shell
from pydantic_ai_harness.macroscope import Macroscope

logfire.configure()
logfire.instrument_pydantic_ai()

agent = Agent(
    'anthropic:claude-opus-4-7',
    capabilities=[
        FileSystem(),
        Shell(allowed_commands=['git', 'gh']),
        Macroscope(),
    ],
    instructions=(
        'Review your diff with Macroscope before opening a PR. Validate each '
        'finding, fix the real ones, and re-review until clean. After opening '
        'the PR, resolve anything the PR review raises. Never merge.'
    ),
)

agent.run_sync('Ship the feature branch through review.')

No new infrastructure, no workflow change: it's the review you already trust, moved earlier and able to keep up with the thing it reviews. The allowlist means its shell runs git

and gh

and nothing else, and the last instruction is the entire governance model in two words.

The gravity well

Macroscope's founders have a sharper way of putting the problem: pull requests are a gravity well for human attention. Every agent you add makes the well deeper, and the ending they predict is that review becomes always-on, automatic, and largely invisible, running continuously while the code is written instead of piling up where humans have to fish it out. The in-loop review above is that future in miniature: by the time a pull request is opened, the code is much more likely to be correct, because the arguing already happened.

Their prediction for people is the interesting part: humans stop being reviewers and become policymakers, the ones who define when approval is safe and which changes an automated pipeline may pass through. That's not a demotion. It's the same move this whole week has made at every gate: automate the volume, keep the judgment, and spend the judgment where it compounds.

Why this matters

Review was quietly doing two jobs. One is catching defects, and that job scales: machines can read every line, hold the whole dependency graph in view, and never get tired on the day's fifteenth PR. The other is deciding what ships, and that job doesn't scale and shouldn't: it's accountability, and accountability needs a name attached.

Unbundling them is the fix, and it's what human-in-the-loop should mean: not a human somewhere in the pipeline, but a human at the decision. Let the machine do the reading at machine speed, on every line of every PR. Keep the human on the decision, with better inputs than they've ever had: a reviewed diff instead of a raw one, findings raised, addressed, and resolved in the open.

And the split is about to matter more. In When agents build agents, agents author new tools and capabilities to disk, and the harness validates and arms them on the next run: the loop runs, learns, writes, re-arms. Code the agent wrote for itself is still code, fluent, confident, and about to join its author's own toolkit. Put Macroscope's review between writes and re-arms and the self-improvement loop gets the same property as the PR flow: every rung of the ladder carries a converged review, and a human can audit how the agent got smarter. Self-improving agents without review is how you end up with a system nobody understands.

Getting started

The basic reviewer costs nothing more than the model you're already paying — pydantic_ai_harness.Shell

and a second Agent

with an output_type

are all it takes to run today. For the production loop, install the Macroscope CLI and sign in once (docs); uv add pydantic-ai-harness

puts the Macroscope

capability on the shelf, and it runs the same review their editor plugins do, inside your agent's loop. For the PR side, Macroscope installs as a GitHub app and starts reviewing and summarizing your next pull request.

Back to the morning. The four PRs are still there, but each now arrives converged: findings raised by the reviewer, validated and fixed by the author, summarized for the human who decides. You read the arguments first, then the diffs they settled, and you merge the ones that earned it.

The agent writes. The reviewer reviews. You decide. Merge stays a human verb.

── more in #ai-tools 4 stories · sorted by recency
── more on @macroscope 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/the-agent-writes-fas…] indexed:0 read:8min 2026-07-22 ·