Run Claude Code Review
claude_code_reviewRuns a parallel code review over a repository, PR, branch, working directory, or last commit and returns a markdown report with confidence-scored findings; optionally applies fixes to files.
Instructions
Run Claude Code's code-review skill (a diff-sized fleet of parallel reviewer subagents, 0-100 confidence scoring, keeps findings >=75). Every finished reviewer subagent's report is captured the moment it lands — appended to a durable JSONL file and visible via claude_review_status while the run continues — and an agent killed mid-flight (e.g. a 429) is recovered from its output_file transcript, so a rate limit never wastes the work already paid for. on a repository and return the markdown report. Costs Claude API credits; a run typically takes 2-15 minutes. Afterwards, fix the code and re-run to verify, or use claude_review_followup with the returned session_id.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pr | No | GitHub PR number or URL, e.g. "123" or "owner/repo#123" (for scope=pr, or as first choice in auto) | |
| fix | No | Fix mode: after the report, Claude Code edits the repo files to fix the confirmed findings (Edit only, no git commands, no commit; .git and secret paths are deny-listed). Adds a '## Fixes Applied' section. | |
| focus | No | Extra review focus or instructions, e.g. '重点看并发安全' | |
| model | No | Claude model override (passed as --model) | |
| scope | No | auto: PR if pr given / branch ahead of baseRef (when given) or the default branch / working-dir changes / last commit | auto |
| effort | No | Review effort / reasoning level, same scale as Claude Code (--effort): low..max. Default max = exhaustive deep review (slower and pricier). Omit for the deepest default; pass low/medium for a fast, cheap pass. | max |
| baseRef | No | Base branch/tag for scope=branch and for scope=auto's branch step (default: auto-detect the default branch). A validated ref always reaches the reviewer — it is never silently dropped. | |
| maxTurns | No | Agentic turn cap for the review session | |
| pipeline | No | Which review engine runs. auto (default): claude's built-in /code-review command for levels low..high — it needs no file on disk; fix runs ride its own --fix flag. max (including effort=xhigh), scope=last-commit with no parent commit, and a shadowing code-review skill use the fleet pipeline. Only max uses the MCP's own fleet pipeline, because the built-in hands max to subagents whose exploration commands the locked-down permission mode denies. native: force the built-in command (refused when a same-named skill in the Claude config dir shadows it). fleet: force the fleet pipeline (its instructions travel in the prompt; nothing is installed). skill: legacy — use/optionally install the bundled skill (the only mode that may write to disk). | auto |
| postToPR | No | Also post the summary comment to a GitHub PR via gh. Requires a fully-qualified pr — "owner/repo#123" or a GitHub PR URL; a bare number is refused because gh would resolve it against the reviewed repository's remote (default false — report only). | |
| repoPath | Yes | Absolute path to the git repository to review (the review runs with cwd=repoPath; ~/ prefix allowed) | |
| ultracode | No | Enable claude's Ultracode mode for this run (the `ultracode` settings key): standing dynamic-workflow orchestration — every substantive step goes through the native Workflow tool, multi-agent and token-cost-no-object. Orthogonal to effort (any effort level). Requires a claude CLI that supports the key; older builds ignore it (see workflowRuns in the result). | |
| reviewLevel | No | The REVIEW's own depth level — the same argument claude's native /code-review command takes. The fleet has the same three-phase structure as the native playbook (finder -> one verifier per surviving candidate -> sweep), with these numbers (rendered from FLEET_NUMBERS in src/prompt.js): low = one pass, no subagents (<= 4 findings); medium/high = 8 finders (3 extra finders split briefs on top of the 5 briefs) x up to 6 candidates, findings capped at 8; max = 10 finders (every brief split) x up to 8 candidates + one verifier per surviving candidate + 1 sweep finder, findings capped at 15; at most 20 candidates reach verification. Defaults to a mapping of effort (max/xhigh->max, high->high, medium->medium, low->low). Separate knob from the CLI reasoning effort and from ultracode. | |
| maxBudgetUsd | No | API spend cap via --max-budget-usd. DEFAULT 0 = NO CAP at any effort level: a cap stops the parent before it synthesizes, and every finished subagent report is already captured incrementally (and recovered from output_file), so a 429/token exhaustion no longer wastes it. The wall-clock timeout (timeoutMinutes) is the guard. Set a number only if you want a hard spend stop; env CLAUDE_REVIEW_MAX_BUDGET_USD sets the DEFAULT for this argument (an explicit value here always wins). On third-party gateways this depends on usage data the gateway returns. | |
| waitForResult | No | Block until the review finishes and return the report synchronously (2-15 min). Default false: returns a jobId after a fast preflight — poll claude_review_status(jobId). Only set true if your MCP client has no ~30s tool-call timeout. | |
| outputLanguage | No | Language for the report, e.g. "中文" or "English" | 中文 |
| timeoutMinutes | No | Hard wall-clock timeout for the run — with no spend cap by default this is the guard; every finished subagent report is kept even when it fires | |
| installSkillIfMissing | No | Only meaningful with pipeline=skill: when the bundled skill is MISSING, install it into the Claude config dir (default false — a missing skill degrades to the inline fleet pipeline instead; a MANAGED existing copy is refreshed whenever it is about to be used; a user-managed copy is never touched). env CLAUDE_REVIEW_AUTO_INSTALL_SKILL=1 sets the default |