Skip to content

AI code review: how to do it, which tools to use and where it goes wrong

How to use AI to review pull requests without losing quality: the workflow I use, the tools and their pricing, what studies measure and the security risks.

Ramon Gomes 10 min read Level: Intermediate

Also available in: Español, Français, Português

I write a good chunk of my code with agents. And the faster code comes out, the more the bottleneck moves to review: someone has to read all of it before it goes to production. The question every team is asking is whether AI can do that reading too.

It can, partly. In this article I show how I do AI code review day to day, which tools exist and what they cost, what the studies actually measure and where it goes wrong.

Grey-haired editor marking up a printed page with a red pen, next to a laptop showing the text full of colored underlines from the spell checker
The spell checker finds the misplaced comma. Whoever decides if the text is good is still the editor.

What AI Code Review Is

Code review is reading someone else's code before it goes into the project, usually in a pull request. The reviewer looks for logic errors, security flaws, hard-to-maintain code and anything that does not follow the team's conventions.

In the AI version, a language modelAI model trained on large amounts of text to predict the next word, which lets it chat, summarize, translate and write code. reads the diff (the lines that changed) and, in the better tools, the rest of the repository too, and returns comments: "this query builds SQL from user text", "this useEffect does not clean up the listener", "this test does not cover the empty list case".

It does not replace human review for a simple reason: the AI does not know why that change exists. It sees the code, not the conversation with the client, the architecture decision from six months ago or the shortcut that was agreed on purpose. Google's review guide, the best free material on the subject, spends more time on "does the change make sense for the system?" than on syntax errors (Google).

Where AI Helps and Where It Does Not

AI usually catches well AI usually gets wrong or misses
Local logic errors: inverted condition, unhandled null Whether the change solves the right problem
Known insecure patterns: concatenated SQL, secrets in code Business rules that are not written down anywhere
A test that misses the obvious case Architecture decisions and trade-offs
Inconsistency with the rest of the file Effects on another service it did not read
Confusing names, functions that are too long When the "mistake" is intentional

A CodeRabbit survey of 470 open source pull requests found, on average, 10.83 issues per PR written with AI against 6.45 in those written only by people, with the biggest gap in readability and logic (CodeRabbit). Take it with a grain of salt: they sell AI review and admit they are not sure who wrote each PR. But the direction matches Google's DORA 2025 report: AI use is linked to shipping more and, at the same time, to less stability (Google Cloud). More code, more review.

AI Code Review Tools

Tool How it works Free option?
Claude Code /code-review in the terminal reviews the local diff, with an effort level and an option to fix. Managed version on GitHub with @claude review Local, on any plan. Managed, only Team and Enterprise
GitHub Copilot Request Copilot as a reviewer on the PR, or turn on automatic review Not on the Free plan
OpenAI Codex Comment @codex review on the PR; on GitHub it flags only the most serious issues Depends on your ChatGPT plan
CodeRabbit App that comments on every PR on GitHub or GitLab Free for public repositories
PR-Agent Open source: /review, /describe, /improve, with any model, including local ones Yes, you only pay for the model
Greptile Reviews with context from the whole repository Free starter plan for 1 person
Gemini Code Assist Summarizes and reviews the PR on GitHub Enterprise version in preview

Pricing changes fast in this category. Check the official page before deciding; the links are in the table.

How I Do AI Code Review

My flow has one rule I learned the hard way: whoever wrote it does not review it. When an agent writes the change, another model, from another company, does the review. A different model has a different bias, and the cross review has already caught a concurrency bug that both the agent that wrote it and I let through.

Pull request flow: automated checks, AI review, human decision and merge
The AI comes in after what the machine already solves exactly, and before the person who decides.
  1. Let the machine do what it does without mistakes. Lint, type checking, tests and a dependency scanner run before any AI. Do not waste the reviewer on what a command can settle.
  2. Small PRs. Google's study of 9 million changes found a median of 24 lines per change (Google Research). A small diff is easier for both the person and the model.
  3. Give context. A REVIEW.md or AGENTS.md file with the team's rules: what is blocking, what is preference, what to never accept. How to move those rules into the linter is in front-end patterns for teams.
  4. Ask for a report, not a fix. First the AI points things out, with severity. Fixing is a second step that someone authorizes.
  5. Judge each comment. Valid, false positive or worth investigating. Do not obey in bulk.
  6. Write down the false positive and why. It becomes a rule in the context file and stops coming back every week.
  7. A person approves. No serious tool approves the PR on its own, and the Claude Code docs point out that a review with no findings does not mean code with no bugs.

The Alura article on the subject (in Portuguese) proposes a similar flow, with the AI re-evaluating its own false positives before they reach a human, and it is worth reading (Alura).

A Prompt That Works

When I use a chat model instead of a ready-made tool, the request looks like this:

text
Review the diff below as a senior reviewer on this project.
Context: <what the change is supposed to do, in 2 lines>.
Point out only real problems, with severity (critical, high, medium, low),
file and line, and why it is a problem. Do not rewrite the code.
If you are not sure, say you are not sure instead of making something up.
Ignore style that the linter already covers.

The last line cuts half the noise. The second to last cuts the other half.

What the Studies Say

The most useful study I found is industrial, not a lab one. A home appliance company rolled out a PR-Agent based tool on three projects, with 4,335 pull requests (Cihan et al., 2025):

  • 73.8% of the AI's comments were resolved, meaning people agreed with most of them.
  • The average time to close a PR went up from 5h52 to 8h20. More comments, more to read and reply to.
  • The main complaints were wrong comments and irrelevant comments.

Another study, with more than 22,000 comments from 16 tools across 178 repositories, showed that effectiveness varies a lot, and that comments that are short, include a code snippet and were requested by the person are the ones most likely to turn into a change (Sun et al., 2025).

My take: AI improves the quality of what gets merged, but it does not save time for free. If the team only measures "time to merge", it will think things got worse. Also measure rework and defects after deploy.

The Risks

Watch and Read More

To compare two versions of a file outside GitHub, Diffchecker does the job. And if the question is giving the agent a view of the whole repository, Graphify builds a graph of the code that it checks before commenting.

Frequently Asked Questions

What is the best AI for reviewing code?

It depends on where your code lives and how much you want to pay. To start at no cost in the terminal, Claude Code's /code-review. To comment on every PR of an open source project, CodeRabbit. To run with your own model, PR-Agent. What changes the result most is not the tool, it is the context you give it.

Does AI code review replace the human reviewer?

No. It is a fast first read. The person still decides whether the change makes sense for the system and approves the merge.

How can I do AI code review for free?

Run Claude Code's /code-review on your plan, use PR-Agent with a local model, or install CodeRabbit on a public repository. For a small diff, pasting it into a chat with the prompt above also works.

Is it safe to send my code to an AI tool?

It depends on the contract and the tool. Read where the code is processed and whether it is used for training. If it cannot leave, use a local model.

Does AI make code review faster?

Not always. In the industrial study cited above, the time to close PRs went up, because there were more comments to handle. The gain shows up in quality when the team measures rework and defects.

References

Source: https://ramongomessilva.com.br/blog/ai-code-review · Accessed on December 02, 2026

Share Share on LinkedIn Share on X
Cite this article

Ready-made reference, with today as the access date.

ABNT

Brazilian standard (NBR 6023). Use it in theses and academic papers submitted in Brazil.

GOMES, Ramon. AI code review: how to do it, which tools to use and where it goes wrong. Ramon Gomes, 8 nov. 2026. Disponível em: https://ramongomessilva.com.br/blog/ai-code-review. Acesso em: 2 dez. 2026.

APA

American Psychological Association style. Common in scientific papers and journals, especially in the social, behavioral and health sciences.

Gomes, R. (2026, November 8). AI code review: how to do it, which tools to use and where it goes wrong. Ramon Gomes. https://ramongomessilva.com.br/blog/ai-code-review

BibTeX

Format for LaTeX users (Overleaf, for example). Paste it into your .bib file or import it into Zotero or Mendeley.

@online{gomes2026aicodereview,
  author = {Gomes, Ramon},
  title = {{AI code review: how to do it, which tools to use and where it goes wrong}},
  organization = {Ramon Gomes},
  year = {2026},
  month = nov,
  date = {2026-11-08},
  url = {https://ramongomessilva.com.br/blog/ai-code-review},
  urldate = {2026-12-02}
}
Found a mistake?

Wrong fact, broken link, outdated information: tell me and I will fix it.

10 to 2,000 characters. If you can, point to the right source.

Only so I can reply. It never shows on any page of the site.

Written by

Ramon Gomes

Software Engineer

Full stack software engineer. I like taking a messy problem, listening to the people who live with it and shipping something that holds up day to day. These days I split my time between my own products, applied AI and client work.

Available for projects

Need Something Like This Built?

I build websites, systems, apps and AI automations, from design to deploy. Tell me what you need or see what I offer.

Related Articles