| name | pi-session-jsonl |
| description | Indexes, searches, inspects, and audits raw Pi coding-agent session JSONL files, including branches, compactions, tool-call/result links, failures, file activity, and unanswered turns. Use when summarizing, recovering, debugging, handing off, or locating exact evidence in `~/.pi/agent/sessions/**/*.jsonl` or another Pi session trace. |
| compatibility | Requires Node.js 22.18 or newer with built-in TypeScript type stripping. |
Pi Session JSONL
Treat a session as an evidence tree, not a flat transcript. Use the bundled TypeScript CLI to create a compact index, query narrow evidence, and open exact records only when needed.
Resolve the script
Use the absolute path to this skill directory from the read call that loaded SKILL.md:
node --experimental-strip-types <skill-dir>/scripts/pi-session-index.ts --help
Never copy the whole raw JSONL into model context.
Workflow
- For a quick active-branch check, run
overview.
- For a large, branching, or unfinished session, run
index with --scope all.
- Use
search to locate user requests, tool calls, failures, paths, validation markers, compactions, and summaries.
- Use
show with an entry ID, JSONL line, or tool-call ID to inspect exact evidence.
- Read generated Markdown chunks only for the semantic phases needed by the answer.
SCRIPT=<skill-dir>/scripts/pi-session-index.ts
SESSION=/absolute/path/session.jsonl
INDEX=/tmp/pi-session-index
node --experimental-strip-types overview
node --experimental-strip-types index --out-dir --scope all
node --experimental-strip-types search --query --regex -- 30
node --experimental-strip-types search --tool bash --failed-only -- 30
node --experimental-strip-types search --path -- 30
node --experimental-strip-types show --tool-call call_123 --raw