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

# Trimming

> Trimming lets you explicitly discard older records without changing a stream's retention policy.

## Trim point

Trimming removes records before a chosen sequence number, or the **trim point**. Unlike [retention](/concepts/configs#retention), which is configured as a policy on a stream, trimming is an explicit operation.

```bash theme={null}
s2 trim s2://my-basin/my-stream 1000
```

> Trimming involves appending a `trim` [command record](/concepts/command-records#operations).

The effective trim point will be `max(existing_trim_point, min(provided_trim_point, trim_command_seq_num + 1))`, so a trim command can trim through itself but not past itself, and it cannot move the trim point backwards.

<Note>
  Trimming is eventually consistent — trimmed records may be visible for a brief period.
</Note>

## Snapshots and compaction

[Snapshots](/concepts/snapshots) bound replay cost by materializing state at a cursor. Trimming can then discard records already covered by the snapshot, but it is optional for external snapshots when you want to keep the full stream history.

## See also

<CardGroup cols={3}>
  <Card title="Trim with the CLI" icon="terminal" href="/cli/trim">
    Set a stream trim point from the command line.
  </Card>

  <Card title="Command records" icon="binary" href="/concepts/command-records">
    See how trim directives are encoded as records.
  </Card>

  <Card title="Snapshots" icon="camera" href="/concepts/snapshots">
    Bound replay cost with snapshot-and-follow.
  </Card>

  <Card title="Retention" icon="clock" href="/concepts/configs#retention">
    Configure age-based deletion for older records.
  </Card>
</CardGroup>
