code-review — Claude Code subagent: PR review via GitHub CLI
code-review — a subagent for Claude Code that reviews a pull request through gh and posts a comment listing confirmed bugs. Skips closed, draft, or already-reviewed PRs without prompting.
no license ★ 406 updated 2026-06-25
.claude/agents/code-review.mdWhat code-review does
The subagent breaks the review into stages. Three Haiku agents first check whether the PR is worth reviewing at all — closed, draft, automated, or already seen. Then five Sonnet agents run in parallel, each taking a different angle: CLAUDE.md compliance, shallow bug scan, git blame history, comments from earlier PRs on the same files, and code comments in the modified files.
Every candidate issue gets a confidence score from 0 to 100. Only issues scoring 80 or above reach the final comment. That threshold filters out linter-level nitpicks, pre-existing bugs, and intentional functional changes — things a senior engineer would skip.
The comment includes a short bug description, a direct link to the line with the full commit SHA, and a quote from CLAUDE.md when the violation traces there. Build and type-checking are out of scope: the subagent assumes CI handles those separately. The gh CLI must be installed with read access to PRs and write access to comments.
What it helps with
- catch bugs in a pull request without manually reading the diff
- verify changes against project
CLAUDE.mdrules - filter false positives using a per-issue confidence threshold
- post a review comment with links to exact lines and commit SHAs
- skip draft, closed, or already-reviewed PRs automatically
Example prompts for the agent
- Review pull request #42 for bugs
- Check PR #17 against
CLAUDE.mdand flag any issues - Run code-review on the latest open PR in this repo
How to install code-review
Manually: put the files in place
.claude/agents/code-review.mdFor all projects use ~/.claude/agents/. Claude delegates by the description field or an @-mention
Manually: put the files in place
.codex/agents/code-review.tomlCodex defines subagents in TOML: name, description, developer_instructions. Move the Markdown text into developer_instructions by hand. For all projects use ~/.codex/agents/
Manually: put the files in place
.cursor/agents/code-review.mdCursor also reads .claude/agents/
Step by step, with commands for each platform: Claude Code subagents: how to create one, call it and keep context clean
Questions about code-review
How do I install code-review in Claude Code?
Create the file .claude/agents/code-review.md in your repository root. Claude Code picks it up automatically from there.
What does the code-review subagent do?
It runs several parallel agents to check a PR for bugs, CLAUDE.md compliance, and historical context, then scores each finding and posts only those with a confidence of 80 or higher.
What does the subagent need to work?
The gh CLI must be installed with permissions to read PRs and write comments. The subagent routes all GitHub interaction through it.