# Reclaiming the disk your local platforms use

> Each local platform carries its own database, so they add up fast. This deletes the ones you are no longer using — showing you what it would remove before it removes anything.

<!-- id: local-reclaiming-local-disk · area: local · stability: stable · html: https://osysharp.com/reference/local/reclaiming-local-disk/ -->

## Summary        {#summary}

A local platform is created per project, on demand, and each one carries a full database of its own — a few hundred
megabytes. Over a few weeks of ordinary work that is tens of gigabytes of projects you have long since moved on from.
This deletes the ones that are no longer in use, and tells you first.

## Signature      {#signature}

```console
osy instances --prune [--yes] [--idle-hours <n>] [--json]
```

## Description    {#description}

**It is a dry run unless you pass `--yes`.** On its own it prints what it would delete, what that would reclaim, and —
just as usefully — everything it is KEEPING, with the reason for each. Read it, then re-run with `--yes`.

An instance is deleted when **both** are true:

- **nothing is running on it.** A platform whose server is still up is never touched, and neither is one whose state
  cannot be established — if it cannot be shown that nothing is running, it stays.
- **it has not been used recently.** A day, by default; `--idle-hours` changes the window.

Note what is *not* a condition: whether the project still exists. A checkout can live for months while you start
platforms in it several times a day, so keeping every instance of every live project would keep almost all of them. A
local platform is disposable by design — rebuilt from your source whenever a command needs one — so deleting one costs
a rebuild and nothing else. Nothing you would miss is stored there; your app's real data lives on the platform you
deploy to.

Everyday use needs none of this: starting a local platform reaps unused ones as it goes. The command is for when you
want to see the number, or clear space now.

[Listing your local platforms](https://osysharp.com/reference/local/listing-local-instances/) reports the total on disk every time you run it, so the figure is visible long before
it is a problem.

## Examples       {#examples}

```console
osy instances --prune              # what would go, and what stays — deletes nothing
```

```console
osy instances --prune --yes        # actually delete them
```

```console
osy instances --prune --idle-hours 4 --yes    # clearing space now
```

## See also       {#see-also}

[Listing your local platforms](https://osysharp.com/reference/local/listing-local-instances/) — what is on this machine, which are running, and how much disk it all takes.

[Stopping the local platform](https://osysharp.com/reference/local/stopping-the-local-platform/) — stop one that is running, so it becomes a candidate.

[The inner loop](https://osysharp.com/reference/local/the-inner-loop/) — where local platforms come from in the first place.
