review_code
Get an independent code review of your git diff before committing. Pass the raw diff to receive a structured verdict and findings that catch bugs and improve code quality.
Instructions
Get an independent code review of your changes before committing. Call this after writing or modifying code. Pass a git diff as input. The diff parameter MUST contain actual git diff output (from git diff, gh pr diff, etc.), NOT a summary or description of changes. To review a branch or landed commits, pass base (and optionally head) instead and the bridge runs git diff base head in cwd. If you reviewed a plan first, pass the same session_id so the reviewer checks the code against the plan. Returns a verdict, findings, responding models, and persistence provenance. An auto-captured review also returns captured_from: the absolute directory the bridge ran git in. If that is not the repository you are working in, pass the diff explicitly.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute path to the directory this review runs in — the repository or git worktree whose code is being reviewed. Auto-capture, repository instruction files, and the reviewer subprocess all use it. Always pass it: an auto-capturing review without it is refused unless the server is configured with "require_cwd": false, in which case the server's launch directory is used. Must be absolute; "~" is not expanded. Applies to this call only — pass it again on resume. | |
| base | No | Review a committed range instead: the ref to diff FROM (e.g. "main", "origin/main", a commit, or "HEAD~1"). Runs git diff <base> <head> in cwd. Cannot be combined with diff. | |
| diff | No | Raw git diff output to review. Must be unified diff format (output of git diff, gh pr diff, etc.). Do NOT pass summaries or descriptions. If omitted, auto-captures changes via git diff HEAD. | |
| head | No | The ref to diff TO when base is given (default: "HEAD"). Requires base. | |
| model | No | Override the configured default model for this call (e.g., "gpt-5.6-sol"), or "latest". Or pick a tier instead of a model id: "max" (hardest problems — architecture, concurrency, security, subtle bugs), "balanced" (everyday review), or "fast" (small diffs, precommit sanity, quick iteration). Tiers map per provider (Codex: gpt-6-astra / gpt-5.6-sol / gpt-5.6-luna; Gemini: 3.1 Pro (High) / 3.8 Flash (High) / 3.8 Flash (Medium)) and survive failover. May be combined with session_id to change model mid-session; without it a resumed session keeps the model it was recorded with. Compare returned resolved and observed labels for runtime changes. | |
| context | No | Intent of the changes | |
| criteria | No | Review criteria to focus on | |
| auto_diff | No | Auto-capture working tree changes (staged + unstaged) via git diff HEAD | |
| deliberate | No | Per-call override of the configured review mode: true = both providers review (deliberation); false = single provider with failover. Omit to use the configured mode. Requires a two-provider setup; requesting deliberation under a single-provider config returns an error. Under deliberate-deep, the returned verdict reflects both providers' independent reviews and is NOT recomputed from cross-review adjudications — treat deliberation.divergent[].adjudication as advisory input for your own synthesis. | |
| session_id | No | Continue from previous review |