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-xjh-package

v0.2.0

Published

Pi transcript utilities: persistent 'last instruction' bar with timestamp + compact stats footer (context / tok/s / turn timer). 会话增强:上次指令常驻条(带提问时间)+ 精简底部统计栏。

Readme

pi-xjh-package

License: MIT

Two small Pi (coding agent) UI extensions that make long sessions easier to read:

  1. x-last-task — a persistent bar above the input that always shows your latest instruction (so you never forget what you asked, even mid-agent or after interruptions). The top-right corner of the bar shows when you asked it (HH:mm:ss today, MM-DD HH:mm:ss on other days, full date across years). Refreshes the moment you send a message — no model calls, no timers, no token cost.

    The bar is session-aware: it resets on /new, re-reads the branch on /resume, /fork, /import, and follows branch switches from double-esc /tree navigation — never showing a previous session's instruction in a new one.

    After a questionnaire (any ask-style extension, e.g. ask_user_question), the bar switches to 📌 上次回答 showing question → answer — because at that point your old instruction is one turn stale. Cancelled/declined questionnaires keep the original instruction. The pane title mirrors the same text (上次指令: … / 上次回答: …).

    Nudge messages (继续 / 重试 / continue / retry …, whole-message match only) do not replace the bar — they carry no new instruction, so the bar would degrade into a useless "继续". Exception: if such a nudge is the very first message of the session, it is shown normally. Messages that merely start with those words (继续优化 README) still replace the bar.

  2. x-stats-footer — replaces Pi's built-in footer with a compact stats line:

ctx 23%/200k │ 128 t/s │ ⏱ 03:24        (provider) model
  • ctx: context window usage

  • t/s: token speed — live estimate while streaming (~ = estimated, EMA-calibrated against real usage per turn), measured value when idle

  • ⏱: full-turn timer from your last message to the final assistant reply (tool loops and retries do not reset it); ticks live while working

    The footer self-heals: Pi restores its built-in footer on every session replacement (/new, /resume, /fork, /import) and on /reload; this extension detects that and re-installs itself, so your footer no longer silently reverts to Pi's default.

Install

pi install npm:pi-xjh-package

Restart your Pi session (or /reload).

Usage

| Action | What it does | |---|---| | Send a message | "Last instruction" bar updates instantly with the new text + timestamp | | Answer a questionnaire | Bar switches to 📌 上次回答 with question → answer (plugin-agnostic) | | Send a nudge (继续, 重试, continue, …) | Bar keeps the previous real instruction (shown as-is only when it is the session's first message) | | /new | Bar is cleared; pane title returns to Pi's default | | /resume, /fork, /import | Bar re-reads the newly visible session branch | | double-esc → /tree | Bar follows the branch you switch to | | /x-last-task, /xtask | Re-assert / manually refresh the last-instruction bar (auto-recovery fallback) | | /x-stats | Toggle between the compact stats footer and Pi's official footer (remembered for the rest of the process) |

All UI copy is in Chinese by default (works fine on any locale).

How the session/reload edge cases are handled

Pi keeps the same extension module instance across session replacement (/new, /resume, /fork, /import) — it only re-imports modules on /reload — while at the same time wiping extension-provided UI (footer, widgets, pane title). Any extension that keeps "already installed" state must therefore treat session_start as an unconditional re-install point, and reset per-session state when the session identity changes. x-last-task compares sessionFile/sessionId and also listens to session_tree; x-stats-footer treats the disposal of its own footer component as the authoritative "Pi removed my footer" signal.

Diagnostics

x-stats-footer appends a few lines per session to ~/.pi/agent/tmp/x-stats-footer.log (footer installed / footer disposed by pi / session_shutdown:<reason>), which is the fastest way to tell what made the footer revert. Set PI_X_STATS_LOG=0 to disable it.

Security

Pi extensions run with full system access. These extensions make no model calls and perform no network I/O. x-last-task writes nothing; x-stats-footer writes only the small bounded diagnostic log described above (disabled with PI_X_STATS_LOG=0).

Requirements

  • Pi coding agent with an interactive (TUI) session; the extensions are inert in headless/RPC modes.
  • Node.js >= 20.

License

MIT