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-cleanup

v0.1.0

Published

Manual janitor for ~/.pi cruft: DS_Store, dead context-mode stats-pid files, empty session dirs, idle sessions, and stale subagent run-N artifacts. Complements pi-delete-session.

Readme

pi-cleanup

A manual janitor for the Pi coding agent that removes ~/.pi cruft pi-delete-session does not cover.

/cleanup scans, shows a categorized dry-run report, and deletes only after you confirm.

What it cleans

| Category | Rule | |---|---| | .DS_Store | All under ~/.pi (regenerable) | | context-mode dead stats-pid-*.json | PID no longer alive — ESRCH only, never EPERM (so PID 1 and foreign-owner PIDs are kept) | | empty session dirs | Top-level ~/.pi/agent/sessions/<project>/ with zero entries | | idle sessions | Session .jsonl + sibling artifact dir whose last activity (mtime) is older than 14 days | | stale subagent run-N/ | run-N dirs older than 7 days, excluding those under idle sessions (removed with the session) |

What it never touches

  • npm/node_modules, .git, git-installed packages
  • the intercom broker (broker.pid / broker.sock)
  • the current session and its sibling artifact dir
  • context-mode FTS5 *.db / *.db-wal / *.db-shm — use ctx_purge for those
  • run-history.jsonl

Install

pi install git:github.com/crayonlu/pi-cleanup

Then /reload in Pi, and run:

/cleanup

Safety

  • Dry-run first. /cleanup builds a report and asks for confirmation before deleting anything.
  • Self-test on every run. Asserts the liveness probe semantics (ESRCH = dead, EPERM = alive) before scanning, so PID reuse and unsignalable system PIDs can't cause false deletions.
  • Non-interactive = report only. When there's no TUI (print/JSON mode), it prints the report and deletes nothing.

Configuration

Age thresholds are constants at the top of extensions/cleanup.ts:

const IDLE_AGE_MS = 14 * DAY_MS;   // sessions idle longer than this are flagged
const STALE_AGE_MS = 7 * DAY_MS;   // subagent run-N dirs older than this are flagged

License

MIT