> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentgg.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Scan a pull request

> Restrict a scan to the files one commit or one range touched, with --diff.

A full scan reads every file in the codebase. Pass `--diff` with a commit or a range to check only what changed.

## Three forms

| Form        | Compares                                   | Use for                             |
| ----------- | ------------------------------------------ | ----------------------------------- |
| `<commit>`  | That commit against its own parent.        | One commit's own changes.           |
| `<a>..<b>`  | The tip of `a` against the tip of `b`.     | A tip-to-tip diff between two refs. |
| `<a>...<b>` | The merge base of `a` and `b` against `b`. | A pull request review.              |

The working tree never affects the result. `--diff` reads the commits themselves, not your local edits.

## Scan a pull request

Compare the base branch against the head commit with three dots.

```bash theme={null}
agentgg scan . --diff origin/main...HEAD -o ./out
```

## What to expect

```
Diff mode: reviewing commit origin/main...HEAD (14 file(s) changed)
```

Each agent's candidate files narrow to the touched set. The commit's patch also feeds into every agent's prompt, so it has context on the change even when it reads further with its tools.

Every later phase runs on the touched files only.

To run this check on each pull request, see [Run agentgg in GitHub Actions](/cli/guides/github-actions).

Full flag list: [Scan flags](/cli/reference/scan-flags).
