Skip to content
BENIBIX Learn

--no-session-persistence Flag

Also known as claude --no-session-persistence, CLAUDE_CODE_SKIP_PROMPT_HISTORY

It stops claude -p from saving the session to disk.

Think of it like

It is like you write on a board, then wipe it clean when you are done.

Example

Lucy's script asks Claude about files with customer data. She adds --no-session-persistence. Then no copy of the chat stays on the build box.

Why it matters

Runs on private data leave no chat behind on the machine.

Definition

--no-session-persistence stops claude -p from saving the session. Nothing goes to disk. So you cannot go back to it later. It only works in print mode. The CLAUDE_CODE_SKIP_PROMPT_HISTORY setting does the same in any mode.

Example code

bash
claude -p --no-session-persistence "Check this log for secrets"
Run once and keep no transcript.

Common mistake

Using it, then trying --resume. There is nothing saved to go back to.

Key takeaways

  1. 1
    Nothing saved. No transcript.
  2. 2
    No resume. Nothing to open.
  3. 3
    Print mode only. The env var works anywhere.

Learn it properly