Skip to main content

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 removes records before a chosen sequence number. Unlike retention, which is configured as a policy on a stream, trimming is an explicit operation.

Trim point

For fine-grained control, you can trim a stream up to a specific sequence number. All records before the trim point will be removed.
s2 trim s2://my-basin/my-stream 1000
Trimming is eventually consistent — trimmed records may be visible for a brief period. The effective trim point will be max(existing_trim_point, min(provided_trim_point, current_tail)), so you can’t trim past the end of the stream, and you can’t move the trim point backwards.
Trimming requires appending a trim command record.

See also

Trim with the CLI

Set a stream trim point from the command line.

Command records

See how trim directives are encoded as records.

Retention

Configure age-based deletion for older records.