Skip to content
BENIBIX Learn

persistSession Option

Also known as persistSession, Agent SDK no session persistence, Claude Agent SDK persistSession

The option that stops a session being saved. Then it cannot be picked up later.

Think of it like

It is like a chat on a board that is wiped at the end.

Example

Mia's agent handles private files for one request at a time. She sets persistSession to false so no transcript is left behind.

Why it matters

A saved transcript holds everything the agent read, and some jobs should leave no trace.

Definition

persistSession is a TypeScript option that turns off saving the session to disk. It is on by default, so each session writes a transcript under ~/.claude/projects. Set to false, nothing is written. Then the session cannot be resumed. Use it for one-off jobs, and where the disk must stay clean.

Common mistake

Turning it off and then trying to resume. With nothing saved, there is nothing to load.

Key takeaways

  1. 1
    On by default. Transcripts saved.
  2. 2
    false writes nothing. No resume.
  3. 3
    For one-off jobs. Clean disk.