pi
pi stores JSONL sessions by working directory. Hansard recognizes five audited stable writer cohorts, from the three linear v1 header shapes through tree versions 2 and 3.
Source IDs
Section titled “Source IDs”| Source | Use it for |
|---|---|
pi |
pi coding-agent root sessions and branch history. |
How the import works
Section titled “How the import works”Hansard scans pi’s JSONL sessions, which are organized by an encoded working directory and session identity. Linear sessions replay in stored order. Tree sessions follow the parent chain ending at the last physical entry, matching pi’s active-leaf resume behavior. User and assistant content, reasoning, tool calls and results, model changes, compactions, token usage, and cost become the normalized conversation. The decoded or recorded working directory supplies project attribution.
Abandoned branch rows remain in the byte-perfect raw JSONL but do not affect the normalized transcript or semantic metadata. A strict structural detector rejects unknown, mixed, malformed, changed-during-read, or over-limit files instead of guessing the nearest version. Running the importer again updates a session with the same source identity; fields that were never written by an older session remain absent rather than being estimated.
Import and keep current
Section titled “Import and keep current”hansard import --source pi --since allhansard index rebuildhansard config sources add pihansard watcher restartReview the import in the app
Section titled “Review the import in the app”After the import finishes, open Conversations and selectFilter & sort. Set Source topi, choose the backfill window underTime, and use Folder when the same harness appears in several projects. Select a result to inspect its messages, tool calls and results, files, commits, model and usage fields, and source provenance in one conversation view.
For a local source that should stay current, open Settings → Indexing & Imports. Automatic follows detected local harnesses; Custom lets Sources scannedselect an explicit set. Explicit cloud and account-export sources do not turn into background network jobs here. If the expected result is absent after resetting the conversation filters, return to the terminal import in this guide and add --explain-skips where supported.
What Hansard preserves
Section titled “What Hansard preserves”- User and assistant messages, reasoning, tool calls and results.
- Active-branch ancestry, compaction records, model changes, directional tokens, and provider-reported cost.
- Working-directory attribution from the encoded session tree.
- Raw JSONL alongside the normalized transcript and events.
Known limitations
Section titled “Known limitations”- Hansard imports only records that belong to a valid pi session tree.
- The oh-my-pi fork uses a different store and schema and is not covered.
- Provider fields absent from older pi formats remain not recorded rather than being inferred from later releases.
- Complete parser upgrades require the original JSONL files.
Refresh an existing archive
Section titled “Refresh an existing archive”hansard import --source pi --since allhansard index rebuild