# Cloud runs

URL: https://codepanel.ai/docs/cloud-runs

Run a coding agent task on CodePanel instead of your machine: start it from the app, the CLI, the API or /fix, with the same billing, caps and review.

A cloud run works a task on CodePanel instead of on your machine, so it goes on with your laptop shut. The agent reads and edits your repository through GitHub's API, pushes a branch, and opens a pull request, which your review panel then reviews like any other. It is billed and capped the same way as a local run.

## Start a cloud run

| From | How |
| --- | --- |
| The desktop app or `/app` | In **New thread**, set the host to **Cloud**, then give the task |
| A running thread | Type `/cloud <prompt>` to send a follow-up to the cloud, or `/local <prompt>` to bring one back |
| The CLI | `codepanel task start <owner/name> --title <t> --host cloud <prompt...>`; `codepanel task retry <taskId> --host cloud` runs a failed task again in the cloud |
| The API | `POST /api/v1/tasks` with `"host": "cloud"` (needs `tasks:write`) |
| A pull request comment | [`/fix`](/docs/commands#fix) asks a cloud agent to fix the review's findings |
| A repository setting | **Cloud auto-fix** in the repository's settings starts a fix when a round ends with blocking findings |

The run uses the repository's coding agent and its model, as a local run would.

## What a cloud run can do

- **Read and write files.** The agent has four tools: read a file, write a file, list files by pattern, and search the code. It reads the commit it started from, so no checkout or clone is needed.
- **No shell.** A cloud run cannot run commands, install packages or run your tests. Your repository's CI runs on the pull request it opens, and the review panel reviews it, so a broken change shows up there.
- **Its own branch.** Edits land on a new branch (`codepanel/cloud-…`, or `codepanel/fix-pr-<n>-…` for a fix) and a pull request that names its model, how many files it changed and what it cost. A fix on an existing pull request opens against that pull request's branch. It only ever creates a new branch: it never pushes to your default branch or to one that already exists, and a diff guard refuses edits outside its limits before anything is pushed.
- **Fork pull requests are refused.** `/fix` and auto-fix work only on pull requests whose branch is in the repository itself.
- **No change, no pull request.** A run that decides nothing needs changing ends as **No change** with its reason.

## Limits

| Limit | Value |
| --- | --- |
| Length | 4 minutes and 40 tool calls a run |
| At once | 3 cloud runs per account; a fourth waits (up to an hour) for one to finish |
| Spend per run | The lowest of the task's, the agent's and the team's run budget, or $2 when none is set |
| Spend per day | Your account's [day cap](/docs/budgets-and-limits) on agent spend, shared with local runs |
| Across CodePanel | A daily number of cloud runs for all accounts; past it, new cloud runs are refused until the next UTC day |
| Automatic fixes | At most 3 a pull request in 24 hours, 5 minutes apart, and the repository's **Cloud auto-fix** attempt limit (2 by default) |

A run that reaches a limit ends as **Budget cap** or waits, and says which limit stopped it. A paused account starts no cloud run, and a task queued before the pause does not start after it.

## Billing

Cloud runs need a plan, the same as local runs and reviews, and their tokens are charged at cost with no fee ([Billing](/docs/billing)). Each model call is held before it is sent and charged at what the provider reported:

- **On credits** when the account spends credits first or has no key of its own for the model's provider, on CodePanel's key.
- **On your own key** otherwise, counted toward your monthly budget.

Calls on your own key take the same path as a local run's: through your account's [AI Gateway](/docs/providers-and-keys#ai-gateway-for-agent-runs) when one is set, including one that holds the key itself, and on the provider's second key when the first is refused.

A call that fails before it reaches the provider costs nothing. A call whose answer was cut off is charged for what it used, and one whose usage was lost after it was sent is charged its held maximum.

## Cloud swarms

A cloud swarm runs one prompt over up to 50 items in parallel on a cheap model, with an optional summary pass ([`start_cloud_swarm`](/docs/mcp-server/start_cloud_swarm)). Swarms run on your own provider keys only, never on credits, and each answered call is a row in your spend, counted toward your monthly budget. A swarm's budget is cut to what is left of your day cap and held on it in full when the swarm starts, so swarms started together cannot share the same room; what it did not spend is given back when it ends, and it cannot start while agents are paused or once the day is spent.

See [Desktop app](/docs/desktop-app) for local runs, [Autopilot](/docs/autopilot) for rules that start tasks on their own, and [Run control](/docs/run-control) for pausing and stopping runs.
