Install ctx on the machine where Pi has local session history:
curl -fsSL https://ctx.rs/install | shSee Install for setup and data-root details.
ctx can import Pi local JSONL session history when the supported file exists. Once imported, those sessions become searchable from the same CLI that Claude Code, Codex, Cursor, and other agents can run.
Import Pi history
The normal first-run path is enough for most machines:
ctx setupTo target Pi directly:
ctx import --provider pi
ctx sources --jsonctx sources --json shows whether Pi is supported by ctx and whether local Pi history is available to import on this machine.
Ask an agent to use Pi history
Use this when a later agent may need a decision or note from an earlier Pi session:
Use ctx to search prior Pi sessions before you answer.
Run:
ctx search "<focused query>" --provider pi --json
Inspect the best match:
ctx show event <ctx-event-id> --window 3
or:
ctx show session <ctx-session-id> --mode lite
If you use retrieved history, cite the `ctx_event_id` or `ctx_session_id`.Remove --provider pi when the same topic may have appeared in Claude Code, Codex, Cursor, or another supported agent.
Export when you need the full thread
Search and lite session views are usually enough for agent handoff. Use export when the full transcript needs to be attached to an issue or review:
ctx export session <ctx-session-id>Check exported transcripts before sharing them outside your machine.