PromptsApr 6, 2026·2 min read

AI Code Review Checklist — Ship Better with AI Help

Structured checklist for reviewing AI-generated code before merging. Covers correctness, security, performance, maintainability, and AI-specific pitfalls like hallucinated imports and phantom APIs.

TL;DR
A structured checklist for reviewing AI-generated code covering correctness, security, performance, and AI-specific pitfalls like phantom APIs.
§01

What it is

This is a structured checklist for reviewing code generated by AI assistants before merging it into production. It covers standard code review concerns (correctness, security, performance, maintainability) plus AI-specific pitfalls: hallucinated imports, phantom APIs that do not exist, outdated library versions, and subtle logic errors that compile but do not work.

The checklist targets any developer who uses AI coding tools and wants a systematic way to catch issues before they reach production.

§02

How it saves time or tokens

AI-generated code often looks correct at first glance but contains subtle issues: imports for packages that do not exist, API calls using deprecated parameters, or test assertions that always pass. A structured checklist catches these systematically rather than relying on intuition.

The estimated token cost for this workflow is approximately 2,800 tokens. The checklist is reusable across projects and AI tools.

§03

How to use

  1. Copy the checklist into your code review process:
§04

AI Code Review Checklist

Correctness

  • [ ] Code compiles/runs without errors
  • [ ] All tests pass (existing + new)
  • [ ] No hallucinated imports or packages
  • [ ] API calls use valid, current parameters

Security

  • [ ] No hardcoded secrets or credentials
  • [ ] Input validation on all user-facing endpoints
  • [ ] SQL queries use parameterized statements

Performance

  • [ ] No unnecessary loops or redundant queries
  • [ ] Database queries use appropriate indexes
  • [ ] No memory leaks in long-running processes

2. Run through the checklist for every AI-generated PR.

3. Customize with project-specific checks.
§05

Example

§06

Full Checklist

AI-Specific Checks

  • [ ] Verify every import exists: pip install <package> or npm install <package>
  • [ ] Check API signatures against official docs (AI may use outdated versions)
  • [ ] Look for 'phantom functions' -- methods that sound right but do not exist
  • [ ] Verify test assertions are meaningful (not assert True)
  • [ ] Check for copy-paste artifacts from training data

Maintainability

  • [ ] Code follows project conventions (naming, structure)
  • [ ] Comments are accurate (AI comments often describe what code should do, not what it does)
  • [ ] No unnecessary abstractions or over-engineering
  • [ ] Error messages are helpful for debugging
§07

Related on TokRepo

§08

Common pitfalls

  • Do not skip the checklist for 'simple' changes. AI makes the most insidious errors in straightforward code where reviewers let their guard down.
  • Phantom APIs are the hardest to catch visually. Always verify imports and function calls against official documentation.
  • AI-generated tests can give false confidence. Check that assertions actually test meaningful behavior, not just that the function runs without crashing.

Frequently Asked Questions

What are hallucinated imports?+

When AI generates code that imports a package or module that does not exist. The import statement looks plausible but the package is fictional. This causes runtime errors that are not caught by linters alone.

Should I use this checklist for all code or just AI-generated code?+

The checklist is designed for AI-generated code, but the correctness, security, and performance sections apply to any code review. The AI-specific section (phantom APIs, hallucinated imports) is unique to AI-generated code.

How do I detect phantom APIs?+

Check every function call against the official documentation for the library version you use. Pay special attention to optional parameters and return types. AI models trained on older data may reference APIs from previous library versions.

Can AI help review AI-generated code?+

Yes, but with limitations. A second AI pass can catch some issues, but AI reviewers can have the same blind spots as AI generators. Human review remains essential for catching hallucinations and verifying business logic.

How often should I update this checklist?+

Review and update quarterly. As AI tools improve, some categories of errors become less common while new patterns emerge. Track the types of bugs that slip through and add corresponding checks.

Citations (3)
🙏

Source & Thanks

Compiled from production experience reviewing thousands of AI-generated PRs. > > Share this checklist with your team to improve AI code quality.

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.