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.
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.
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.
How to use
- Copy the checklist into your code review process:
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.
Example
Full Checklist
AI-Specific Checks
- [ ] Verify every import exists:
pip install <package>ornpm 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
Related on TokRepo
- AI Tools for Testing -- Automated testing tools to complement code review
- AI Tools for Coding -- AI coding assistants that generate the code you review
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
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.
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.
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.
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.
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)
- Anthropic AI Safety Docs— AI code review requires checking for hallucinated imports and phantom APIs
- Google Engineering Practices— Code review best practices for AI-generated code
- Stanford HAI Research— Common pitfalls in LLM-generated code
Related on TokRepo
Source & Thanks
Compiled from production experience reviewing thousands of AI-generated PRs. > > Share this checklist with your team to improve AI code quality.