A Claude Code plugin that uses GitHub Copilot as the backend for code reviews and task delegation.
- Node.js 20.0+
- GitHub Copilot subscription (Individual or Business)
- GitHub Personal Access Token with
copilotscope - Claude Code with plugin support
- GitHub CLI (
gh) -- required only for PR review mode (--pr). Install from https://cli.github.com and authenticate withgh auth login.
claude plugin install zircote/copilot-reviewOr clone and link locally:
git clone https://github.com/zircote/copilot-review.git
cd copilot-review
npm installSet a GitHub token with Copilot access. The plugin checks these environment variables in order:
COPILOT_GITHUB_TOKEN(preferred)GH_TOKENGITHUB_TOKEN
export COPILOT_GITHUB_TOKEN=ghp_xxxxxxxxxxxxVerify your setup:
/copilot-review:setup/copilot-review:review [<range>] [--pr <ref>] [--staged] [--base <ref>] [--head <ref>] [--files <glob>]
Run a Copilot-powered code review on a git diff. The command supports several diff source modes, described below.
Reviews uncommitted changes in the working tree.
/copilot-review:reviewReviews only staged (indexed) changes.
/copilot-review:review --stagedReviews a GitHub pull request diff fetched via the gh CLI. Requires gh to be installed and authenticated.
/copilot-review:review --pr 42
/copilot-review:review --pr '#42'
/copilot-review:review --pr owner/repo#42
/copilot-review:review --pr https://github.com/owner/repo/pull/42When owner/repo is omitted, the plugin detects the repository from the origin remote.
Pass a range as the first positional argument. Supports three-dot (merge-base) and two-dot (direct) syntax, with partial forms.
| Format | Meaning |
|---|---|
sha1...sha2 |
Three-dot merge-base diff |
sha1..sha2 |
Two-dot direct diff |
...sha2 |
HEAD...sha2 (merge-base) |
sha1... |
sha1...HEAD (merge-base) |
sha1 |
Bare ref, treated as sha1...HEAD |
/copilot-review:review abc123...def456 # Three-dot range (merge-base)
/copilot-review:review abc123..def456 # Two-dot range (direct diff)
/copilot-review:review ...feature-branch # Changes on feature-branch since divergence
/copilot-review:review v1.0.0 # Changes since v1.0.0 tagSame as range mode, using named flags instead of positional syntax. Uses three-dot (merge-base) diff.
/copilot-review:review --base v1.0.0 # Changes since v1.0.0
/copilot-review:review --base main # Branch changes vs main
/copilot-review:review --base abc123 --head def456 # Specific commit rangeAny mode can be combined with --files to restrict the diff to specific paths.
/copilot-review:review --files src
/copilot-review:review --staged --files "src/**/*.js"
/copilot-review:review --base main --files "lib,tests"/copilot-review:adversarial-review [<range>] [--pr <ref>] [--staged] [--base <ref>] [--head <ref>] [--files <glob>]
Run an adversarial security-focused review. Accepts the same options and modes as review. Uses a stricter prompt that prioritizes vulnerability detection and requires a minimum of 3 findings.
/copilot-review:adversarial-review --staged
/copilot-review:adversarial-review --pr 42
/copilot-review:adversarial-review --base main --files "src/**/*.js"/copilot-review:task <prompt...>
Delegate a coding task to Copilot.
/copilot-review:task Explain the authentication flow in this project
/copilot-review:task Suggest refactoring opportunities in src/lib/Reviews and tasks run as tracked jobs. Use these commands to inspect and manage them.
/copilot-review:status # Jobs from the current Claude session
/copilot-review:status --all # All jobs across sessions/copilot-review:result <job-id> # Display the full result of a completed job/copilot-review:cancel <job-id> # Cancel a running job/copilot-review:setup # Verify GitHub Copilot auth and SDK connectivityLarge diffs (over 100KB) are automatically split by file and reviewed in chunks. The plugin:
- Splits the unified diff into per-file hunks.
- Groups files into chunks targeting ~80KB each. Files larger than the target get their own chunk (never split mid-file).
- Reviews each chunk in a separate Copilot session.
- Merges the results into a single consolidated review.
Progress is reported to stderr as each chunk completes. No user action is required -- chunking is transparent.
Reviews return structured results with:
- Verdict:
approve,request_changes, orcomment - Summary: High-level description of the review findings
- Findings with severity levels:
| Severity | Meaning | Action |
|---|---|---|
critical |
Bugs, security vulnerabilities, data loss risks | Must fix before merge |
warning |
Performance issues, API misuse, missing error handling | Should fix |
suggestion |
Style improvements, naming, idiomatic patterns | Nice to have |
nitpick |
Minor formatting and trivial choices | Informational |
The plugin uses @github/copilot-sdk to create Copilot sessions with customized system prompts that instruct the model to return structured JSON reviews. Diffs are inlined in the prompt text.
Response parsing uses a 3-layer strategy:
- JSON fence extraction -- Extracts JSON from ```json code fences
- Retry -- Sends a follow-up prompt demanding JSON-only output (max 1 retry)
- Prose fallback -- Wraps raw text as a review comment if JSON parsing fails
npm test # Run all tests
npm run test:coverage # Run with coverage reporting
npm run lint # Run Biome linting
npm run format:check # Check formattingSet one of: COPILOT_GITHUB_TOKEN, GH_TOKEN, or GITHUB_TOKEN. The token needs copilot scope. Create a fine-grained PAT at https://github.com/settings/tokens.
- Verify your token is valid and not expired.
- Ensure you have an active GitHub Copilot subscription.
- Check that
@github/copilot-sdkis installed:npm install.
The --pr flag accepts these formats: 42, #42, owner/repo#42, or a full GitHub PR URL. Other formats are rejected.
The --pr mode uses gh api to fetch PR diffs from GitHub. Install the GitHub CLI from https://cli.github.com and run gh auth login.
The response parsing fell through to prose fallback. This happens occasionally -- re-run the review for structured output. Keep diffs focused (smaller diffs get better JSON compliance).
The plugin uses @github/copilot-sdk@^0.2.1. If you encounter protocol errors, ensure you're on a compatible version: npm ls @github/copilot-sdk.
- Non-deterministic -- Same diff may produce different reviews on subsequent runs.
- No streaming -- Reviews return complete results, not incremental.
- No inline annotations -- Findings reference file:line but do not integrate with IDE diff views.
- No incremental review -- Each review is a fresh session. Copilot does not carry context between reviews.
This is a clean-room implementation inspired by the architecture of openai/codex-plugin-cc. No code was copied -- only the plugin's public architecture was referenced. The backend was replaced with GitHub Copilot via @github/copilot-sdk.
- SDK over raw ACP --
@github/copilot-sdkabstracts the JSON-RPC protocol and manages subprocess lifecycle. Raw ACP broke in Feb 2026 when--headlesswas removed. - Clean-room -- References only public Copilot SDK docs and the Codex plugin's architecture (not source). No Apache-2.0 obligations.
- Prompt-engineered reviews -- Copilot has no
review/startAPI. Reviews usesession.sendAndWait()with customized system prompts (SDK v0.2.xcustomizemode) requesting structured JSON output. - Multi-layer response parsing -- JSON fence extraction, retry with stricter prompt, prose fallback.
MIT