Get an API key
Checkpoints

What a rewind cannot undo

The workspace goes back. The world does not. Five tools act beyond the machine, and a rewind names them instead of implying otherwise.

5 outside toolscredits are not refundedcompaction closes the door
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

The five that leave the machine

ToolWhat stays done
send_mailThe message is delivered.
deployThe site is online.
write_storageThe database or bucket is changed.
workflowA workflow was created, changed or run.
bashA command may have pushed, published or called anything.

Each one used after a point is recorded, and rewind() returns them as kept. The listing from checkpoints() carries the same thing per point as outside, so an interface can warn before the rewind rather than report after it.

const points = await agent.checkpoints();
const target = points.find((p) => p.n === 2);

if (target.outside.length) {
  console.warn("Going back will not undo:", target.outside.join(", "));
}
points = agent.checkpoints()
target = next(p for p in points if p["n"] == 2)

if target["partial"]:
    print("Some files could not be copied: going back will not restore them.")
# What went out (a sent message, a deploy) is never undone by a rewind.

Credits are not refunded

credits.spent says what the removed turns cost and credits.refunded is 0. The work was done and billed; a rewind is a change of mind, not a cancellation.

Compaction closes the door behind it

You cannot cut a conversation at a message that no longer exists

Compaction replaces the older part with a summary, so points before the first surviving message are forgotten rather than offered. Rewinding to one answers checkpoint_compacted and names what is still available.

The refusals

CodeStatusWhen
session_required400The agent has no session — memory: true is needed.
agent_running409It is answering. stop() first.
invalid_checkpoint400n is not a whole number of at least 1.
checkpoints_disabled400checkpoints: false.
checkpoint_compacted404That message was summarised away. The message names what is left.
checkpoint_not_found404No such message in this session.

And some files simply cannot go back

  • A file over 25 MB was recorded, not copied — skipped says so.
  • A workspace over 5 000 files makes the point partial.
  • A heavy folder that existed is left as it is, with whatever is now in it.
  • A file that cannot be written — locked, in use — is reported rather than retried.

All four land in files.skipped with a reason. A rewind that skipped nothing restored everything; one that skipped something says exactly what.