# Desktop app

URL: https://codepanel.ai/docs/desktop-app

Run coding agents on macOS, Linux, or Windows: install, connect a runner, add checkouts, steer threads, rewind checkpoints, and publish PRs.

The CodePanel Desktop App runs coding agents directly on your machine on **macOS** (Apple silicon and Intel), **Linux** (x64), and **Windows** (x64). You start a thread, an agent works in an isolated git worktree of your checkout, and when checks pass, the runner pushes its branch and opens a pull request that your review panel checks automatically.

Everything the desktop app does is also exposed through the [HTTP API](/docs/api), [MCP server](/docs/mcp-server), and [CLI](/docs/cli), so external agents can start and steer runs too.

## Install

1. Download the installer for your platform from [codepanel.ai/download](/download):
   - **macOS:** Open the `.dmg`, drag **CodePanel** to **Applications**, and launch it from Applications (running from Downloads triggers macOS App Translocation and blocks auto-updates).
   - **Linux:** Run the `.AppImage` or install the `.deb` package.
   - **Windows:** Run the `.exe` / `.msi` installer.
2. Signed builds check for updates automatically on startup, or on demand from the tray/menu bar icon (**Check for updates**).

Closing the main window keeps CodePanel running in the menu bar / system tray so your local runner can keep claiming queued tasks and Autopilot rules. Choose **Quit** to stop both the window and the runner.

## Before you start

| Requirement | Why | Where |
| --- | --- | --- |
| A CodePanel plan | Covers both PR reviews and agent runs; tokens are billed at cost | [Billing and credits](/docs/billing#agent-runs) |
| A connected repository | Every thread targets one connected GitHub repo | [Quickstart](/docs/quickstart) |
| A coding agent or team | Defines the model, instructions, and per-task budget | **New agent** or **Teams** in the app |
| A local git clone | Each run creates its own isolated worktree off your clone | **Settings → Runners & worktrees** |
| `git` and signed-in `gh` CLI | Used by the runner to push branches and open PRs as you | **Settings → Runners & worktrees → Pull requests** |

## Sign in and connect this machine

Sign in with GitHub inside the app. Your account, connected repositories, provider keys, credits, and plans are shared with [codepanel.ai](https://codepanel.ai).

Until setup is complete, the Inbox shows a short checklist: **Plan**, **Connect this machine**, **Add a checkout**, and **Start your first thread**.

1. Open **Settings → Runners & worktrees** (`⌘,` / `Ctrl+,`).
2. Press **Connect this machine**. The local runner requests a scoped token (`read` and `tasks:write`) and stores it locally under `~/.codepanel/runner/config.json` (readable only by your OS user).
3. The sidebar status switches to **online** once the runner checks in.

You can connect multiple machines: each registers its own runner, and queued tasks automatically route to an online runner that has a checkout of the target repository.

## Add a checkout

Under **Checkouts on this machine**, select a connected repository and pick its local git folder. CodePanel detects default verification checks (such as `bun test` or `npm test`) from `package.json`, which you can customize per repository.

Your main checkout is never modified directly: every run creates a dedicated git worktree on its own branch (`codepanel/run-<runId>`).

Under **Pull requests**, choose what happens when a run finishes with a commit:

| Publish mode | Behavior |
| --- | --- |
| **Open a pull request** (default) | Pushes the run branch and opens (or updates) a GitHub PR |
| **Push the branch only** | Pushes the branch without opening a PR |
| **Keep on this machine** | Leaves commits in the local worktree without pushing |

## Working in a thread

Press **New thread** (`⌘N` / `Ctrl+N`), choose a repository, describe the task, and pick who works it: **Auto** (routes to the repository's team or best-performing agent) or a specific agent or team.

- **Live timeline:** Every file read, edit, and command streams into the thread. Expand any step to inspect exact diffs and command output.
- **Right panel (`⌘J` / `Ctrl+J`):**
  - **Changes:** Full branch diff with CodePanel's open review findings shown inline under the exact lines they reference, plus **inline diff line comments** so you can leave targeted feedback directly on specific lines.
  - **Terminal:** Every command executed by the agent and its output.
  - **Run:** Active checks, model, permission mode, token usage, cost, elapsed time, and branch name.
- **Mid-run steering:** Send a follow-up message while a run is still in progress to redirect the agent without stopping or restarting the thread.
- **Per-turn checkpoints & rewind:** CodePanel snapshots the worktree on every turn. You can inspect what changed in any turn and rewind the worktree back to an earlier checkpoint if a run goes off track.
- **Quick permission mode toggle:** Switch a thread's permission mode directly from the thread bar (and review or approve permissions on mobile at `/app`).

When the run finishes and opens a PR, your CodePanel review panel automatically reviews it, and findings appear right inside the thread's **Changes** tab.

## What runs where

| Component | Where it runs | Responsibility |
| --- | --- | --- |
| **App window** | Desktop shell on `codepanel.ai/app` (also accessible in mobile browsers at `/app`) | Threads, Inbox, Fleet, Teams, Autopilot, Spend, Settings |
| **Local runner** | Background process on your machine | Claims queued tasks, manages git worktrees and checkpoints, executes sandboxed tools, commits and pushes |
| **Model calls** | Your AI provider via CodePanel's model proxy | Enforces per-run, per-rule, and daily spend caps; provider keys never leave CodePanel's backend |
| **PR review** | CodePanel cloud | Runs your multi-model review panel on every PR the runner opens |

View runner logs anytime via **Help → Show Logs** (`runner.log`), or inspect online runners with `codepanel runners` / [`list_runners`](/docs/mcp-server/list_runners).

## The sandbox

On **macOS** and **Linux**, every shell command an agent executes runs inside the OS sandbox:

- **Filesystem isolation:** Commands can write only inside the run's worktree, its temp directory, and git metadata for the run's branch. They cannot read your SSH keys, `gh` or cloud credentials, keychains, `~/.codepanel`, or your other repositories.
- **Branch protection:** Sandboxed commands cannot move `main` or other branches outside the run's branch.
- **Network controls:** Interactive threads you start have network access (for package installs). Runs triggered automatically by [Autopilot rules](/docs/autopilot) run **offline by default** (installing dependencies from your local package cache) unless you explicitly enable **Network for rule-started runs** for that repository in **Settings → Runners & worktrees**. If an offline install cannot finish, the run pauses in your Inbox as **Needs network**.

On startup, the runner verifies the OS sandbox is working. If it isn't, the runner **refuses every command** by default, and a run that fails for it says why and what to do, in its status and in your Inbox. **Settings → Runners & worktrees → Sandbox** shows the sandbox's state and the fix:

- **Linux:** the sandbox is `bwrap` (bubblewrap). The `.deb` package installs it as a dependency; with the AppImage, install it yourself (`sudo apt install bubblewrap`, `sudo dnf install bubblewrap`, or your distribution's package), then quit and reopen the app. If `bwrap` is installed but cannot confine a command, allow unprivileged user namespaces (on Ubuntu 24.04 and later, an AppArmor profile for `bwrap`).
- **Windows:** there is no OS sandbox the runner supports, so commands are refused until you choose to run without one.

To run anyway, choose **Run without a sandbox** in **Settings → Runners & worktrees → Sandbox** and confirm. Commands then run as you: they can read your SSH keys, `gh` and cloud credentials and other repositories, change any file your account can, and reach the network. Runs an autopilot rule started still stop in your Inbox as **Needs network** unless their repository allows the network, since nothing else could keep them off it. The setting applies from the next run, only while the machine has no working sandbox, and **Require the sandbox** turns it back off. Only the desktop app can change it: the request needs your signed-in session and the app's own pairing with the runner, so a web page, an agent or a run's commands cannot turn the sandbox off. A runner you started yourself takes `"sandbox": {"unsandboxed": true}` in its `config.json` instead.

If a checkout's `.git/config` contains embedded credentials (such as a token in a remote URL), **Settings → Runners & worktrees** warns you so you can remove it.

## What gets pushed

Only the run's dedicated branch (`codepanel/run-<runId>`) is ever pushed, never force-pushed, and never to your default branch.

The `git push` and `gh pr create` commands execute in the runner *after* the agent finishes, using your own `git` and `gh` login with git hooks disabled (so nothing the agent wrote executes with your credentials). The PR description includes the task prompt, diffstat, verification check results, and a `CodePanel-Run:` trailer.

For Autopilot tasks targeting an existing pull request (`pr_stalled`, `dependabot_pr`, `pr_ci_failed`, or `review_blocked`), the runner checks out that PR's head and pushes updates onto its branch when permitted, or opens a follow-up PR otherwise.

## Driving the app from an agent

| Action | MCP | CLI | API |
| --- | --- | --- | --- |
| Start a thread | [`start_task`](/docs/mcp-server/start_task) | `codepanel task start <owner/name> --title <t> <prompt>` | `POST /api/v1/tasks` |
| Wait & inspect run | [`wait_for_run`](/docs/mcp-server/wait_for_run), [`get_run`](/docs/mcp-server/get_run) | `codepanel run wait <runId>` | `GET /api/v1/tasks/runs/get` |
| Read diff | [`get_run_diff`](/docs/mcp-server/get_run_diff) | `codepanel run diff <runId>` | `GET /api/v1/tasks/runs/diff` |
| List runners | [`list_runners`](/docs/mcp-server/list_runners) | `codepanel runners` | `GET /api/v1/tasks/runners` |

## Troubleshooting

| Symptom | Fix |
| --- | --- |
| Sidebar shows **Local runner not seen** | Open **Settings → Runners & worktrees** and click **Connect this machine** |
| Sidebar shows **offline** | Launch the desktop app (or wake the machine); queued tasks wait automatically |
| Thread stays **Queued** | No online runner has a checkout for that repo; add it in **Settings → Runners & worktrees** |
| Result card shows **Not pushed** | Check the error message: usually `gh auth login` is needed or `git push` lacks permission |
| Run refused with `plan_required` | Subscribe under **Settings → Billing** ([Agent runs](/docs/billing#agent-runs)), then retry |
| Window says **Can't reach CodePanel** | Check your internet connection; the app retries automatically every 10 seconds |

Next: [Autopilot rules](/docs/autopilot) and [Run control](/docs/run-control).
