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

# Start, stop, and delete computers

> Manage Celesto computer lifecycle with the SDK: create, stop, start, and delete workspaces so you can pause tasks, resume later, and free resources.

A Celesto computer is a workspace you can create for a task, stop when you are done for now, start again later, and delete when the work is finished.

Use the lifecycle when you want to control how long a workspace stays around. Lifecycle means the stages a computer moves through, from creation to cleanup.

## Create, stop, start, and delete

Create a computer when you need a clean workspace. Stop it to pause work and keep the files inside it. Start it when you want to continue. Delete it when you no longer need the workspace.

<CodeGroup>
  ```python Python theme={null}
  from celesto import Computer


  computer = Computer(template_id="coding-agent")
  print(computer.name)

  computer.stop()
  computer.start()
  computer.delete()
  ```

  ```ts TypeScript theme={null}
  import { Computer } from "@celestoai/sdk";

  const computer = await Computer.create({ templateId: "coding-agent" });
  console.log(computer.name);

  await computer.stop();
  await computer.start();
  await computer.delete();
  ```

  ```bash CLI theme={null}
  celesto computer create --template coding-agent

  celesto computer stop einstein
  celesto computer start einstein
  celesto computer delete einstein
  ```
</CodeGroup>

<Check>
  The same computer can stop, start again, and then be removed when the workspace is no longer needed.
</Check>

## Run work after a stop

The CLI can start a stopped computer automatically when you run a command or open a terminal. This lets you stop a computer between work sessions and continue from the same workspace later.

```bash CLI theme={null}
celesto computer run einstein "uname -a"
celesto computer ssh einstein
```

<Check>
  Commands that need a running computer can start the stopped computer before they run.
</Check>

## Read the computer status

Celesto computer responses include a `status` field. Status means the current stage of the computer, such as running, stopped, or deleted.

| Status       | Meaning                                                        |
| ------------ | -------------------------------------------------------------- |
| `creating`   | Celesto is preparing the computer.                             |
| `running`    | The computer can run commands and accept terminal connections. |
| `stopping`   | Celesto is stopping the computer.                              |
| `stopped`    | The workspace is saved and can be started again.               |
| `starting`   | Celesto is starting a stopped computer.                        |
| `restoring`  | Celesto is restoring a saved workspace.                        |
| `restorable` | Saved workspace state is available to restore.                 |
| `deleting`   | Celesto is deleting the computer and its resources.            |
| `deleted`    | The computer has been deleted.                                 |
| `error`      | The computer needs attention before it can be used.            |

## Resume agent work later

For OpenAI `SandboxAgent` workflows, you can save session state and resume it later. Session state means the saved details Celesto uses to reconnect the same agent to the same sandbox workspace.

<Tip>
  Use `delete_on_close=False` when you plan to resume an OpenAI sandbox session. Follow the complete example in [the OpenAI agent sandbox guide](/celesto-sdk/openai-agents#resume-a-session-later).
</Tip>

## Choose the right session pattern

Use these patterns to decide how long a computer should stay available.

| Pattern                    | Use it when you want to                                 |
| -------------------------- | ------------------------------------------------------- |
| Create, run, delete        | Start fresh for one task and clean up right away.       |
| Create, stop, start        | Keep files and installed packages between sessions.     |
| Existing computer ID       | Let a job or agent continue in a known workspace.       |
| Saved OpenAI session state | Resume an agent session with the same sandbox identity. |
