<!--
Sitemap:
- [Installation](/installation): Install the Bento daemon on macOS or Linux, then write your first pipeline to run a coding agent on a GitHub, Linear, or schedule event.
- [Upgrading](/upgrading): Version-specific steps for upgrading an existing Bento install.
- [Concepts](/concepts)
- [Build your first pipeline](/tutorials/pipeline-args)
- [Target a specific issue or PR from a URL](/tutorials/url-targeting)
- [Keep state across runs](/tutorials/pipeline-state)
- [Fire a pipeline on a schedule or on demand](/tutorials/schedule-and-fire)
- [Deploy a box to Railway](/tutorials/deploy-to-railway)
- [Operate a hosted daemon](/tutorials/operate-a-hosted-daemon)
- [Configuration](/configuration): Configure the Bento daemon with daemon.yaml: service name, port, webhooks, sandboxes, knowledge base, and environment variables.
- [Members](/members)
- [Knowledge base](/knowledge-base/)
- [Method and delivery](/knowledge-base/modes): Choose how Bento retrieves knowledge (BM25, vector, or hybrid) and how it delivers that knowledge to a coding agent.
- [Config](/knowledge-base/config)
- [MCP](/knowledge-base/mcp): Give coding agents your team knowledge over MCP. The Bento daemon serves an ask_knowledge search tool and per-file resources.
- [Pipeline configuration reference](/pipelines/config): Reference for Bento pipeline YAML: triggers, agents, skills, instructions, filters, sandboxes, structured results, and outputs.
- [Filters](/pipelines/filters): Filter GitHub, Linear, and webhook events by repository, label, and other fields so only the right Bento pipelines run.
- [Triggers](/triggers/): Start a Bento pipeline from a GitHub, Linear, webhook, schedule, or manual trigger. Compare the trigger types and when each one fires.
- [GitHub trigger](/triggers/github): Run a coding agent on GitHub pull request, issue, and other webhook events. Configure HMAC verification and event patterns.
- [Linear trigger](/triggers/linear): Run a coding agent on Linear issue and comment events. Configure the Linear webhook, signature verification, and Hookdeck relay.
- [Webhook trigger](/triggers/webhook): Fire a Bento pipeline from any HTTP POST to /webhooks/{name}, with bearer-token authentication declared in daemon.yaml.
- [Schedule trigger](/triggers/schedule)
- [Manual trigger](/triggers/manual): Fire any Bento pipeline on demand with bento trigger fire, and pass typed inputs to a pipeline that runs only on request.
- [Traces](/pipelines/traces)
- [Slack](/integrations/slack)
- [Public access](/public-access): Expose the Bento daemon to GitHub webhooks through a Cloudflare Quick Tunnel or Tailscale Funnel, and compare the two options.
- [Context engineering](/context-engineering): Assemble each coding agent prompt from personas, policies, skills, and pipeline instructions. Learn which file each instruction belongs in.
- [Best practices](/best-practices)
- [Troubleshooting](/troubleshooting)
- [Architecture](/architecture/vision)
- [Workspaces](/workspaces)
- [Authentication](/authentication)
- [Identity](/identity)
- [Security](/security)
- [References](/references)
- [Changelog](/changelog): Bento release history.
- [CLI reference](/cli/)
- [Setup](/cli/setup)
- [Secrets](/cli/secrets)
- [Lifecycle](/cli/lifecycle)
- [Sandbox image](/cli/image)
- [Sandboxes](/cli/sandbox)
- [Observability](/cli/observability)
- [Diagnostics](/cli/diagnostics)
- [Triggers](/cli/triggers)
- [Workbench](/cli/workbench)
- [Auth](/cli/auth)
- [Knowledge](/cli/knowledge)
- [Evals](/cli/evals)
- [Bento docs: run coding agents from version-controlled pipelines](/index): Bento runs coding agents from pipelines you keep in your repository. Declare the trigger, sandbox, skill, and guardrails in YAML.
- [Runtime wrapper](/architecture/runtime-wrapper)
- [Skill evolve](/architecture/skill-evolve)
-->

# Workbench

A workbench is an isolated checkout of a pull request inside a long-running container shell. Use it to review or edit a pull request without changes to the host checkout. Run these commands from inside the local repository, with `gh` authenticated.

## `bento workbench open <pr>`

Open a workbench for the given pull request, or attach to an existing one. The command resolves the repository and the branch through `gh`, provisions a studio container when one is needed, and mounts a fresh checkout.

```bash
bento workbench open 96
```

| Flag | Description |
|------|-------------|
| `--image <ref>` | Container image for the studio (default: `studio:default`). |
| `--timeout <seconds>` | Checkout timeout (default: 600). |
| `--backend <name>` | Studio backend: `docker` (local container, default) or `daytona` (remote sandbox, requires `DAYTONA_API_KEY`). |
| `--repo <owner/name>` | Target repository. Defaults to the repository in the current directory. Use it when that repository is not the pull request's own. |

## `bento workbench pause`

Stop the studio container of this repository and preserve its checkouts. To resume, reopen any pull request.

```bash
bento workbench pause
```

| Flag | Description |
|------|-------------|
| `--backend <name>` | Studio backend: `docker` (default) or `daytona` (requires `DAYTONA_API_KEY`). |

## `bento workbench destroy`

Destroy the workbench studio of this repository, which removes the sandbox. A Docker checkout survives on the host. A Daytona checkout goes with the sandbox.

```bash
bento workbench destroy
bento workbench destroy --backend daytona
```

| Flag | Description |
|------|-------------|
| `--backend <name>` | Studio backend: `docker` (default) or `daytona` (requires `DAYTONA_API_KEY`). |

## `bento workbench diff <pr>`

Print the uncommitted changes inside the checkout of the workbench. The output is `git diff HEAD`, and it shows a new untracked file as an addition.

```bash
bento workbench diff 96
bento workbench diff 96 --backend docker
```

| Flag | Description |
|------|-------------|
| `--backend <name>` | Select `docker` or `daytona`. Required when the PR has a workbench on both backends. `daytona` reports that a remote diff is unavailable. |

## `bento workbench remove <pr>`

Remove the local workbench of a pull request. The command deletes the host worktree and every Docker bench row for that pull request, and it runs from any directory. While a live session holds the workbench, the command refuses unless you pass `--force`. A Daytona checkout and studio stay untouched.

```bash
bento workbench remove 96
bento workbench remove 96 --force
```

| Flag | Description |
|------|-------------|
| `--force` | Remove even while a live session holds the workbench. Overrides a session lease only, not an in-flight operation on the bench. |

## `bento workbench sweep`

Remove stale local workbenches. The command removes a bench that is idle past the retention window, holds no live session, and holds no work that lacks a backup. It skips a bench that is dirty with uncommitted or unpushed changes, held by a session, or still fresh. It also clears the tombstones a crashed removal leaves behind.

```bash
bento workbench sweep
bento workbench sweep --retention-days 7
bento workbench sweep --dry-run
```

| Flag | Description |
|------|-------------|
| `--retention-days <n>` | Idle days before the command reaps a clean bench. Defaults to 30. |
| `--dry-run` | Report what the command reaps, without removing anything. |
