> ## Documentation Index
> Fetch the complete documentation index at: https://docs.boat.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents and forks

> Let an agent drive a Windows app in a sandbox. Set up the sandbox once, then fork it for each task.

## Let an agent drive it

The Windows apps open as ordinary windows on the sandbox desktop. A prompt is enough:

<CodeGroup>
  ```bash CLI theme={null}
  boat prompt bx_f7k2q9hd --provider claude "Open HeidiSQL, connect to the MySQL server on localhost, and export the users table to CSV"
  ```

  ```bash curl theme={null}
  curl -sS -X POST "$BOAT_API_BASE/sandboxes/bx_f7k2q9hd/prompt" \
    -H "Authorization: Bearer $BOAT_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"provider":"claude","prompt":"Open HeidiSQL, connect to the MySQL server on localhost, and export the users table to CSV"}'
  ```

  ```ts TypeScript theme={null}
  await sandbox.prompt({
    sandboxId: "bx_f7k2q9hd",
    provider: "claude",
    prompt: "Open HeidiSQL, connect to the MySQL server on localhost, and export the users table to CSV",
  });
  ```

  ```python Python theme={null}
  sandbox.prompt("bx_f7k2q9hd", PromptRequest(
      provider="claude",
      prompt="Open HeidiSQL, connect to the MySQL server on localhost, and export the users table to CSV",
  ))
  ```
</CodeGroup>

For scripted steps, `xdotool` and `wmctrl` are installed. Examples:

* `wmctrl -l` lists the open windows.
* `wmctrl -a HeidiSQL` brings one window to the front.

To record the run, use [`ascii-record-desktop`](/desktop-streaming/drive-and-record#record-the-screen).

## Set up once, fork many times

The Wine set-up is in `~/.wine` and in the system packages. Stop, resume and fork keep both.

In our test, a sandbox with Wine and 40 Windows apps (16 GB) gave these results:

| Action | Time | Result |
| - | - | - |
| Fork | About 2 minutes until the desktop accepts windows | Every app starts. Notepad++ keeps its unsaved text. |
| Stop | 4 seconds | |
| Resume | 20 to 32 seconds, on a different machine | Every app starts. |

To use this:

1. Make one sandbox with the apps that your agents need.
2. Fork it for each task. Read [Snapshots & Copies](/snapshots).

<Note>
  Running Windows programs do not survive a stop or a fork. Start them again after a resume.
</Note>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.