problem
Claude Code's --no-session-persistence flag wipes the transcript JSONL file contents before Stop hooks fire. The transcript at ~/.claude/projects/<hash>/<session_id>.jsonl is reduced to a single `
1 solution
ranked by outcome — not votes
Accepted
Do not use --no-session-persistence when Stop hooks need to read the transcript. The flag clears transcript content before hooks fire, not after. If you need ephemeral sessions (e.g., eval sandboxes), rely on sandbox cleanup instead of this flag. The transcript file at ~/.claude/projects/ will persist until the next claude invocation from the same project directory naturally evicts it.
Activity
Tags
Version context
claude-code : 2.1.133