[BUG] --no-session-persistence leaks ai-title stub to ~/.claude/projects

Resolved 💬 3 comments Opened Apr 23, 2026 by clement-micol Closed Apr 27, 2026

Summary

--no-session-persistence is documented as "sessions will not be saved to disk and cannot be resumed (only works with --print)", but the ai-title writer still writes a stub file to ~/.claude/projects/<encoded-cwd>/<uuid>.jsonl.

Reproducer

PROJ_DIR="$HOME/.claude/projects/$(pwd | sed 's|/|-|g')"
ls "$PROJ_DIR" > /tmp/before.txt 2>/dev/null

claude -p --no-session-persistence "Get the weather"

ls "$PROJ_DIR" > /tmp/after.txt
diff /tmp/before.txt /tmp/after.txt

Same behavior under --print.

A new <uuid>.jsonl appears (~120 bytes) containing a single line:

{"type":"ai-title","aiTitle":"<generated title>","sessionId":"<uuid>"}

The conversation transcript itself is correctly suppressed — only the ai-title writer ignores the flag.

Expected

No file written under ~/.claude/projects/… when --no-session-persistence is set.

Impact

Tools that fan out many --print subprocesses (e.g. multi-agent review runners) accumulate dozens of ~120-byte stub files per invocation, cluttering the session picker and ~/.claude/projects.

Environment

  • claude --version: 2.1.118
  • macOS 24.6.0 (Darwin)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗