Powerful local pre-PR code review for your current git checkout.
code-reviewer reviews branch, staged, or file-scoped changes before you open a PR. It combines fast heuristics, Codex-backed review, pluggable rule packs, richer context loading, and recheck-aware reports.
- Reviews local changes against a base branch or staged diff
- Detects project signals for PHP, WordPress, JavaScript, React, Vue, and Laravel
- Applies built-in and custom rule packs
- Loads related context such as manifests, tool configs, nearby files, and likely tests
- Shows which changed files were model-reviewed and which were not
- Produces text, markdown, GitHub-style, or JSON reports
- Stores local recheck state so a second run can show cleared, remaining, and new findings
npm install
npm linkThen run from any git repository:
code-reviewer --helpThe old codex-review command is kept as an alias for compatibility.
Run this before creating or updating a GitHub pull request:
code-reviewer --base origin/development --engine codex --thoroughIf a repository uses another target branch, pass that branch explicitly:
code-reviewer --base origin/main --engine codex --thoroughRecommended workflow:
- Make your code changes
- Run the pre-PR review command
- Fix the findings
- Run the command again
- Open the GitHub PR when the report is clean enough
code-reviewer --base origin/development
code-reviewer --base origin/development --engine codex --thorough
code-reviewer --staged
code-reviewer --base origin/development --mode security --format markdown --report code-review.md
code-reviewer --base origin/development --review-depth exhaustive --engine codex
code-reviewer --fail-on mediumbalanced: model-review the top 12 changed filesthorough: model-review the top 24 changed filesexhaustive: attempt to model-review every non-generated changed file
When a review is narrowed, the report includes a Not Model-Reviewed This Run section so coverage is visible instead of silent.
Create .codex/reviewer.yml in the repository being reviewed:
base: origin/development
engine: auto
review_depth: thorough
max_findings: 15
rule_packs:
- id: payments
name: Payments
focus:
- payment amount, currency, webhook, and refund consistency
- idempotency and replay protection
checks:
- gateway callbacks must verify signatures before mutation
- payment totals must be checked against stored order totals
high_risk_paths:
- app/Payments/
- src/Payments/
related_globs:
- composer.json
- package.json
focus_areas:
- security
- regression
- compatibilityBuilt-in rule packs are auto-detected from changed files and project manifests. Custom rule packs let you teach code-reviewer your product-specific risks without editing the tool itself.
- Node.js 18+
git- Codex CLI installed and authenticated for model-backed review
Heuristic mode works without Codex:
code-reviewer --engine heuristic