# resume Option

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

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** Agent SDK resume, resume session ID, Claude Agent SDK resume

## Think of it like

It is like loading a saved game by its name.

## 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

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.

## Example code

```typescript
query({ prompt: "Now add tests", options: { resume: sessionId } })
```

Go on with a saved session.

## Why it matters

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

## Common mistake

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

## Three principles

- **Load by ID.** Save it first.
- **Same machine and folder.** Or a store.
- **Full history.** Back in context.

## Related terms

- [continue Option](https://learn.benibix.com/term/ai/continue-option)
- [forkSession Option](https://learn.benibix.com/term/ai/fork-session-option)
- [SessionStore](https://learn.benibix.com/term/ai/session-store)
- [--resume Flag](https://learn.benibix.com/term/ai/resume-flag)

## Told apart from

- [continue vs resume (Agent SDK)](https://learn.benibix.com/compare/continue-option-vs-resume-option): People think continue and resume are two names for one thing. continue takes the latest session in the current folder, with no ID. resume takes the one session whose ID you pass, even an old one. Use continue when your app runs one chat at a time, and resume when it runs many.

---

Source: https://learn.benibix.com/term/ai/resume-option
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-20
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
