Graphite Reviewer is now Diamond

What is AI code review?

Greg Foster
Greg Foster
Graphite software engineer
Try Graphite

AI code review is the use of artificial intelligence to automate the review of source code. These systems help detect bugs, flag deviations from coding standards, and offer contextual suggestions to improve readability, performance, and security.

Unlike basic static analysis tools, modern AI code reviewers use large-scale machine learning models trained on vast codebases. They identify patterns, understand context, and offer suggestions tailored to the specific project and technology stack.

AI models are trained on millions of lines of code across different languages and frameworks. Once integrated into a review pipeline, they scan new code changes to detect issues such as:

  • Syntax errors
  • Logic bugs
  • Security vulnerabilities
  • Violations of coding standards
  • Performance anti-patterns

AI code review typically involves a combination of techniques:

  • Natural language understanding: LLMs can parse comments, documentation, and function names to understand what code is supposed to do.
  • Semantic code analysis: Tools evaluate syntax trees and control flow to reason about logic, potential errors, and best practices.
  • Pattern recognition: ML models trained on large codebases detect common issues, code smells, and even security vulnerabilities.
  • Contextual recommendations: Based on the code being reviewed, AI can suggest refactors, simplifications, or adherence to team conventions.

Modern AI code reviewers don’t just scan diffs. Some tools analyze the broader codebase to understand how a new change fits into the existing system. This allows them to flag issues that might be invisible to line-by-line reviewers—for example, a function that behaves correctly in isolation but breaks contract with the rest of the system.

Advanced tools may use techniques like retrieval-augmented generation (RAG) to incorporate historical changes and repository-specific behavior into their suggestions.

AI review tools typically integrate with platforms like GitHub, GitLab, or Bitbucket. Some provide real-time inline feedback in IDEs; others comment on pull requests automatically. In most cases, developers can review, dismiss, or accept suggestions with a single click.

Over time, some AI code reviewers learn from feedback loops—adjusting to team conventions, ignoring dismissed suggestions, and improving the relevance of comments based on user interactions.

  • Faster feedback: AI reviews code instantly, so developers don’t wait on busy teammates.
  • Reduced review time: AI speeds up the review process by automating routine feedback and catching common issues early.
  • Consistent enforcement: Coding standards are applied uniformly across contributors and pull requests.
  • Higher code quality: The combination of pattern recognition and contextual awareness improves both the surface-level and structural quality of code.
  • Developer education: New team members receive immediate, actionable feedback, helping them get up to speed faster.

Several AI-powered tools are helping teams automate and enhance code review processes:

  • Diamond by GraphiteDiamond offers immediate, context-aware feedback on pull requests with zero setup. Focuses on low-noise, high-signal comments, and supports rule customization. It reviews the entire codebase, not just diffs, and is integrated with GitHub.
  • CodeRabbitCodeRabbit is an AI-first pull request reviewer that provides chat-like interactions and inline feedback.
  • CodacyCodacy’s AI engine analyzes code to recognize patterns, uncover bugs, detect security issues, and highlight duplicate code. It also includes a feature that lets developers set custom quality guidelines and apply them consistently across the team.

Here’s how developers typically incorporate AI into their workflows:

  • During development: IDE plugins surface suggestions in real time, reducing bugs before code hits version control.
  • In pull requests: AI bots analyze code changes and comment with suggestions, freeing up human reviewers to focus on architectural and design discussions.
  • As part of CI/CD: AI reviews run automatically during builds, blocking merges on critical issues.

For example, a team using Diamond might:

  1. Write new code.
  2. Push changes to a repo.
  3. Let Diamond leave feedback on the pull request.
  4. Incorporate the AI-suggested changes before final human review.

This layered approach increases code quality and reduces the time from feature branch to production.

AI tools for code reviews are changing how teams maintain code quality. By catching issues earlier, providing contextual feedback, and reducing the manual burden on human reviewers, these systems support faster and more reliable development workflows.

Tools like Diamond represent a shift from traditional code review toward intelligent automation—helping developers focus more on architecture and logic while letting AI handle the repetitive, mechanical parts of review.

Built for the world's fastest engineering teams, now available for everyone