Install
Install with PiG
pig install npm:@timmyjl12/pi-sessionInstall with Pi
pi install npm:@timmyjl12/pi-sessionPackages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.
Pi manifest JSON
The pi field of package.json.
{
"extensions": [
"./index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.1.1 (README.md). PiG does not review it.
@timmyjl12/pi-session
A full-screen session browser for the pi coding agent. Browse every past session, search your prompt history, read a whole transcript without leaving the overlay, and load any session with one key.
╭─ Sessions — Latest ─────────────────────────────────────────── 2,998 sessions · 62 projects ╮
│ │
│ Most recent sessions across every project │
│ ⌕ Search titles, prompts, folders, models… 50/50 · newest │
│ │
│ History 2,000 Latest 50 Project 40 Pinned 2 All 514 Settings │
├─ Sessions ─────────────────────────────────────┬────────────────────────────────────────────┤
│ ❯ ● Fix rounding in custo… extensions now │ Fix rounding in customer growth │
│ ★ Model picker polish extensions 2h │ D:\dev\extensions │
│ Deploy prefect flow prefect yesterday │ ★ pinned · 01a1e49f │
│ │ started 2026-11-16 08:50 · active now │
│ │ 4 prompts · 9 replies · 22 tool calls │
│ │ 182k tokens · $1.42 · 2.1 MB │
│ │ ── recent prompts ──────────────────────── │
│ │ › run the tests again 1m │
├────────────────────────────────────────────────┴────────────────────────────────────────────┤
│ ↑↓ move · enter read · ctrl+L load · Tab tab · ctrl+P pin · type search · esc close │
╰─────────────────────────────────────────────────────────────────────────────────────────────╯
Install
pi install npm:@timmyjl12/pi-session
Then run /sessions (or /session-browser) inside pi.
Tabs
| Tab | Shows |
|---|---|
| History | Every prompt you sent, newest first, across all projects (or only this one — see Settings). Enter opens the session scrolled to that prompt. |
| Latest | The most recent sessions across every project. |
| Project | Sessions started in the current folder. |
| Pinned | Sessions you pinned with ctrl+P. |
| All | Every session, grouped by project folder (ctrl+G flattens). |
| Settings | Options, plus rescan and rebuild of the index. |
The right-hand pane previews the highlighted session: folder, id, start and last-activity time, prompt / reply / tool-call counts, tokens, cost, file size, models used, its recent prompts and the last reply.
Keys
List
| Key | Action |
|---|---|
↑ ↓ PgUp PgDn Home End | Move |
Tab / shift+Tab (or → / ← when the search is empty) | Switch tab |
| type | Search (every word must match title, prompts, folder, id or model) |
Enter | Read the session in the viewer |
ctrl+L | Load the session now |
ctrl+P | Pin / unpin |
ctrl+S | Cycle sort (last activity, created, message count, cost) |
ctrl+G | Group / flatten the All tab |
F5 / ctrl+R | Rescan for changed sessions |
Esc | Clear the search, then close |
Viewer
| Key | Action |
|---|---|
↑ ↓ / j k, PgUp PgDn / space, g G | Scroll |
n / p (or ] / [) | Next / previous prompt |
Enter or ctrl+L | Load this session |
t | Tool output: first lines → full → hidden |
h | Show / hide thinking |
ctrl+P | Pin / unpin |
Esc, ← or q | Back to the list |
The viewer shows the session's active branch — the same conversation pi restores when you load it.
Loading uses pi's own session switch, exactly like /resume. If the agent is still working you are asked first
(turn this off in Settings). There is no keyboard shortcut on purpose: pi only lets commands switch sessions.
Settings
Stored in ~/.pi/agent/pi-session/settings.json (pi's agent directory, so PI_CODING_AGENT_DIR is respected).
| Setting | Default |
|---|---|
| Open on tab | Latest (or "Last used") |
| Sort sessions by | last activity |
| Group All by project | on |
| Latest tab size | 50 |
| History covers | every project |
| Hide empty sessions | on |
| Show subagent sessions | off — child sessions created by subagents (reviewer#1a2b3c4d) are hidden; pinned ones always show |
| Hide temp-folder sessions | on — sessions started under the system temp folder or /tmp (test runs, scratch) are hidden; pinned ones always show |
| Tool output in viewer | first lines |
| Show thinking in viewer | off |
| Confirm load while busy | on |
How it stays fast
pi's own session list reads every session file in full each time. With thousands of sessions that takes a while
(about 28 s for 3,000 sessions / 3.3 GB on the author's machine). pi-session keeps its own index in
~/.pi/agent/pi-session/index.json:
- Session files are append-only, so each file's entry remembers how many bytes it has read. A rescan reads only the bytes added since, and only for files whose size or modification time changed.
- Tool results and system prompts make up most of the bytes. Each line is classified from its first bytes, and only user and assistant messages, names and model changes are parsed.
- The overlay opens immediately on the cached index and refreshes in the background, newest files first.
On the same 3,000 sessions the first index build took about 7 s, and a reopen with nothing changed about 0.1 s. Use Settings → Rebuild index if the cache ever looks wrong.
Session files are only ever read — pi-session never edits, renames or deletes them.
Environment
| Variable | Effect |
|---|---|
PI_SESSION_GLYPHS=ascii | ASCII glyphs for terminals that draw ❯ ⌕ ▾ ⚙ two cells wide |
PI_SESSION_DIR | Where settings and the index cache are stored |
Development
npm install
npm run check # typecheck + tests
npm run preview # render every tab against synthetic sessions
npm run preview -- --real --plain # render against your real sessions (read-only)
License
MIT