PR review
kcap review launches a Claude Code session equipped with MCP tools that query the implementation transcripts behind a pull request. Reviewers can ask why code was changed, see what alternatives were considered, and verify test coverage — all grounded in what actually happened during development, not just the diff.
Run it
Section titled “Run it”kcap review <pr-url>The URL is any GitHub PR URL — https://github.com/<owner>/<repo>/pull/<number>. The command spawns Claude Code with six MCP tools wired up against your Capacitor server:
| Tool | Purpose |
|---|---|
get_pr_summary | One-shot overview: which sessions touched this PR, who ran them, when. |
list_pr_files | Files changed in the PR, with the sessions that touched each. |
get_file_context | For a file, the relevant transcript turns and tool calls. |
search_context | Full-text search across transcripts of sessions linked to the PR. |
list_sessions | All sessions linked to the PR. |
get_transcript | Fetch a session transcript (paged) by ID. |
You then ask Claude review-style questions and it answers from the transcripts — not the diff.
Questions that work well
Section titled “Questions that work well”The point of kcap review is that it can answer questions a static diff can’t. Phrasings that work well:
Why something is the way it is. The killer use case — “the diff shows what, the transcript shows why.”
- “Why did this PR drop the cache invalidation around line 142?”
- “Why is this method async when nothing awaits its result?”
- “Why did we pick channels over a queue for the worker pool?”
What was tried first. Rejected approaches and dead ends rarely show up in the final diff:
- “What approaches did the agent try before settling on this implementation?”
- “Were retry-on-failure or circuit-breaker alternatives considered?”
- “Did the agent ever try doing this client-side?”
Test coverage and verification. Did the agent actually run things end-to-end, or just lean on mocks?
- “What tests were written for this change? Did any fail and get fixed?”
- “Did the agent verify this against the real Postgres, or only with mocks?”
- “Were there flaky tests the agent worked around?”
File-by-file walk-throughs. Pair list_pr_files with get_file_context:
- “Walk me through what changed in
src/auth/login.tsand why.” - “Which session touched
migrations/0042.sql? Show me the relevant turn.”
Plan adherence. Was the original task scope respected?
- “What was the agent’s plan at the start? Did it complete everything?”
- “Is anything in this PR outside the original task?”
If a question returns “no relevant context”, try rephrasing — the underlying search_context is FTS, so a different key term often surfaces the right transcript.
Reviewing from a hosted agent
Section titled “Reviewing from a hosted agent”kcap review is a local-CLI command, but you don’t need the CLI installed on the device you’re reviewing from. Launch a hosted Claude agent from the dashboard (see Hosted agents), and run kcap review <pr-url> inside its terminal — the hosted agent has the CLI baked in and the MCP server resolves your server credentials automatically.
This is the common path for reviewers who:
- Are reviewing from a phone or browser-only environment.
- Don’t run a coding agent locally and don’t want to install the CLI just to inspect one PR.
- Want to share a review session with a teammate (multi-user input on hosted agents means two people can drive the same review).
For reviewers with the CLI already installed locally, the local invocation is faster — no daemon round-trip.
What gets reviewed
Section titled “What gets reviewed”kcap review works on any PR your Capacitor server can see. The transcripts queried are the ones produced by kcap-captured sessions linked to the PR — from any agent (Claude Code, Codex, Cursor, Gemini CLI, Pi, OpenCode, Antigravity, Kiro, or GitHub Copilot CLI), matched by branch + repo + temporal proximity to the PR’s commits. (The review session runs in Claude Code — or in Codex, when launched as a hosted Codex agent — regardless of which agents produced the work being reviewed.) PRs with no captured sessions still work — there’s just nothing for the MCP tools to return.
Visibility
Section titled “Visibility”The MCP tools respect the same visibility rules as the dashboard:
- Sessions you can’t see on the dashboard, you can’t query through
kcap review. - Sessions marked
privateare only accessible to the owner runningkcap review.
Sharing a session with a reviewer (via the dashboard share popover) makes its transcript available to that reviewer’s kcap review.
Hosted Codex agents
Section titled “Hosted Codex agents”Hosted Codex agents can now run PR review too. Local kcap review always launches Claude Code, but a Codex agent launched from the dashboard gets the same review MCP tools wired up — see Hosted agents for how the daemon injects them.
Related
Section titled “Related”- Review flows — the generative counterpart: a Codex reviewer critiques work in progress before you ship, rather than answering questions about a finished PR.
- Hosted agents — where hosted Codex sessions come from.
- The dashboard — manual browsing of PR-linked sessions.
- Session recall — same MCP pattern, but searches every session you can see rather than just one PR’s.