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

# Connect to an existing sandbox

> Reconnect to a sandbox you created earlier using its ID, and list sandboxes on your team.

A sandbox outlives the process that created it. Store `sandbox.id` somewhere durable (a database, a queue message), and reconnect later with `Sandbox.connect()`.

* `Sandbox.connect(id)` - returns a live `sandbox` with `commands` and `files` ready to use. If the sandbox is `paused`, it's auto-resumed before returning.
* `sandbox.getInfo()` - fetch the current status and metadata for a sandbox you already have (read-only, no state change)

<CodeGroup>
  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  import { Sandbox } from "@superserve/sdk"

  const sandbox = await Sandbox.connect("7a3f2b8c-1234-...")
  await sandbox.commands.run("ls /app")
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  from superserve import Sandbox

  sandbox = Sandbox.connect("7a3f2b8c-1234-...")
  sandbox.commands.run("ls /app")
  ```
</CodeGroup>

## Find sandboxes with `list`

List all sandboxes on the team, or filter by metadata. Filters combine with AND.

<CodeGroup>
  ```typescript TypeScript theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  const all = await Sandbox.list()

  const prod = await Sandbox.list({
    metadata: { env: "prod", owner: "agent-7" },
  })

  for (const info of prod) {
    console.log(info.id, info.name, info.status)
  }
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"vitesse-dark"}}
  all_boxes = Sandbox.list()

  prod = Sandbox.list(metadata={"env": "prod", "owner": "agent-7"})

  for info in prod:
      print(info.id, info.name, info.status.value)
  ```
</CodeGroup>

`list()` returns an array of [`SandboxInfo`](/sdk-reference/sandbox#sandboxinfo) - no live `sandbox` is constructed. Call `Sandbox.connect(id)` when you need one.
