Skip to content

Code reviews

Traditional code review tools show you diffs, so you know what changed but not why. Each Polygraph session records the decisions that shaped the result, so you can review the reasoning behind a change, not just the code.

That gap is widest on an AI-generated pull request, which can be very large. The reasoning and the decisions behind it are gone by the time you read the diff.

Open a review from the session link on a PR, or start it from the terminal:

Terminal window
polygraph session review <session-id> # skip session-id to start with search

Review mode resumes the session with the agent answering questions instead of continuing the work. Ask anything the diff doesn't tell you:

What alternatives were considered, and why were they rejected?
Which parts of this PR are you least confident about?
What was done to address them?

The agent answers based on the recorded session history and can point at the moment where a test failed, a constraint surfaced, or an approach was dropped. See Review code with full context for the questions that work well in review mode.

For an independent second opinion, run the review in adversarial mode:

Terminal window
polygraph session review <session-id> --adversarial

Polygraph spawns one independent reviewer agent per repo in the session, then merges their reviews into a single summary. The reviewers verify the session's assumptions against the current code instead of taking the session's word for it. Everything stays read-only.

Inside an agent session, you can invoke the same flow with the /adversarial-review skill from the Polygraph plugin.

When a review finds a problem, you can post the review as usual. You can also pass the work back to the author. Because the review happened in the same session, they resume with the full context of your findings:

Terminal window
polygraph session resume <session-id>