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

# Sandbox Lifecycle Preservation

> Use pause and resume for existing sandboxes

Need to keep a long-running environment around without paying for idle compute? Pause it. Runtools snapshots the sandbox and brings it back exactly where you left off — same processes, same memory, no rebuild. (Named checkpoints, restore points, and clones aren't in the public API yet; pause/resume is the durable boundary today.)

## Current Public API

The public sandbox lifecycle API supports create, get, list, exec, pause, resume, and delete.

```typescript theme={null}
const sandbox = await rt.sandbox.create({
  template: 'base-ubuntu',
  name: 'long-running-task',
});

await sandbox.waitForReady();
await sandbox.exec('npm install');
await sandbox.pause();

await sandbox.resume();
await sandbox.waitForReady();
```

```bash theme={null}
runtools sandbox pause long-running-task
runtools sandbox resume long-running-task
```

## Not Public

Named checkpoint, restore, and clone APIs are not supported in the current public SDK or CLI.

For durable work:

| Goal                         | Use                                                           |
| ---------------------------- | ------------------------------------------------------------- |
| Preserve an existing sandbox | `pause` and `resume`                                          |
| Preserve code                | Commit to git or mount a workspace                            |
| Recreate an environment      | Use `runtools.config.ts`, `sandboxes/*.ts`, and setup scripts |
| Run isolated experiments     | Create a new sandbox from the same template                   |
