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

# Move files in and out of sandboxes

> Find an agent's sandbox, copy files and directories to and from it, and run commands in it from your terminal with jaccard sandbox.

This works while a session runs and after it ends, since a stopped sandbox keeps its files in `/workspace`.

## Find the sandbox

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
jaccard sandbox list --agent report-writer
```

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
NAME                      AGENT          PHASE    REASON  AGE
eve-sbx-0123456789abcdef  report-writer  Ready            12m
eve-sbx-fedcba9876543210  report-writer  Stopped          2d
```

The newest is first. `copy` and `exec` take the agent's name and act on its newest sandbox, usually the one from the latest session. To pick an older one, pass its name with `--sandbox`. Or open the agent's **Sandboxes** tab in the [console](/docs/operate/console.md).

## Copy files out

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
jaccard sandbox copy report-writer:out/report.pdf ./report.pdf
jaccard sandbox copy report-writer:out ./out                     # a whole directory
jaccard sandbox copy :out/report.pdf . --sandbox eve-sbx-fedcba9876543210
```

Remote paths are relative to `/workspace` unless they start with `/`.

## Copy files in

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
jaccard sandbox copy ./fixtures report-writer:fixtures
jaccard sandbox copy ./report.pdf report-writer:in/final.pdf     # renamed on the way
```

The remote path is the full path the file or directory will have, never a directory to copy into: `report-writer:in/` doesn't put `report.pdf` inside `in/`.

* **Uploads are not atomic.** If an upload fails part-way, the files already sent stay in the sandbox. Copy again, or clean up with `exec`.
* **A copy wakes a stopped sandbox.** The first copy takes longer while it starts. It then stays running, and counts against your [running sandboxes quota](/docs/operate/usage.md), until it [stops for lack of use](/docs/build/sandbox.md#what-lasts).

## Run a command

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
jaccard sandbox exec report-writer -- ls -la out
jaccard sandbox exec report-writer --workdir out -- wc -l report.csv
```

Everything after `--` runs in the sandbox, starting in `/workspace` unless you pass `--workdir`. `exec` prints the command's output and exits with its exit code, so it works in scripts. The command gets no input from your terminal.

* **Ctrl-C ends the command too.** Stopping `exec` stops what it was running in the sandbox.
* **A background process can hold the call open.** `exec` returns when the command's output closes, so start a background process with its output redirected: `long-job >/dev/null 2>&1 &`.

> [!WARNING]
>
> `--env KEY=VALUE` values can be recorded in the platform's audit log. Don't pass secrets that way.

## When a sandbox is refused

If your organization's quota stops a sandbox, `sandbox list` shows `QuotaExceeded` in `REASON` with the platform's message on the next line, and a `copy` or `exec` that would wake it fails. [`jaccard usage`](/docs/operate/usage) shows which limit you've reached.

Every option is in the [`sandbox` reference](/docs/reference/cli/sandbox).


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