# swarmops gc

> Release: 0.11.0 · Last changed: 2026-10-24 · Source: https://github.com/KeiaiLab/SwarmOps/blob/stable/docs/reference/commands/gc.md

Remove the store's leftovers: temp files past a day, a crashed create's staging, derived values of older versions, what an upgrade left. Never an object or a changeset.

```yaml
title: "swarmops gc"
description: "Remove the store's leftovers: temp files past a day, a crashed create's staging, derived values of older versions, what an upgrade left. Never an object or a changeset."
group: "integrity"
since: "0.4.0"
mutates: true
identity_required: false
mcp_tool: "gc"
envelope_op: "gc"
exit_codes: [0]
errors: []
syntax: "swarmops gc [OPTIONS]"
```

## Syntax

```text
swarmops gc [OPTIONS]
```

## Required arguments

None.

## Optional arguments

The command also takes the [global options](../cli.md#global-options).

### `--dry-run`

Syntax: `--dry-run`.

List what it would remove, and remove nothing.

## Examples

### CLI

No recorded example yet.

### MCP

No recorded example yet.

## Return information

`result` is a `GcResp` (`swarmops schema GcResp` prints its JSON Schema).

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `bytes` | `integer` | yes | The bytes of their files. |
| `orphan_objects` | `integer` | yes | How many object files no changeset of the store reaches: counted, never removed. |
| `removed` | `array of GcCount` | yes | How many leftovers of each kind; kinds with none are omitted. |

Envelope `op`: `gc`.

Exit codes:

- `0`: Success.

## Errors

No golden step shows this command failing yet.

Any command that opens a store may also fail with a store error, such as [`E_NOT_A_REPO`](../errors.md#e_not_a_repo), [`E_IO`](../errors.md#e_io) or [`E_STORE_CORRUPT`](../errors.md#e_store_corrupt); a command line the grammar refuses is [`E_INVALID_ARG`](../errors.md#e_invalid_arg) (exit 2).

## See also

- [`swarmops verify`](verify.md)
- [`swarmops repair`](repair.md)
- [CLI reference](../cli.md)
- [Error codes](../errors.md)
