# list_escapes

URL: https://codepanel.ai/docs/mcp-server/list_escapes

The CodePanel MCP tool that lists what a repository's reviews missed: reviewed lines a later fix or revert commit changed, and the rate.

`list_escapes` lists what a repository's reviews missed: lines a reviewed pull request added that a later commit on the default branch fixed or reverted, where the review had no finding near them. It also gives the rate per 100 reviewed pull requests merged. Every other quality number is about findings that were posted; this one counts what was not. It only reads, and it needs the `read` scope.

## When to call it

- **To see where reviews fall short:** read `path` and the fixing commits' subjects, and look for the same directory or the same kind of defect coming back.
- **Before trusting the rate:** read `rate.stillInWindow` and `scan`. A pull request merged less than 14 days ago can still gain an escape, so a recent window undercounts.
- **To correct the record:** when a row is not a defect the review should have caught, mark it with [`mark_escape`](/docs/mcp-server/mark_escape).

It is measurement only. No review reads these rows, so marking one changes the rate and nothing else.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |
| `days` | integer, at most 90 | no | Window in days, default 30 |

It only reads: the server marks it `readOnlyHint: true`, so clients that ask before a write can run it without asking.

`days` is the window, by when each escape first showed. It defaults to 30, and 90 is the most.

## What counts as an escape

A daily job lists each default branch's new commits. A commit counts when its message says it fixes or reverts something: a revert, a word that says something broke (`regression`, `hotfix`, `broke`, `crash`), or a subject that leads with a fix. "Fix lint", "fix review findings" and the like do not count, and neither does a merge commit. Docs, tests, fixtures and generated files are left out.

Each line the commit changed is placed by blame at the commit's parent, never by its text. The line is an escape when:

- GitHub ties the blamed commit to a pull request CodePanel reviewed. This holds for squash, merge-commit and rebase merges.
- The fixing commit came within 14 days after that pull request merged, and is not part of the same pull request.
- The line was already there at the commit the pull request's last round read.
- No finding of that pull request sat within 3 lines, whatever became of the finding.

A commit that only inserted lines is placed by the nearest line beside the insertion, and the row says `insertionOnly`.

## What it returns

`repo`, `days`, `windowDays` (14), `rate`, `scan`, `escapes` (newest first, at most 200) and `truncated`.

Each escape is one range of one pull request's lines:

- `ref`: its name on this repository, such as `E3`. Never reused.
- `prNumber`, `round` and `reviewedSha`: the pull request, its last reviewed round and the commit that round read.
- `path`, `startLine`, `endLine`: the lines at `reviewedSha`.
- `fixes`: the commits that changed them, oldest first, each with `sha`, `at`, `rule` (`revert`, `break` or `fix`) and `subject` (at most 120 characters). A second fix of the same lines is more evidence on the same row, not a second escape.
- `insertionOnly`: every fix so far only inserted beside the lines. This is weaker evidence: the lines may have been right.
- `mergedAt`, `firstFixedAt`: when the pull request merged and when the escape first showed.
- `notEscape`: `null`, or `{ at, agent, note }` once someone marked it. A marked row stays in the list and is not counted.

`rate` covers the reviewed pull requests merged in the window: `escapes`, `escapedPullRequests`, `reviewedMerged`, `per100` (escapes per 100 of them, counted over every row and not only the 200 listed; `null` when none merged, or when the rate could not be worked out), `notEscapes` and `stillInWindow`.

When the rate could not be worked out, `rate.unavailable` says why and gives the last one the daily scan kept:

- `cause`: `backfilling` (the count of reviewed merges is still being filled in for merges from before it was kept), `too_many_rows` (more than 2,000 escapes or 20,000 reviewed merges in the window: ask for fewer days) or `read_failed` (the window could not be read at all; the list is then empty and the counts are 0).
- `detail`: the same in words, with what to do.
- `cached` and `cachedAt`: the scan's last rate over 30 days, in the same fields as `rate`, and when that scan ran; both `null` before a scan has kept one.

`scan` is the daily job's last run on this repository, or `null` before the first: the cursor (`sha`, `commitAt`), `ranAt`, `listed`, `fetched` (commits whose message matched and whose files were read), `filesSkipped` (files whose blame or reviewed version could not be read), `recorded`, and `stoppedShort` with an optional `failure`. One run lists at most 200 commits and reads at most 20 matching ones; the rest wait for the next run, oldest first.

## Examples

These responses come from the scan's own test fixture: an in-memory backend and a stub GitHub with three merged pull requests and one fix commit.

```json title="Call"
{ "repo": "codepanel-dev/web-app" }
```

```json title="Result"
{
  "days": 30,
  "escapes": [
    {
      "endLine": 5,
      "firstFixedAt": 1794438745050,
      "fixes": [
        {
          "at": 1794438745050,
          "rule": "fix",
          "sha": "c07e5d3000000000000000000000000000000000",
          "subject": "Fix checkout total: add tax, not subtract (#145)"
        }
      ],
      "insertionOnly": false,
      "mergedAt": 1794179545050,
      "notEscape": null,
      "path": "src/checkout/total.ts",
      "prNumber": 142,
      "ref": "E1",
      "reviewedSha": "9f2c1e7000000000000000000000000000000000",
      "round": 2,
      "startLine": 5
    }
  ],
  "rate": {
    "escapedPullRequests": 1,
    "escapes": 1,
    "notEscapes": 0,
    "per100": 33.3,
    "reviewedMerged": 3,
    "stillInWindow": 3
  },
  "repo": "codepanel-dev/web-app",
  "scan": {
    "commitAt": 1794438745050,
    "fetched": 1,
    "filesSkipped": 0,
    "listed": 1,
    "ranAt": 1794697945060,
    "recorded": 1,
    "sha": "c07e5d3000000000000000000000000000000000",
    "stoppedShort": false
  },
  "truncated": false,
  "windowDays": 14
}
```

Pull request 142 added line 5 of `src/checkout/total.ts`, its review said nothing within 3 lines, and a fix commit changed that line three days after the merge. All three pull requests merged less than 14 days ago, so `stillInWindow` is 3 and the rate can still rise.

## What it does not see

- A defect nobody has fixed yet, or one fixed by a commit whose message does not say so.
- A fix more than 14 days after the merge.
- A commit that reached the default branch long after it was committed (a stale branch merged with a merge commit, a direct push of old commits). Commits are listed by commit date, and the scan has already passed that date.
- A repository's first scan starts at the oldest reviewed merge of the last 16 days, not at the start of its history.

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel escapes owner/name` with `--days` and `--json` ([CLI](/docs/cli)) |
| HTTP API | [`GET /escapes`](/docs/api#get-escapes) |

## What the server tells your agent

The description your agent reads when it lists the tools:

> What a repository's reviews missed over the last `days` (default 30, at most 90). An escape is lines a CodePanel-reviewed pull request added that a commit on the default branch fixed or reverted within windowDays (14) of its merge, where no finding of that pull request sat within 3 lines. Lines are placed by blame, never by text. Each row: ref (E3), prNumber, round and reviewedSha (the review that let it through), path, startLine and endLine at reviewedSha, insertionOnly (every fix only inserted beside the lines: weaker evidence), fixes (sha, at, rule revert|break|fix, subject) and notEscape (set when someone marked it; then it is listed and not counted). rate is escapes per 100 reviewed pull requests merged in the window: escapes, escapedPullRequests, reviewedMerged, per100 (null with none merged), notEscapes, and stillInWindow (merged under 14 days ago, so they can still gain one and the rate can still rise); when the rate cannot be worked out, rate.unavailable says why (cause backfilling, too_many_rows or read_failed, with detail) and gives cached, the daily scan's last 30-day rate, and cachedAt. scan is the daily job's last run: cursor sha, commits listed and fetched, filesSkipped (blame or file unreadable), stoppedShort when commits were left for the next run. Measurement only: no review reads these yet.

## Related

- [`mark_escape`](/docs/mcp-server/mark_escape): mark a row as not an escape, or take the mark back.
- [`get_quality`](/docs/mcp-server/get_quality): precision, the other half of review quality.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
