# persistSession Option

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

**Field:** Artificial Intelligence  
**Category:** Claude Agent SDK  
**Also known as:** persistSession, Agent SDK no session persistence, Claude Agent SDK persistSession

## Think of it like

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

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

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

## Common mistake

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

## Three principles

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

## Related terms

- [Session Transcript](https://learn.benibix.com/term/ai/session-transcript)
- [resume Option](https://learn.benibix.com/term/ai/resume-option)
- [--no-session-persistence Flag](https://learn.benibix.com/term/ai/no-session-persistence-flag)
- [SessionStore](https://learn.benibix.com/term/ai/session-store)

---

Source: https://learn.benibix.com/term/ai/persist-session-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.
