Efficiently read and analyze pi agent session JSONL files. Use when asked to "read a session", "review a session", "analyze a session", "what happened in this session", "load session", "parse session", "session history", or given a .jsonl session file path.
Parse pi session JSONL files into readable output. Sessions live in ~/.pi/agent/sessions/<project>/ as .jsonl files.
ls -t ~/.pi/agent/sessions/*<project>*/*.jsonl | head -10
Always start with toc to get a numbered map of the session:
uv run ${CLAUDE_SKILL_ROOT}/scripts/read_session.py <path> --mode toc
This prints a compact numbered list of every user exchange with timestamps and tools used.
Default mode — shows only user messages and assistant text responses. Tool calls are hidden but hinted at with [used: tool1, tool2].
# Full conversation (default mode)
uv run ${CLAUDE_SKILL_ROOT}/scripts/read_session.py <path>
# Specific range
uv run ${CLAUDE_SKILL_ROOT}/scripts/read_session.py <path> --offset 5 --limit 3
# Search for specific topic
uv run ${CLAUDE_SKILL_ROOT}/scripts/read_session.py <path> --search "error"
See everything about a specific exchange — thinking, tool calls, tool results, costs:
uv run ${CLAUDE_SKILL_ROOT}/scripts/read_session.py <path> --mode turn --turn 7
| Mode | Shows | Use for |
|------|-------|---------|
| conversation | User + assistant text only (default) | Reading what happened |
| toc | Numbered exchange list | Navigation, finding the right turn |
| turn | Full detail for one exchange | Drilling into specifics |
| issues | Errors, failures, retries, user complaints | Finding what broke |
| overview | Metadata + exchange summaries | Quick session assessment |
| full | Everything including tool I/O | Deep debugging |
| tools | Tool calls and results only | Understanding agent actions |
| costs | Token usage and cost per turn | Cost analysis |
| subagents | Subagent task/status/cost/paths | Reviewing delegated work |
| Flag | Effect |
|------|--------|
| --offset N | Skip first N exchanges |
| --limit N | Show at most N exchanges |
| --turn N | Exchange number to drill into (with --mode turn) |
| --search TERM | Filter exchanges containing TERM (case-insensitive) |
| --max-content N | Max chars per block (default: 3000, 0=unlimited) |
--mode toc → scan the session, find interesting exchanges--mode turn --turn N → drill into specific exchanges--mode subagents → review delegated work and follow subagent session pathsSubagent session files can be read with the same script:
# From --mode subagents output, grab the JSONL path
uv run ${CLAUDE_SKILL_ROOT}/scripts/read_session.py <subagent-jsonl-path> --mode toc
Read ${CLAUDE_SKILL_ROOT}/references/session-format.md only if custom parsing is needed.
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer