Review Lens
Code review with anti-hallucination diff annotation and confidence-scored findings, in two modes — a fast walkthrough-plus-findings pass by default, or a multi-material fan-out on demand. Runs before a pull request: the report goes to the chat, with optional fix application and a saved report.
Triggers
- Quick review (default — "review", "review my changes", "check my diff", "review against main") → run the workflow below
- Deep review ("deep review", "full review", "thorough review") → run it in deep mode
- Re-review ("re-review", "check fixes", "are the issues resolved") → run it against the prior findings
Workflow
Start immediately when triggered. No confirmation needed to begin.
- Load common.md — the diff annotation algorithm, the size gate, the confidence rubric, what not to report, the output template, the fix-suggestion rules, and the data trust boundary. Both modes apply it in full.
- Set up. Run
git status --porcelain: review the working directory when it has uncommitted changes, otherwise compare the current branch against the base the user names, else main. Capture the diff and changed files, annotate every added line with its [L<n>] marker, and apply the size gate before going further.
- Pick the mode. Default to quick and load quick-review.md. Load deep-review.md only when the user asks for depth or the change is risky or wide-reaching — it fans out by material, at higher cost.
- Load guidelines-audit.md for the guideline-compliance portion, whichever mode ran.
- Assemble and output. Render the loaded template, sorted by severity. On a re-review, mark each prior finding
fixed, persisting, or regressed and output the status table first. Print to the terminal, offer to save CODE_REVIEW.md, then offer to apply the suggested fixes.
Guidelines
- Annotate the diff with
[L<n>] markers before reviewing — the line allowlist is the anti-hallucination guard in both modes
- Only report findings with confidence >= 80
- Default to quick; reserve the deep fan-out for risky or wide diffs
- Guideline discovery reads the project's files — including
.claude/rules/*.md — never ~/.claude (personal global settings)
- Suggest fixes freely (they are text); apply to the working tree only with explicit confirmation
- The review runs pre-PR — output goes to the chat (and optional
CODE_REVIEW.md), never posted to a pull request
Anti-Pattern: Confidence Inflation
Reporting findings below 80 confidence buries real issues under noise. The rubric is calibrated: <80 means speculation or style preference, not a real bug. When unsure, drop down — gather more context, re-read the diff — instead of pushing a low-confidence finding through.
1---2name: review-lens3description: Code review in quick and deep modes, with confidence-scored findings. Use for diff review, guideline audits, re-reviewing fixes, or applying findings before a pull request. Not for markdown or prose review, acceptance-criteria verification, visual design review, or commit and branch mechanics.4---56# Review Lens78Code review with anti-hallucination diff annotation and confidence-scored findings, in two modes — a fast walkthrough-plus-findings pass by default, or a multi-material fan-out on demand. Runs before a pull request: the report goes to the chat, with optional fix application and a saved report.910## Triggers1112- **Quick review** (default — "review", "review my changes", "check my diff", "review against main") → run the workflow below13- **Deep review** ("deep review", "full review", "thorough review") → run it in deep mode14- **Re-review** ("re-review", "check fixes", "are the issues resolved") → run it against the prior findings1516## Workflow1718Start immediately when triggered. No confirmation needed to begin.19201. **Load [common.md](references/common.md)** — the diff annotation algorithm, the size gate, the confidence rubric, what not to report, the output template, the fix-suggestion rules, and the data trust boundary. Both modes apply it in full.212. **Set up.** Run `git status --porcelain`: review the working directory when it has uncommitted changes, otherwise compare the current branch against the base the user names, else `main`. Capture the diff and changed files, annotate every added line with its `[L<n>]` marker, and apply the size gate before going further.223. **Pick the mode.** Default to quick and load [quick-review.md](references/quick-review.md). Load [deep-review.md](references/deep-review.md) only when the user asks for depth or the change is risky or wide-reaching — it fans out by material, at higher cost.234. **Load [guidelines-audit.md](references/guidelines-audit.md)** for the guideline-compliance portion, whichever mode ran.245. **Assemble and output.** Render the loaded template, sorted by severity. On a re-review, mark each prior finding `fixed`, `persisting`, or `regressed` and output the status table first. Print to the terminal, offer to save `CODE_REVIEW.md`, then offer to apply the suggested fixes.2526## Guidelines2728- Annotate the diff with `[L<n>]` markers before reviewing — the line allowlist is the anti-hallucination guard in both modes29- Only report findings with confidence >= 8030- Default to quick; reserve the deep fan-out for risky or wide diffs31- Guideline discovery reads the project's files — including `.claude/rules/*.md` — never `~/.claude` (personal global settings)32- Suggest fixes freely (they are text); apply to the working tree only with explicit confirmation33- The review runs pre-PR — output goes to the chat (and optional `CODE_REVIEW.md`), never posted to a pull request3435## Anti-Pattern: Confidence Inflation3637Reporting findings below 80 confidence buries real issues under noise. The rubric is calibrated: <80 means speculation or style preference, not a real bug. When unsure, drop down — gather more context, re-read the diff — instead of pushing a low-confidence finding through.