pi-session-kit

Pi extension for archiving, restoring, and importing coding-agent sessions

Packages

Package details

extension

Install pi-session-kit from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-session-kit
Package
pi-session-kit
Version
0.1.2
Published
Aug 16, 2026
Downloads
365/mo · 19/wk
Author
yaroshevych
License
MIT
Types
extension
Size
24.5 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./session-kit.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-session-kit

Pi extension for managing session storage:

  • Archive old Pi JSONL sessions as maximum-compression .jsonl.zip files.
  • Restore archived sessions so they appear in /resume.
  • Import Claude and Codex JSONL sessions into Pi format.

Install

pi install npm:pi-session-kit

Open the session kit with:

/session-kit

Menu

Session kit
├── Settings...
│   ├── Archive sessions automatically: OFF
│   └── Session age threshold: 7 days
├── Import sessions...
├── Restore sessions (N)
└── Archive old sessions (N)

Automatic archiving is disabled by default. When enabled, it runs in the background at session startup, at most once every 24 hours. The default threshold is 7 days and can be changed from Settings. Sessions newer than the threshold are never archived, including during manual archiving. The active session is always skipped.

Archives remain alongside their source session as <session>.jsonl.zip. The source JSONL is removed only after compression succeeds. Existing archives are never overwritten. Restoring sessions makes archives from the current project available to /resume.

Supported sources

  • Claude: ~/.claude/projects/**/*.jsonl
  • Codex: ~/.codex/sessions/**/*.jsonl
  • Pi: ~/.pi/agent/sessions/**/*.jsonl

Imports are best-effort and preserve user/assistant text, timestamps, working directory, and source modification time. Tool events and provider-specific metadata are not fully represented. Importing the same source again does not update an existing imported session.

Requirements

  • Pi with @earendil-works/pi-coding-agent and @earendil-works/pi-tui.
  • The zip and unzip command-line tools available on PATH.

License

MIT