# AI Code Review

> The AI Code Review is the practice of using AI models to analyze code changes and find issues.

## How does AI code review work?

The practice of using AI to check pull requests for bugs, security issues and style violations before human review. Complements, but does not replace, review by developers who know the project.

- Topic: Agentic Coding
- Type: practice

## Example

Wrong:

```text
Review this code.
```

Right:

```text
Review this diff for bugs, security issues and missing tests.
Follow the rules in AGENTS.md.
For each issue give: file, line, problem, suggested fix.
Skip style nits that the linter already checks.
```

A focused review prompt with project rules and a fixed comment format produces specific, actionable findings instead of generic praise.

## Common mistakes

- Treating an AI review with no comments as proof that the code is correct.

## Key points

- The reviewer gets the diff plus enough surrounding code and project rules to judge it.
- Each comment points to a specific line and explains the problem, not only a style preference.
- A person still approves the merge, and AI review does not replace required human review.

## Interview questions

### Can AI code review replace human reviewers?

No. It catches many common bugs quickly, but people still need to judge design, business logic and whether the change is the right one.

### Why does AI code review produce false positives?

The reviewer often sees only the diff, without the rest of the code or project rules. Giving more context and clear rules reduces noise.

### Should the AI review its own generated code?

It can help, but a separate review pass with fresh context finds more issues than the same session checking its own work.

## Related cards

- [Code Review](https://wonderium.dev/processes/code-review.md)
- [Pull Request](https://wonderium.dev/processes/pull-request.md)
- [LLM-as-a-Judge](https://wonderium.dev/ai/llm-as-a-judge.md)
- [Static Code Analysis](https://wonderium.dev/engineering/static-code-analysis.md)
- [Headless Mode](https://wonderium.dev/ai/headless-mode.md)

---

- Level: [Artificial Intelligence](https://wonderium.dev/ai.md)
- HTML version: https://wonderium.dev/ai/ai-code-review
- Last updated: 2026-11-25
