Skip to content

Part 02 / Shipping Workflows

AI-Powered Code Review

Using BugBot and Codex as PR reviewers - what they catch and what they miss

On this page

Before any human looks at my PR, two tools already have. One checks the diff for type errors, missing null checks, and edge cases the tests didn't cover. The other looks at whether the implementation actually matches what the PR description says it does.

Sometimes they catch real issues. Sometimes they flag things that don't matter. Either way, by the time a human sees the code, the mechanical first pass is already done.

The two tools: Cursor BugBot for PR review in Cursor workflows, and Codex on GitHub as an automatic PR reviewer.

Cursor BugBot

BugBot reviews pull requests in Cursor workflows and posts actionable review feedback. It's particularly good at:

  • Catching TypeScript type errors that the compiler misses (logic errors that are type-safe but wrong)
  • Identifying missing null checks and undefined access patterns
  • Spotting inconsistencies between the implementation and the surrounding code style
  • Flagging potential performance issues (unnecessary re-renders, missing memoization, N+1 queries)

The workflow: make your changes and open the PR. BugBot can review automatically on each PR update; when you need a manual pass, comment cursor review or bugbot run on the PR. Fix the useful findings, dismiss the noise, then request human review. By the time a human sees the code, much of the mechanical first pass is already resolved.

Codex on GitHub

Codex as a GitHub reviewer can run on every PR and post review comments automatically when automatic reviews are enabled. Request a review by mentioning @codex review in a PR comment, or enable automatic reviews to cover every PR. Review guidelines can be customized via an AGENTS.md file in the repository. It's useful for:

  • Checking that the implementation matches the PR description
  • Identifying missing test coverage for the changed code
  • Catching security issues (exposed secrets, SQL injection patterns, missing auth checks)
  • Verifying that error handling is consistent with the rest of the codebase

Both review the PR diff with repository-specific guidance. Codex follows applicable AGENTS.md instructions, while BugBot follows its repository rules and applicable .cursor/BUGBOT.md files. Either can use that context to catch inconsistencies with nearby patterns; the practical difference is which review workflow and configuration your team already uses.

What AI review actually catches

The most valuable catches I've seen:

  • Off-by-one errors in pagination — the kind that only show up when you're on the last page
  • Missing edge cases in input validation — empty strings, null values, negative numbers
  • Race conditions in async code — especially in React useEffect cleanup
  • Subtle breaking changes — changing a function signature in a way that's technically backward compatible but breaks callers

What it gets wrong

AI review produces false positives. Common ones:

  • Flagging intentional patterns as bugs (not enough context to know it's intentional)
  • Suggesting refactors that aren't in scope for the PR
  • Missing bugs that require understanding the business logic (the model doesn't know what the code is supposed to do)

Think of it as a fast, cheap first pass. Catches mechanical bugs well. Not a substitute for a human reviewer who understands the product.

Workflow Recipe

Copy-pasteable flows and guided workflow finder

Pick a workflow

Prompt

I need to build [feature]. Here’s the spec: inputs, outputs, edge cases, constraints. Produce a plan before writing any code.

Steps

1

Spec

Write a developer spec with inputs, outputs, edge cases, and constraints.

2

Plan

Ask the model to produce a plan — files to create/modify, key decisions. Review before coding.

3

Code

Implement against the plan. One feature, one PR. Pull the model back if it goes out of scope.

4

Review

Ask the model to review its own code: "What edge cases might this miss? What would break this?"

5

Tests

Generate tests from the review’s edge cases: "Write tests for the edge cases you identified."

6

PR description

Generate the PR description from the spec and the diff. Full context produces clear descriptions.

Tools

CursorClaude CodeGitHub Actions

Guardrails

  • One feature, one PR — keep scope tight
  • Review the plan before writing code
  • Don’t let the model touch files outside scope
  • Ask before refactoring adjacent code

Expected output

Working PR with passing CI, clear description, and tests covering the identified edge cases.

Paste into CLAUDE.md, .cursor/rules/, or your workflow docs