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-usage-limit-tracker

v0.1.1

Published

Pi / oh-my-pi extension: per-subscription usage limit bars (Claude 5h/7d, ChatGPT Codex) with risk-aware smart color and pacing

Readme

usage-limit-tracker

A pi / oh-my-pi extension that shows a usage-limit bar for every subscription you are logged into — Claude (5h / 7d), ChatGPT Codex (5h / 7d), and any other OAuth provider oh-my-pi reports on.

usage-limit-tracker widget

One line per subscription, below the editor. Colors reflect risk, not raw percent:

  • marks how much of the window has elapsed. Fill left of the tick = under pace.
  • Color = risk of hitting the limit before reset. It combines how full the bucket is, your projected finish at the current rate, and how far ahead of linear pace you are. Early-window bursts are damped.
  • chill / on track, warning / hot.
  • Palette is muted by default (sage → amber → dusty red). vivid and pastel are available.

Install

oh-my-pi

omp install npm:pi-usage-limit-tracker

omp install needs bun on your PATH for npm sources. Without it, clone this repo and run omp plugin link ./usage-limit-tracker.

Or install through the omp marketplace (no bun needed):

/marketplace add mattstrayer/usage-limit-tracker
/marketplace install usage-limit-tracker@usage-limit-tracker

Pick one install path. Both register /limits, so installing both loads the extension twice.

pi

pi install npm:pi-usage-limit-tracker      # or: pi install git:github.com/mattstrayer/[email protected]

Or copy index.ts + src/ into ~/.pi/agent/extensions/usage-limit-tracker/ (pi) or ~/.omp/agent/extensions/usage-limit-tracker/ (omp).

No runtime dependencies. Node 22+ (the host runs TypeScript directly).

Where the numbers come from

| Host | Primary | Fill-in | |---|---|---| | oh-my-pi | Rate-limit response headers on every reply | authStorage.fetchUsageReports() — omp's own usage subsystem, covers every logged-in provider | | pi | Rate-limit response headers on every reply | GET api.anthropic.com/api/oauth/usage and GET chatgpt.com/backend-api/wham/usage with the OAuth tokens pi already holds |

Headers: anthropic-ratelimit-unified-{5h,7d}-{utilization,reset} and x-codex-{primary,secondary}-{used-percent,window-minutes,reset-at}.

When a provider reports several buckets, each bar gets a suffix: 7d·opus (model tier), 7d·google (family from the provider's label), or an id segment as a last resort. Buckets without a reset time show a plain gauge with no countdown; the extension never invents one.

Polling runs at start and every 5 minutes; the display re-renders every minute so countdowns move. Bars for a provider appear as soon as any data arrives. API-key logins do not expose quota, so they show nothing.

Commands

The command is /limits, not /usage — oh-my-pi already ships a built-in /usage (show / reset).

| Command | Effect | |---|---| | /limits | Refresh now and print a plain-text breakdown with the data source | | /limits toggle | Hide / show the widget | | /limits palette muted\|vivid\|pastel | Switch colors |

Env: USAGE_LIMITS_HIDDEN=1 starts hidden. USAGE_LIMITS_PALETTE=vivid sets the palette. USAGE_LIMITS_DEBUG=1 logs provider/limit ids to stderr (never tokens).

Development

npm test        # node --test, zero deps
npm run demo    # print sample lines
npm run svg     # regenerate docs/demo.svg (README image)
omp -e ./index.ts   # or: pi -e ./index.ts

Layout:

  • src/smart-color.ts — risk model, palettes, HSB ramp (pure)
  • src/render.ts — bar/line rendering (pure)
  • src/sources/ — header parsers, Anthropic + Codex usage APIs, omp report adapter
  • src/store.ts — per-provider merge
  • src/extension.ts — host wiring (events, widget, timers, /limits)

Adding a provider: write a parser that returns a Subscription (src/types.ts) and call store.upsert from a header hook or the poll.

Related

  • The risk-based coloring is inspired by TokenEater, a macOS menu-bar usage monitor.

MIT