Skip to content
BENIBIX Learn

resume Option

Also known as Agent SDK resume, resume session ID, Claude Agent SDK resume

The option that loads an old session by its ID, with all of its past.

Think of it like

It is like loading a saved game by its name.

Example

Mia's app saves each user's session ID. When a user comes back the next day, she passes it to resume, and the agent remembers the work.

Why it matters

Users come back to old chats, and resume is how the agent remembers them.

Definition

resume is the Agent SDK option that loads a past session by its ID. You get the ID from the init message or the result message, and save it. The agent then has the whole earlier chat in its context. The session must be on the same machine, or in a session store, and the folder must match. resumeSessionAt can also load it at a set message.

Example code

typescript
query({ prompt: "Now add tests", options: { resume: sessionId } })
Go on with a saved session.

Common mistake

Resuming on another server. The transcript is on disk where it ran, unless you use a session store.

Key takeaways

  1. 1
    Load by ID. Save it first.
  2. 2
    Same machine and folder. Or a store.
  3. 3
    Full history. Back in context.

Compare