Skip to content
BENIBIX Learn

SessionStore

Also known as sessionStore option, Agent SDK session storage, Claude Agent SDK SessionStore

An object you write that keeps saved chats off the local disk.

Think of it like

It is like saved games kept online, so any box can load them.

Example

Leo's agents run on many servers that come and go. He writes a store over Redis, so any server can pick up any chat.

Why it matters

Servers come and go, and a transcript on a dead server's disk is lost.

Definition

SessionStore is the Agent SDK interface for keeping session transcripts off the local disk, such as in a database or S3. You pass one to the sessionStore option. It needs two methods. append writes new parts of the transcript, and load reads them back. With a store, another server can resume a session that began somewhere else.

Common mistake

Expecting resume to work across servers without one. The default store is the local disk.

Key takeaways

  1. 1
    append and load. The two methods.
  2. 2
    Any backend. Database, S3, Redis.
  3. 3
    Resume anywhere. Across servers.