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

pi-resume

v1.0.2

Published

Fast session resume for pi coding agent — /r1../r5 ranked instant resume, /rs paginated picker, /rds subagent session cleanup

Readme

pi-fast-resume

Fast session resume for pi coding agent without reading all .jsonl files.

Problem

Built-in /resume reads and parses every line of every session file to build the picker. With hundreds of sessions this is slow.

Solution

Commands that use stat() + lazy partial reads:

| Command | What it does | Speed | |---------|-------------|-------| | /r1/r5 | Instantly switch to the N-th most recent session (/r1 = latest) | <50ms (stat-only) | | /rs | Paginated picker: last 20, with tier navigation | <200ms first page | | /rds | Delete subagent session trees for the current project (with confirmation) | — |

Install

pi install npm:pi-fast-resume

Commands

/r1/r5 — Instant Ranked Resume

Switch to the N-th most recent session (by mtime) in one step. No picker, no parsing.

  • /r1 — most recent session
  • /r2 — 2nd most recent
  • … up to /r5 — 5th most recent

The current session is always excluded from the ranking, so /r1 reliably jumps to the previous session. If fewer sessions exist than the requested rank, a notice is shown and nothing is switched.

/rs — Smart Resume

Shows a paginated list of recent sessions:

  • Relative time (e.g., "2h ago"), file size, session name or first message
  • ▼ Load more... — next page within current filter
  • ▼ Show 14d — expand to 14 days
  • ▼ Show all — remove day filter entirely

Auto-escalates: if 7d is empty, jumps to 14d, then all.

Configuration

/rs set page 30    # Sessions per page (1-50, default: 20)
/rs set days 14    # Day filter for first tier (0-30, 0 = no filter, default: 7)

Config is stored in ~/.pi/agent/extensions/pi-fast-resume/config.json.

/rds — Delete Subagent Sessions

pi stores every subagent run under a subdirectory named like a top-level session (<timestamp>_<uuid>/), containing <runId>/run-N/session.jsonl. These accumulate on every subagent invocation and can bloat the sessions folder by hundreds of MB.

/rds scans the current project only, shows how many trees / runs / MB would be freed, asks for confirmation, then recursively deletes just those subagent tree subdirectories. Your real top-level *.jsonl sessions (the ones /r1/r5 and /rs list) are never touched.

How it works

  1. /r1/r5: readdirstat each .jsonl → sort by mtime → exclude current → switchSession(others[rank-1])
  2. /rs: Same stat scan, then read only the first ~50 lines of each file on the current page to extract session name and first user message

No full file parsing. No buildSessionInfo(). No reading message content beyond the first user message.

Development

git clone https://github.com/spex66/pi-fast-resume.git
cd pi-fast-resume
npm install
npm test

License

MIT