# pause_run

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

The CodePanel MCP tool that holds an agent app run between turns, a swarm's children too, keeping its place and worktree.

`pause_run` holds a run without ending it. Every agent in the run, a swarm's children too, finishes the turn it is in and holds before the next one: no model call, no new subagent, and the worktree stays as it is. [`resume_run`](/docs/mcp-server/resume_run) lets it go on from the same history. It needs the `tasks:write` scope.

## When to call it

- **To look before it goes on**: read the run's diff or log while nothing changes under you.
- **To steer many runs at once**: [`bulk_tasks`](/docs/mcp-server/bulk_tasks) with `action: "pause"` pauses each task's run going, and the desktop app's Fleet does the same from a selection.
- **To halt it for good**, use [`stop_run`](/docs/mcp-server/stop_run) instead.

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `runId` | string | yes | Id of a run, from get_task's runs or start_task's task |

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.

`runId`. Pausing a run already paused changes nothing. An ended run is refused with `reason: run_ended`. A run on an external agent CLI is refused with `reason: pause_unsupported`, since the runner cannot hold its process between turns; stop it instead.

## What it returns

`{ before, after }`, each the run. `after.pauseRequestedAt` is set at once. The status reads `paused` once the runner has parked the run, with `pausedAt` and `pauseLatencyMs`, the time from the request to the park. A runner on the same machine acts at once and parks as soon as the turn in flight ends; a runner elsewhere picks the pause up at its next check.

## The same step without MCP

| Surface | Form |
| --- | --- |
| HTTP API | `POST /tasks/runs/pause` with the `tasks:write` scope |
| CLI | `codepanel run pause <runId>` |

## What the server tells your agent

The description your agent reads when it lists the tools:

> Use it to hold a run without losing its place, such as to look at its work or change its model. Every agent in the run (a swarm's children too) finishes the turn it is in and holds before the next: no model call, no new subagent, and the worktree stays. Status reads paused once the runner has parked it (pausedAt, and pauseLatencyMs from the request); until then pauseRequestedAt is set. A runner on this machine acts at once, one elsewhere within its next check. Pausing again changes nothing. An ended run is refused (run_ended), and so is a run on an external agent CLI (pause_unsupported: use stop_run). Needs tasks:write. Returns { before, after }. Undo with resume_run.

## Related

- [`resume_run`](/docs/mcp-server/resume_run): let the run go on.
- [`stop_run`](/docs/mcp-server/stop_run): end the run and keep its task.
- [MCP server](/docs/mcp-server): install, sign-in and every other tool.
