Plane docs
Guides

Retention

Five windows, in days, per environment. An omitted one means unlimited.

await client.environments.update({
  slug: "dev",
  retention: {
    sessionEventsDays: 30,
    deliveredHooksDays: 7,
    deadHooksDays: 30,
    spansDays: 14,
    usageRollupDays: 400
  }
})

An omitted field means unlimited, never "off" — the only safe reading on a setting that deletes things. {} is a complete policy, and 0 is legal and means "at the next pass", which is what a development environment that keeps almost nothing wants.

WindowDefaultWhy
deliveredHooksDays7Operational exhaust.
deadHooksDays30Exhaust, kept longer because somebody may still want to redeliver.
spansDays90Exhaust.
sessionEventsDaysunlimitedA pruned session cannot be resumed: the prompt is folded from the log and nothing else.
usageRollupDaysunlimitedIt is the billing record.

What it never touches

  • A live session. Pruning underneath a running turn would make the next model request wrong rather than merely losing history.
  • A pending hook delivery, however old. It is still going to be attempted, so it is not exhaust.
  • An archived environment. Archiving is what you do when you want the history kept and nothing written.

How you can tell

Nothing is appended to a log that is pruned — there is no session.pruned event, and there must not be: it would be the only row left, it would restart the age clock for every later pass, and it would be replayed into the prompt as if something had happened.

The record is a field instead:

const session = await client.sessions.get({ id })
session.eventsPrunedAt        // an empty transcript reads as a policy, not a bug

const trace = await client.traces.forSession({ id })
trace.prunedAt

The control plane's Environments page has the five windows with a one-click "keep very little" preset for a development environment.

On this page