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

# lifecycle — start, stop, reset, destroy

> Move a clone through its lifecycle without rebuilding it.

Four verbs control a clone after it's been spun. All take a clone `id` and fail
with `CLONE_NOT_FOUND` if it doesn't exist.

## reset

```bash theme={null}
asymmetric reset <id>
```

Returns a clone to a clean, seeded state **without a rebuild** — the fastest way
to start the next trial from identical input.

It drops the database (terminating live connections), recreates it, re-runs all
migrations, restarts the backend to rebind its connection pool, waits for health
(90s), and **re-applies the clone's last seed** if it had one.

```
  ✓ reset slack-a1b2 (dropped, re-migrated, re-seeded)
```

| Error                | Cause                                        |
| -------------------- | -------------------------------------------- |
| `CLONE_NOT_FOUND`    | No clone with that id.                       |
| `HEALTH_TIMEOUT`     | The backend didn't come back healthy in 90s. |
| `CLONE_START_FAILED` | A drop/recreate/migrate/restart step failed. |

## start

```bash theme={null}
asymmetric start <id>
```

Starts a previously **stopped** clone. Runs `docker compose up -d` with the
clone's saved ports and marks it `running`. Silent on success.

| Error                | Cause                  |
| -------------------- | ---------------------- |
| `CLONE_NOT_FOUND`    | No clone with that id. |
| `CLONE_START_FAILED` | `compose up` failed.   |

## stop

```bash theme={null}
asymmetric stop <id>
```

Stops a running clone **without destroying its data**. Runs `docker compose stop`
(volumes preserved) and marks it `stopped`. Silent on success. Bring it back with
`start`.

| Error                | Cause                  |
| -------------------- | ---------------------- |
| `CLONE_NOT_FOUND`    | No clone with that id. |
| `CLONE_START_FAILED` | `compose stop` failed. |

## destroy

```bash theme={null}
asymmetric destroy <id>
```

Tears a clone down completely: `docker compose down -v` (containers + volumes),
drops the database, frees its ports, and removes it from the registry.

```
  ✓ destroyed slack-a1b2
```

<Warning>
  `destroy` is irreversible. The database and all seeded data are dropped. Use
  `stop` if you only want to pause a clone.
</Warning>

| Error             | Cause                  |
| ----------------- | ---------------------- |
| `CLONE_NOT_FOUND` | No clone with that id. |

## How they relate

```
  spin ──▶ [running] ──stop──▶ [stopped] ──start──▶ [running]
              │                                          │
              │◀───────────────── reset ─────────────────┤  (clean + re-seed)
              │                                          │
              └──────────────── destroy ────────────────┘  (gone)
```
