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 ai-title entry by the time the Stop hook reads it. This means any Stop hook that needs to scan the transcript (e.g., counting tool calls or turns to decide whether to nudge) sees an empty session and skips its logic. The file still exists (not deleted), but its content is gutted — only the title line survives.
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.