February 4, 2026
Select agents to install to:
npx add-skill https://github.com/in-the-loop-labs/pair-review/blob/main/plugin/skills/analyze/SKILL.md -a claude-code --skill analyzeInstallation paths:
.claude/skills/analyze/# Analyze Changes (Server-Side via MCP)
Perform a three-level code review analysis using pair-review's built-in analysis engine. Unlike the `code-critic:analyze` skill (which spawns analysis agents directly within the coding agent's context), this skill delegates all analysis work to the pair-review server via MCP tool calls. Use this skill when the pair-review MCP server is connected; use `code-critic:analyze` when it is not.
**Prerequisites**: The pair-review MCP server must be connected with the `start_analysis`, `get_ai_analysis_runs`, and `get_ai_suggestions` tools available.
## 1. Gather context
Determine what is being reviewed:
- **Local changes**: Run `git rev-parse HEAD` to get the HEAD SHA, and use the current working directory as the path.
- **PR changes**: Determine the repository (`owner/repo`) and PR number. If the user provides a PR URL, extract these from it. If available, run `gh pr view --json number,headRepository` or similar.
- If the user specifies a particular scope, use that.
Collect:
- Whether this is local or PR mode
- For local: the absolute path and HEAD SHA
- For PR: the `owner/repo` string and PR number
## 2. Start analysis
Call the `start_analysis` MCP tool with the appropriate parameters:
**For local mode:**
```json
{
"path": "/absolute/path/to/repo",
"headSha": "abc123...",
"tier": "balanced",
"skipLevel3": false,
"customInstructions": "optional instructions"
}
```
**For PR mode:**
```json
{
"repo": "owner/repo",
"prNumber": 42,
"tier": "balanced",
"skipLevel3": false,
"customInstructions": "optional instructions"
}
```
Pass the `tier`, `skipLevel3`, and `customInstructions` arguments from the skill invocation.
The tool returns immediately with `{ analysisId, runId, reviewId, status: "started" }`.
## 3. Poll for completion
Analysis typically takes 1-5 minutes depending on the size of the changes and the tier.
Poll using `get_ai_analysis_runs` with `limit: 1` and the review coordinates from step 1. Wa