Fields
nintegerThis message's number in the session. rewind(n) goes back to just before it.
filesintegerHow many files the point records.
durationMsintegerHow long the snapshot took.
When it is emitted
Before your message is added to the conversation, so it records the workspace as it was — the state a rewind returns to. It is the first event of a run.
No event means no point
| Why there is none | Consequence |
|---|---|
The agent has no session (memory is off) | rewind() answers session_required |
checkpoints: false | rewind() answers checkpoints_disabled |
| It is a subagent | A subagent keeps none |
| The snapshot could not be taken at all | The run continues, and that message cannot be returned to |
Going back is a comfort, not a requirement — so a store that cannot be written is skipped in silence rather than failing the run. Listening for this event is how an interface knows whether « go back to here » can be offered.
What durationMs tells you
A snapshot is content-addressed, so an unchanged workspace is nearly free — only the list is new. A duration that grows steadily means a lot of changed content per message; one that is large from the start means a large workspace.
Offering it
const points = [];
onEvent: (e) => {
if (e.type === "checkpoint") points.push({ n: e.n, files: e.files });
};
// Later: await agent.checkpoints() for the full list, with what each one cannot undopoints = []
def on_event(event):
if event["type"] == "checkpoint":
points.append({"n": event["n"], "files": event["files"]})
# Later: agent.checkpoints() for the full list