Skip to content
OverKnightsOverKnights home

The AI code review checklist for code written by Cursor, Claude Code and Copilot

A practical, ID-based checklist for reviewing AI-generated code: security, correctness, AI drift, dependencies, performance and framework traps.

OverKnightsPublished 4 min read
Short answer

Review AI-generated code against the weaknesses assistants actually produce, not a generic style guide. Check authorisation and input validation on every server entry point, look for swallowed errors and floating promises, confirm every import and API exists in your installed versions, reject tests that assert nothing, search for placeholder logic, and verify every new dependency. Run scanners first so humans only review what tools cannot judge.

  • Generic review checklists miss the failure modes that are specific to AI assistants.
  • Order matters: scanners first, then a focused read of the diff, then verification of anything serious.
  • Give every check a stable ID so findings, rules and training all point at the same thing.

Most code review checklists were written for people. They ask about naming, structure and test coverage. Those still matter, but they miss the failure modes that come from assistants: the authorisation check that was never generated, the import that does not exist in your version, the test that passes because it tests nothing.

This checklist is built for code written with Cursor, Claude Code, Copilot and similar tools. Each item has a stable ID from the OverKnights checklist, so a finding in a pull request, a rule in your AI tool settings and a line in a report all refer to the same thing.

How to run the review

  1. Scanners first. Secret scanning, dependency scanning, type checking and lint run before anyone reads the code. Do not spend human attention on what a tool can decide.
  2. Read the diff, not the repo. Review what changed and what it makes reachable. A new route matters more than a renamed variable.
  3. Verify before you file. For anything High or Critical, read the surrounding code and confirm the issue is real. One false alarm costs more trust than three real findings earn.

Security checks

IDCheckAsk
SEC-01SecretsIs any key, token or connection string in the code or config?
SEC-02AuthorisationDoes every route, action and RPC check that this caller may act on this record?
SEC-03Data accessAre admin keys kept off the client, and is row-level security on?
SEC-04InjectionAre queries parameterised?
SEC-05ValidationIs every server input parsed with a schema?
SEC-08HTMLIs user content rendered without escaping anywhere?
SEC-09TokensAre JWTs verified, not just decoded?
SEC-12WebhooksIs every webhook signature verified before use?

The two that matter most are SEC-02 and SEC-05. Assistants generate handlers that work for the person testing them. They rarely generate the check that stops a different person from doing the same thing to someone else's data. See missing authorisation in server actions for the patterns.

Correctness checks

  • COR-01 Swallowed errors. Any empty catch, or a catch that logs and returns success?
  • COR-02 Floating promises. Any forEach(async ...), or a promise that is never awaited?
  • COR-03 Silent fallbacks. Does a default value hide a failure the user should see?
  • COR-04 Races. Is there a read, a decision and a write without a transaction?
  • COR-06 Money. Are amounts stored as integers in minor units, or as decimals in the database?
// COR-02: looks fine, returns before any user is synced
users.forEach(async (u) => {
  await pushToCrm(u)
})

// Correct
await Promise.all(users.map((u) => pushToCrm(u)))

AI drift checks

These are the checks that only exist because many AI sessions write one codebase.

  • AID-01 Hallucinated APIs. Does every import, method and config key exist in the version in your lockfile? Check the installed package, not the docs you remember.
  • AID-04 Competing patterns. Is this the third HTTP client, the second date library, a new store for state that already has one?
  • AID-05 Empty tests. Do the tests fail if the code is wrong? Mocks of the unit under test and assertions on constants do not count.
  • AID-06 Placeholders. Search the diff for return true, TODO, mock, fake, sample and hard-coded IDs.
  • AID-07 Silenced compiler. New any, as unknown as, @ts-ignore or eslint-disable?

Dependency checks

  • DEP-01 Does the new version have known vulnerabilities?
  • DEP-02 Does the package exist, is the name exactly right, and does it have a real maintainer and download history?
  • DEP-04 Does it duplicate a library you already use?

The second check deserves care. Assistants can suggest plausible names that were never published, and attackers register them. Read slopsquatting and hallucinated packages for the defence.

Performance checks

  • PERF-01 Any query inside a loop?
  • PERF-02 Any query without a limit?
  • PERF-03 Any server-only module imported into client code?

Turn the checklist into rules

Every recurring finding should become one line in your AI tool instructions. If SEC-02 shows up twice in a month, add a rule that every server action must authorise the caller against the record. Rules lower the rate of new findings; review catches the rest.

What to do with the results

File each confirmed finding as an issue with the ID, the file and line, the evidence, and a fix prompt your coding agent can run. Track counts by ID over time. If a pattern keeps returning, the fix is a rule or a shared helper, not another comment.

If you want this run every night across your repositories, with verified findings filed by morning, that is what we do. Start with a free sample on a public repo.

Frequently asked questions

How long should a review of AI-generated code take?

Less than you think if scanners run first. The human or AI reviewer then reads only the diff against a short list of high-impact checks, instead of reading every line for everything.

Should we review AI code differently from human code?

The bar is the same, the focus is different. People make typos and logic slips. Assistants skip checks, invent APIs and repeat patterns, so the checklist should weight those.

Can an AI review AI-generated code?

Yes, as a first pass, if it works from a precise checklist and every serious finding is verified with surrounding context. Unverified AI review produces too much noise to trust.

OverKnights

Want to know what your repo would show?

Send one public repo. We reply with three verified findings and the prompts to fix them. No call needed.