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

@mcig-ggg/pi-hud

v0.1.3

Published

HUD-style footer + bordered editor for pi: rounded box around the input (model · thinking · phase · ponytail · goal on top, cwd · git · duration on bottom) + single-line stats footer.

Readme

pi-hud

HUD-style footer for pi-coding-agent, inspired by claude-hud.

Replaces pi's default footer with a bordered editor + single-line status footer. The input box gets a rounded, left-aligned status border on top and bottom, and pi's footer slot shrinks to one stats line.

Layout

Top border (rounded) — runtime state

╭── π [model] [thinkingLevel] · phase · ponytail · goal ────────╮

Input rows — wrapped with on each side; the first row carries an inline prompt (wrapped rows pad to the same text column).

Bottom border (rounded) — session identity

╰── [cwd] · [git:branch] · [duration] ──────────────────────────╯

Footer (single line) — stats

Q0 | ctx ████░░░░ 45% (12.3k|200k) | $0.023 | ↑12k ↓2k | ↻ R W | Δcost

| Field | Source | Notes | | ---------- | --------------------------------------- | ---------------------------------------------- | | model | ctx.model.id | provider/id from active session | | cwd | ctx.cwd | truncated to last 2 segments if longer than 36 | | git branch | footerData.getGitBranch() | reactive via onBranchChange | | duration | session start timestamp | ticks every 30s | | context % | ctx.getContextUsage() | bar colored green/yellow/red at 70/85 | | cost | walk sessionManager.getBranch() | sums usage.cost.total | | tokens | same walk | input + output, arrows | | last tool | tool_execution_start event | shown for 30s after the tool finishes | | goal | goal_updated event (pi-goal) | 🎯 <objective> on line 1; ⏸ when paused, ⚠ when budget-limited; hidden when complete/dropped |

Slash command

/hud            # toggle
/hud on         # force enable
/hud off        # disable
/hud reload     # re-read config.json

Default state: enabled on first install.

Configuration

Create ~/.pi/agent/pi-hud/config.json to toggle individual fields:

{
	"enabled": true,
	"showModel": true,
	"showCwd": true,
	"showContext": true,
	"showCost": true,
	"showGit": true,
	"showDuration": true,
	"showLastTool": true,
	"showGoal": true,
	"contextWindowOverride": 1000000
}

See config.example.json in this folder.

Context window override

pi-hud discovers the model's window size through this fallback chain:

  1. ctx.getContextUsage().contextWindow (Pi's runtime value)
  2. ctx.model?.contextWindow (Pi's model metadata)
  3. contextWindowOverride from your config.json
  4. 200_000 (last-resort default)

For models that aren't registered in Pi's models-store.json (e.g. MiniMax-M3, which isn't listed even though you're using it), steps 1 and 2 will fall back to Pi's default. Set contextWindowOverride to the model's true context window so the ctx % bar reads accurately.

After editing the config, run /hud reload.

How it works

  • Lives at extensions/pi-hud/index.ts, loaded by pi's jiti runtime — no build step
  • Calls ctx.ui.setFooter(factory) to take over the bottom status slot
  • The factory captures the active ctx (session context) and recomputes the display on requestRender() — triggered by:
    • Git branch changes (via footerData.onBranchChange)
    • Wall-clock tick every 30s (duration timer)
    • Any other event that invalidates the footer (typed input, tool events)
  • /hud off calls ctx.ui.setFooter(undefined) to restore pi's default footer
  • Self-disabling safety: if config.enabled === false during a render, the factory calls setFooter(undefined) and the default returns cleanly

Limitations (v0.1)

  • Two lines only. No tool-activity list, subagent tracker, todos, rate limits, or compaction counter — those require either more event subscriptions or parsing transcript files (modeled on claude-hud's stream parser)
  • One fixed layout (no presets like claude-hud's Full / Essential / Minimal yet)
  • Cost only accumulates from completed assistant messages on the current branch
  • 30s wall-clock tick is best-effort; in suspended terminals setInterval may stall

Roadmap (v0.2+)

  • [ ] Presets: essential / expanded / compact via /hud preset <name>
  • [ ] Tool-activity row (running, completed, with counts)
  • [ ] Subagent tracker (model, description, elapsed time)
  • [ ] Compactions counter (from agent_end w/ reason: "compact")
  • [ ] Cache hit-rate display (usage.cache.read/write)
  • [ ] Optional title-bar companion extension for tmux / Ghostty users
  • [ ] CJK-aware width handling (already delegates to visibleWidth)