pi-session-logs Query pi agent session logs stored as JSON Lines ( ) files in . Each line is a JSON object representing a session event. Define the Helper Function Entry Types - session — metadata (version, id, timestamp, cwd) - message — user or assistant messages with content and tool calls - model change — provider/model switches - thinking level change — thinking level adjustments - custom message — hook output/errors, VCS notifications - compaction — context summary when session was truncated Loading & Filtering Finding Tool Calls Extract all tool calls from assistant messages: Hook Erro…