Run automated code review as a closeout check before committing or shipping. Works across multiple AI coding agents.
Use when:
- user asks for code review / review-it / autoreview
- after non-trivial code edits, before final/commit/ship
- reviewing a local branch or PR branch after fixes
Supported Agents
| Agent | Review Command | Notes |
|---|---|---|
| Claude Code | /review |
Built-in, works on uncommitted changes or diff |
| Codex | codex review |
Pass diff file or let it auto-detect |
| OpenCode | /review |
Same as Claude Code |
| DeepSeek TUI | /review or manual diff review |
Pass diff content for analysis |
| Antigravity CLI | /code-review |
Built-in slash command, auto-detects diff |
Contract
- Treat review output as advisory. Never blindly apply it.
- Verify every finding by reading the real code path and adjacent files.
- Read dependency docs/source/types when the finding depends on external behavior.
- Reject unrealistic edge cases, speculative risks, broad rewrites, and fixes that over-complicate the codebase.
- Prefer small fixes at the right ownership boundary; no refactor unless it clearly improves the bug class.
- Keep going until review returns no accepted/actionable findings.
- If a review-triggered fix changes code, rerun focused tests and rerun review.
- Stop as soon as the review comes back clean with no actionable findings.
- If rejecting a finding as intentional/not worth fixing, add a brief inline code comment only when it explains a real invariant or ownership decision that future reviewers should know.
- Do not push just to review. Push only when the user requested push/ship/PR update.
Review Focus
Please review the current diff. Do not just look at syntax and obvious bugs; focus on checking the following dimensions, and finally sort by severity:
- Hidden Side Effects — Does the change produce cascading effects in non-obvious places? Does it modify shared state, global variables, or the behavior of external dependencies?
- Breaking Compatibility — Does it change API signatures, data structures, configuration file formats, or command-line interfaces? Will existing callers be affected?
- Edge Cases — Are null/empty values/empty collections, extremely large/small values, concurrency/race conditions, and exception paths handled correctly?
- Performance Risks — Does it introduce unnecessary nested loops, N+1 queries, large object allocations, blocking I/O, or lock contention?
- Security Risks — Are there injection, privilege escalation, sensitive information leakage, insecure deserialization, or dependency version vulnerabilities?
- Naming Misleading — Are variable/function/type names inconsistent with actual behavior? Are there names that are misleading or semantically ambiguous?
- Insufficient Testing — Are critical paths, boundary conditions, and error handling lacking test coverage? Do existing tests truly verify the expected behavior?
- Future Maintenance Cost — Does it introduce unnecessary abstractions, duplicated code, implicit coupling, or control flow that is difficult to trace? Is it easy for later maintainers to understand and modify?
Pick Target
Claude Code / OpenCode / DeepSeek TUI
Dirty local work (default — /review works on uncommitted changes):
/review
Branch/PR work — review all changes against base:
First generate a diff, then review it:
git diff origin/main...HEAD > /tmp/review-it.diff
Then review the diff file with a focused prompt:
/review the changes in /tmp/review-it.diff against origin/main
If an open PR exists, use its actual base:
base=$(gh pr view --json baseRefName --jq .baseRefName)
git diff "origin/$base"...HEAD > /tmp/review-it.diff
Antigravity CLI (agy)
Dirty local work:
/code-review
Branch/PR work — review all changes against base:
git diff origin/main...HEAD > /tmp/review-it.diff
Then pass the diff to the review command:
/code-review the changes in /tmp/review-it.diff against origin/main
If an open PR exists, use its actual base:
base=$(gh pr view --json baseRefName --jq .baseRefName)
git diff "origin/$base"...HEAD > /tmp/review-it.diff
Codex
# Review uncommitted changes
codex review
# Review branch diff
git diff origin/main...HEAD > /tmp/review-it.diff
codex review /tmp/review-it.diff
Parallel Closeout
Format first if formatting can change line locations. Then it's OK to run tests and review in parallel:
scripts/review-it --parallel-tests "<focused test command>"
Tradeoff: tests may force code changes that stale the review. If tests or review lead to code edits, rerun the affected tests and rerun review until no accepted/actionable findings remain.
Uncommitted vs Branch Review
Choose the right mode:
- Uncommitted changes (staged/unstaged): use
/reviewdirectly (Antigravity:/code-review, Codex:codex review) - Committed, not pushed: use
git diff origin/main...HEAD+ review - Pushed/PR: same as committed, against the PR base
- Clean working tree: skip review if there's truly nothing to review
Helper
Bundled helper script for parallel test + review orchestration:
~/.claude/skills/review-it/scripts/review-it --help
The helper:
- Detects which agent is running (Claude Code, Antigravity CLI, Codex) via
--agent auto - Detects whether to use uncommitted review or branch diff review
- For branch mode: generates diff against
origin/main(or PR base), then triggers review - Supports
--parallel-testsfor concurrent test + review execution - Supports
--dry-runfor checking what command would be used - Prints
review-it clean: no accepted/actionable findings reportedwhen review is clean
Final Report
Include:
- review target (uncommitted / branch / PR base)
- tests/proof run
- findings accepted/rejected, briefly why
- the clean review result, or why a remaining finding was consciously rejected
Do not run another review solely to improve the final report wording. If review exited clean with no actionable findings, report that as clean.