Code review
How to run multi-agent code review locally and in CI, including GitHub PR integration.
ClosedLoop.ai's /code-review:start runs multi-agent, partitioned code review with deterministic hygiene, risk-based routing, and caching. It works on the current branch, on staged changes, on specific files, or on a GitHub PR.
Local branch review
claude /code-review:startReviews the current branch against main. Results land in .closedloop-ai/code-review/cr-<random>/.
Staged review
claude /code-review:start stagedReviews only what is currently staged. Useful before committing.
Specific files
claude /code-review:start path/to/file1.ts path/to/file2.tsPR review
claude /code-review:start 123Reviews PR #123. With --github, posts inline comments and a summary comment via gh and resolves outdated threads.
Flags
--github— CI handoff mode; posts to the PR.--hygiene-only— skip LLM review, run only deterministic checks.--base <ref>— override the base ref.--since-last-review— incremental review since the last cached review hash.--full-review— ignore the incremental cache.
What happens
- Hygiene — deterministic checks run first (file size, trailing whitespace, TODO density, etc.).
- Partitioning — the diff is split into partitions.
- Routing — each partition is routed to a model based on risk signals.
- Parallel review —
code-review-workersubagents run concurrently. - Collection — findings aggregate into
code-review-findings.json. - Validation — findings pass a Pydantic schema check.
- Summary —
code-review-summary.mdis written. - Verdict —
verdict.jsonreportsapprove,needs_attention, orchanges_requested.
GitHub integration
With --github:
- Inline comments post at the correct line and file.
- Outdated review threads are resolved automatically.
- A summary comment lands on the PR.
- Verdict is surfaced so CI can gate merges.
Caching
code-review caches results by diff hash. Re-running on the same diff is near-instant. --since-last-review supports incremental review on long-lived branches.
CI pattern
# github/workflows/code-review.yml (sketch)
- run: claude /code-review:start ${{ github.event.pull_request.number }} --githubCouple this with ClosedLoop.ai's judges reports on the plan and code, and you have a full grading pipeline for every PR.
When to run
- Locally, before committing (
stagedor default branch review). - In CI, on every PR (
<pr-number> --github). - Incrementally on large branches, to review only the new delta.
- In parallel with the
codeplugin's built-incode-revieweragent — they complement each other; the built-in reviewer gates implementation phases, while/code-review:startis for PR-level triage.