# mark_escape

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

The CodePanel MCP tool that marks a recorded review escape as not an escape, so it is kept and no longer counted, or takes the mark back.

`mark_escape` marks an escape as not an escape, by its ref such as `E3`. The row is kept with a record of who marked it, and it is no longer counted in the rate. The same call with `notEscape: false` takes the mark back. It needs `repo` and `ref`, and the `reviews:write` scope.

## When to call it

- **The fixing commit did not fix a defect in those lines.** A rename, a refactor or a follow-up feature whose subject happens to lead with "Fix".
- **The defect was not there to catch at review time.** The requirement changed after the merge, and the reviewed lines were right for the old one.
- **To undo a mark** that turned out wrong: pass `notEscape: false`.

Nothing waits for this call. The daily scan records escapes on its own and they count at once; a mark corrects the record afterwards. Don't mark a row only because the review could not reasonably have caught it: a hard miss is still a miss, and the rate is meant to count it.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `repo` | string | yes | Repository as owner/name |
| `ref` | string | yes | The escape, e.g. "E3" |
| `notEscape` | boolean | no | true (default) marks it as not an escape; false takes the mark back |
| `note` | string, at most 500 characters | no | Why, in a sentence: what you checked |
| `agent` | string | no | Your name, e.g. claude-code. Defaults to this MCP client's name |

It writes: the server marks it `readOnlyHint: false` and `destructiveHint: true` (it can change what is already there), so a client that asks before writes asks here.

`ref` is the escape's name from [`list_escapes`](/docs/mcp-server/list_escapes), in either case. An unknown ref is refused:

```text
CodePanel: Escape E9 not found; refs look like E3
```

`note` is cut to 500 characters. `agent` defaults to this MCP client's name; a call that names no agent is recorded as `api`.

## What it returns

`ref`, `notEscape` (the row's state now) and `outcome`: `marked`, `unmarked`, or `unchanged` when the row was already in the state you asked for.

A marked row stays in `list_escapes` with `notEscape: { at, agent, note }`. If a later commit changes the same lines again, the new commit is added to the row's `fixes` and the row stays marked.

## Examples

This response comes from the scan's own test fixture: an in-memory backend with one recorded escape.

```json title="Call"
{
  "repo": "codepanel-dev/web-app",
  "ref": "E1",
  "note": "The fix changed the rounding rule; the reviewed line was right for the old rule.",
  "agent": "claude-code"
}
```

```json title="Result"
{
  "notEscape": true,
  "outcome": "marked",
  "ref": "E1"
}
```

## The same step without MCP

| Surface | Form |
| --- | --- |
| CLI | `codepanel escapes mark\|unmark <owner/name> E3 --note ... --agent <name>` ([CLI](/docs/cli)) |
| HTTP API | [`POST /escapes/mark`](/docs/api#post-escapesmark) |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Mark an escape as not an escape by its ref, e.g. E3 from list_escapes, when the fixing commit did not fix a defect in those lines (a rename, a follow-up feature worded as a fix). The row is kept, records who marked it, and is never counted. notEscape false takes the mark back. Returns outcome marked, unmarked or unchanged.

## Related

- [`list_escapes`](/docs/mcp-server/list_escapes): find the ref and read the evidence.
- [`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.
