# Code Review with AI Agents: Keeping Quality at Higher Throughput

> Split review into three layers: deterministic checks in CI, an AI pre-review for logic and security defects, and a human approval for intent, design and risk. Small pull requests, review rules kept in the repository and branch protection make sure the AI never decides on a merge by itself.

Canonical URL: https://www.ruebstudio.de/en/guides/ai-agent-development/ai-code-review-agents  
Author: Dr.-Ing. Marcus Rüb, CEO  
Published: 2026-11-13

Once coding agents can produce features, tests and refactors in minutes, the slow part of software delivery moves. Writing is no longer the constraint; checking is. This guide explains how to organise code review so that quality and accountability survive when far more changes arrive than people can read line by line. Information is current as of November 2026.

## What is AI code review and what is it used for?

AI code review means a language model, or a group of cooperating agents, reads a pull request, looks for defects and leaves comments on the affected lines. It supports human review rather than replacing it: the AI does the first pass, and a person decides whether the change is merged.

In practice the AI does three jobs:

- **Finding defects** that are easy to miss in a diff: an inverted condition, a swallowed exception, an unhandled edge case, a database query that forgets to filter by tenant.
- **Enforcing team rules** that no linter knows about, such as "every new API route needs an integration test" or "no personal data in log lines".
- **Summarising context**, so the human reviewer understands what the change does before reading it.

This is a different question from how agents write code in the first place. How teams use Claude Code, Codex or Cursor day to day is covered in [Agentic Software Development in Teams](https://www.ruebstudio.de/en/guides/ai-agent-development/agentic-software-development-teams). Here we look one step later: how the output of those agents is checked before it reaches the main branch.

## Why does review become the bottleneck when agents write code?

Agents multiply the number of changes, not the number of people accountable for them. Without adjustments you get large, rapid-fire pull requests that are approved on a skim. DORA research suggests that adopting AI without solid delivery basics can hurt stability rather than help it.

According to [Google Cloud's summary of the 2024 DORA report](https://cloud.google.com/blog/products/devops-sre/announcing-the-2024-dora-report), increased AI adoption was accompanied by an estimated 1.5% decrease in delivery throughput and an estimated 7.2% reduction in delivery stability. The authors link this to missing fundamentals such as small batch sizes and robust testing. These are estimated associations from survey data, not proven causes, but the direction is a useful warning.

The [2025 DORA report](https://dora.dev/research/2025/dora-report/) frames AI as an amplifier that magnifies an organisation's existing strengths and weaknesses. For review, that means a team with clear rules and small changes benefits, while a team with loose approvals simply gets more loosely reviewed code.

Three mechanisms make review fragile under agent load:

- **Size.** One agent run can touch hundreds of lines across many files. [Google's engineering practices](https://google.github.io/eng-practices/review/developer/small-cls.html) say about 100 lines is usually a reasonable change and 1,000 lines is usually too large, and describe small changes as reviewed more quickly and more thoroughly.
- **Plausibility.** Generated code tends to look tidy, well named and well commented. That lowers the reader's guard even when the logic is wrong.
- **Cadence.** When new pull requests arrive every hour, there is pressure to approve faster, and approval turns into a formality.

## How does an AI-assisted review process work?

A robust process has three layers with a clear division of labour. Machines check what can be checked deterministically, AI looks for substantive defects, and a human judges intent, design and risk. Each layer takes load off the next one; none of them replaces another.

**Layer 1: deterministic checks.** Formatting, linting, type checks, tests, dependency and secret scanning run in CI and are configured as required status checks. [GitHub's documentation](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches) states that all required status checks must pass before changes can be merged into a protected branch. Anything covered here should be excluded from AI comments.

**Layer 2: AI pre-review.** One or more agents read the diff together with the surrounding code and report logic errors, security issues and rule violations. Anthropic's [Claude Code Review](https://code.claude.com/docs/en/code-review) works in four stages: several agents search in parallel, a verification step checks candidate findings against the code to drop false positives, the remaining findings are deduplicated and ranked by severity, and the results are posted on the pull request.

**Layer 3: human approval.** Someone responsible for the affected code approves the change. GitHub enforces this through the "Require pull request reviews before merging" rule and, for sensitive paths, required review from code owners.

Underneath all three sit **rules stored as files in the repository**. What the team wants checked is versioned next to the code rather than living in individual reviewers' heads. That makes review traceable and equally readable for people and agents.

## What are the main ways to run AI code review?

There are five common set-ups: review built into the code platform, a managed review service, an agent running in your own CI, a local pre-check before the pull request is opened, and custom review agents. They are not mutually exclusive; many teams pair a local pre-check with an automatic review on the pull request.

**Built into the platform.** GitHub Copilot code review comments on pull requests and suggests fixes. According to [GitHub's documentation](https://docs.github.com/en/copilot/concepts/agents/code-review), Copilot only reviews when assigned by default; automatic reviews can be switched on for an individual, a repository or an organisation, with Lite, Balanced and Max effort levels. Some files, such as dependency manifests like `package.json`, log files and SVGs, are skipped.

**Managed service.** Claude Code Review runs on Anthropic's infrastructure with read-only access to the repository, and it does not build or run your code. It is available on Team and Enterprise plans for GitHub repositories and offers Quick, Standard and Deep review levels.

**Agent in your own CI.** With the GitHub Action `anthropics/claude-code-action@v1`, Claude runs on your own runners. A workflow can invoke a review skill on every pull request; with the `--comment` argument the findings appear as inline comments on the pull request rather than only in the workflow log, as described in the [GitHub Actions documentation](https://code.claude.com/docs/en/github-actions). This option gives you control over triggers, model choice and run limits.

**Local pre-check.** Developers ask their agent to review a branch before opening a pull request, for example with the `/code-review` command in Claude Code. Problems get fixed before a colleague spends any time on them.

**Custom review agents.** Teams with specific needs write their own subagents or skills, for instance for database migrations or API contracts.

How the individual tools differ, and which suits which team, is a topic for a dedicated comparison. For the overall process the key point is that every option is bound to the same rules and the same human approval.

## What should human reviewers focus on?

People should check what the AI cannot judge: whether the change solves the right problem, whether it fits the architecture and what risk it carries in production. Style, formatting and obvious defects should already have been handled by CI and the AI pass by the time a person looks.

A practical split of responsibilities:

| Question | Who checks |
|---|---|
| Formatting, types, tests passing | CI |
| Logic errors, edge cases, unsafe patterns | AI pre-review |
| Team rules from REVIEW.md or instruction files | AI pre-review, spot-checked by a human |
| Does the change solve the right problem? | Human |
| Does it fit the design, can it be rolled back? | Human |
| Does it touch security, privacy, money or contracts? | Human, code owner where relevant |

A good yardstick is what Google calls the senior principle of its [review guidelines](https://google.github.io/eng-practices/review/reviewer/standard.html): reviewers should favour approving a change once it definitely improves the overall code health, even if it isn't perfect. Equally, nothing justifies checking in changes that definitely make code health worse. That standard applies to agent-written code without modification.

For agent-written changes in particular:

- **Intent before lines.** Read the ticket or spec first, then check whether the diff does exactly that and nothing more.
- **Read the tests sceptically.** Agents write tests that fit their own code. Ask whether a test captures the business requirement or merely freezes current behaviour.
- **Watch for unexpected files.** Changes to configuration, dependencies, CI workflows or instruction files deserve extra attention.
- **Weigh AI findings rather than ticking them off.** An AI comment is a signal. If you dismiss it, leave a one-line reason.

## Which rules does a team need for AI-assisted review?

A team needs three kinds of rules: what the AI should report, who gives final approval, and how large a change may be. All three belong in the repository or in branch settings, so they are binding and auditable for people and agents alike.

**What the AI should report.** According to the [customisation guide](https://code.claude.com/docs/en/code-review-customize), Claude Code Review reads `CLAUDE.md` as project context and `REVIEW.md` as review-only instructions. There you define what counts as important, which paths to skip and how many minor comments are allowed. A trimmed example based on the documentation:

```markdown
# Review instructions

## What Important means here
Only findings that would break behaviour, leak data or block a rollback.
Style and naming are Nit at most.

## Cap the nits
Report at most five Nits per review.

## Do not report
- Anything CI already enforces: lint, formatting, type errors
- Generated files under src/gen/ and any *.lock file

## Always check
- New API routes have an integration test
- Log lines don't include email addresses or user IDs
- Database queries are scoped to the caller's tenant
```

For GitHub Copilot, the same role is played by `.github/copilot-instructions.md`, path-specific files under `.github/instructions/` and an `AGENTS.md` at the repository root.

**Where the rules are read from.** This is a security detail worth knowing. Claude Code Review reads `REVIEW.md` from the base or default branch and never from the pull request's own changes. Copilot, according to GitHub, reads instructions from the pull request's head branch so that changes to them can be tested in the same pull request. In other words, with Copilot a pull request can change the rules it is reviewed against. Treat edits to instruction files like edits to security configuration and require code-owner approval for them.

**Who approves.** The AI should not decide alone. Anthropic's Code Review never approves or blocks a pull request, and its check run does not conclude as a failure. Copilot reviews do not count towards required approvals by default; if you enable Copilot approvals, that approval is dismissed on every new push. Turning that option on is a deliberate governance decision. For business-critical code, human approval enforced through branch protection and code owners is the safe default.

**How large a change may be.** Set a size limit above which a pull request must be split, and put it into the instructions for the agents that write code. Google's guidance of around 100 lines is a sensible starting point; the final limit is a team decision.

## What needs to be in place first?

AI review is only as good as the environment around it. You need working CI with tests, protected branches, clear ownership of code areas and a decision on which data may be sent to which provider.

- **CI and tests.** Without automated tests nobody confirms that behaviour is correct. Claude Code Review, for example, reads the diff and surrounding code but does not build or execute it.
- **Branch protection.** Required reviews and required status checks on the main branch are what hold the whole process together.
- **Code owners.** A `CODEOWNERS` file naming responsible people or teams for sensitive areas such as authentication, billing or infrastructure.
- **Data approval.** Agree with your privacy and security leads whether source code may go to a cloud service. Anthropic notes that Code Review is not available to organisations with Zero Data Retention enabled; if you need that, check alternatives such as an agent in your own CI under your existing API agreement, or a self-hosted model.
- **Budget and limits.** Every automatic review consumes compute or tokens. Set review depth, run limits and triggers (every push or on request) deliberately.

## How do you roll out AI code review step by step?

Start with one repository, one short rules file and mandatory human approval. Track for a few weeks how many AI findings turn out to be valid, and only then expand. That way the team and the tooling calibrate together.

1. **Record a baseline.** How long do pull requests wait for review today, how big are they, how often do defects surface after merge? Without these numbers you cannot show any effect later.
2. **Set branch protection.** Required human approval, required status checks, code owners for sensitive paths.
3. **Tidy up CI.** Anything a linter or type checker catches belongs in CI and is excluded in the review instructions.
4. **Write the rules file.** A `REVIEW.md` or Copilot instruction file with a handful of concrete points. Five rules that always apply beat fifty nobody maintains. The more precise the spec before coding starts, the easier the review; see [spec-driven development with agents](https://www.ruebstudio.de/en/guides/ai-agent-development/spec-driven-development-agents).
5. **Run a pilot.** One repository, automatic review when a pull request opens. Every dismissed AI comment gets a short reason.
6. **Refine.** Recurring false positives are excluded in the rules file; recurring real defects become a permanent rule or a new test.
7. **Limit agent output size.** Tell code-writing agents, in their instructions, to keep changes small and focused on one topic.
8. **Expand.** More repositories, possibly with lighter review depth for routine code and deeper review for critical systems.

## What are the limits and risks?

AI reviews miss defects, raise false alarms and can create trust they have not earned. The biggest risk is organisational: if a green AI check is read as approval, scrutiny drops precisely when more code is arriving.

- **No guarantee.** Anthropic says plainly that a review with no findings does not mean the code is error-free or secure. GitHub advises validating Copilot's feedback carefully and adding a human review.
- **False positives.** Too many unjustified comments train people to ignore all of them. Cap minor findings and require evidence, such as a file and line reference for any claim about behaviour.
- **Shared blind spots.** When the same kind of model writes and reviews the code, it may share the same wrong assumptions. Deterministic tests and human judgement are not redundancy; they are the real safeguard.
- **Rules that can be tampered with.** Instruction files and code comments are inputs to the model. Put changes to them under code-owner protection, especially on platforms that read rules from the head branch. The broader threat picture is covered in [AI agent security](https://www.ruebstudio.de/en/guides/ai-agent-architecture/ai-agent-security).
- **No execution.** An AI that only reads code is weak at spotting runtime issues such as performance regressions or race conditions. Tests and production monitoring cover those.
- **Cost and cadence.** Reviewing every push consumes budget. Match depth and triggers to how risky the code is.

When does this approach not fit? In repositories without tests or branch protection, an AI review tends to hide the gaps rather than close them. Fix the fundamentals first.

## How do I get started?

Start small: one repository, a short rules file, mandatory human approval and a size limit for agent-generated changes. After a few weeks you will know which AI findings actually help, and you can expand with evidence instead of gut feeling.

A pragmatic first step for this week:

- Check branch protection on the main branch and make human approval mandatory.
- Create a `REVIEW.md` or Copilot instruction file with no more than ten rules, at least three of them "always check" items taken from real defects of recent months.
- Switch on automatic AI review for one repository and ask reviewers to give a short reason for every dismissed comment.
- Add a maximum pull request size to the instructions for code-writing agents.

In our own operations, treating review rules like code has worked well: they change through pull requests, have a named owner and are tightened whenever a defect slips through. If you want to introduce this way of working across a team, a hands-on [workshop on agentic software development](https://www.ruebstudio.de/en/workshop) is a good setting to agree rules, branch protection and roles on a real repository. How agents fit into the writing side of daily team work is covered in [Agentic Software Development in Teams](https://www.ruebstudio.de/en/guides/ai-agent-development/agentic-software-development-teams).

## Frequently asked questions

### Can an AI review replace human approval?

Not as a safe default. Anthropic's Code Review never approves or blocks a pull request, and Copilot reviews do not count towards required approvals unless an administrator explicitly enables that.

### Where do I tell the AI reviewer what to flag?

For Claude Code Review, in REVIEW.md and CLAUDE.md at the repository root. For GitHub Copilot, in .github/copilot-instructions.md, path-specific .instructions.md files and AGENTS.md.

### How large should an agent-generated pull request be?

Google's engineering practices describe about 100 lines as usually reasonable and 1,000 lines as usually too large. Agents should follow the same limit, because a person still has to own every line.

### Does a clean AI review mean the code is safe?

No. Anthropic states that a review with no findings does not mean the code is error-free or secure, so tests, static analysis and human judgement remain necessary.

## Sources

- [Claude Code Docs: Code Review](https://code.claude.com/docs/en/code-review)
- [Claude Code Docs: Customize Code Review (REVIEW.md, CLAUDE.md)](https://code.claude.com/docs/en/code-review-customize)
- [Claude Code Docs: Claude Code GitHub Actions](https://code.claude.com/docs/en/github-actions)
- [GitHub Docs: About GitHub Copilot code review](https://docs.github.com/en/copilot/concepts/agents/code-review)
- [GitHub Docs: About protected branches](https://docs.github.com/en/repositories/configuring-branches-and-merges-in-your-repository/managing-protected-branches/about-protected-branches)
- [Google Engineering Practices: The Standard of Code Review](https://google.github.io/eng-practices/review/reviewer/standard.html)
- [Google Engineering Practices: Small CLs](https://google.github.io/eng-practices/review/developer/small-cls.html)
- [Google Cloud Blog: Highlights from the 10th DORA report (2024)](https://cloud.google.com/blog/products/devops-sre/announcing-the-2024-dora-report)
- [DORA: State of AI-assisted Software Development 2025](https://dora.dev/research/2025/dora-report/)
