npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@timmyjl12/pi-session

v0.1.2

Published

A full-screen session browser overlay for the pi coding agent — prompt history, latest, per-project and all sessions with a live preview pane, a transcript viewer, and one-key session loading.

Downloads

753

Readme

@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