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

codex-limit

v1.0.0

Published

Lightweight CLI to check OpenAI Codex quota usage via local RPC. Zero CPU overhead — no daemon, no polling.

Readme

codex-limit

Check your OpenAI Codex CLI quota usage from the command line.

$ codex-limit
Codex Quota (plus)
────────────────────────────────────
Weekly:  7% used  (resets in 6d15h)  2% over pace
Burst:   2% used  (resets in 3h52m)  on pace

Why?

CodexBar is great but runs as a persistent macOS menu bar app at ~6% CPU — enough to prevent battery charge-hold on laptops.

codex-limit takes a different approach: on-demand, zero background CPU. It launches a short-lived codex app-server process, fetches quota via JSON-RPC, and exits immediately.

Install

npm i -g codex-limit

Or run directly without installing:

npx codex-limit

Requires Codex CLI to be installed and authenticated (codex login).

Usage

# Pretty-print quota summary
codex-limit

# JSON output (for scripting / statusline integration)
codex-limit --json

JSON output

{
  "limitId": "codex",
  "primary": {
    "usedPercent": 2,
    "windowDurationMins": 300,
    "resetsAt": 1773320436
  },
  "secondary": {
    "usedPercent": 7,
    "windowDurationMins": 10080,
    "resetsAt": 1773879554
  },
  "planType": "plus"
}
  • primary: Burst window (typically 5 hours)
  • secondary: Weekly window (7 days)

Claude Code statusline integration

You can display Codex quota in your Claude Code statusline. Add to ~/.claude/settings.json:

{
  "statusLine": {
    "type": "command",
    "command": "bash /path/to/your/statusline.sh"
  }
}

In your statusline script, cache the JSON output and read it:

CACHE="$HOME/.cache/codex-limit/quota.json"

# Background refresh if cache is stale (>180s)
if [ ! -f "$CACHE" ] || [ $(( $(date +%s) - $(stat -f%m "$CACHE") )) -gt 180 ]; then
  codex-limit --json > "$CACHE.tmp" && mv "$CACHE.tmp" "$CACHE" &
fi

# Read from cache
codex_used=$(jq -r '.secondary.usedPercent' "$CACHE" 2>/dev/null)

Programmatic usage

const { fetchQuota } = require("codex-limit");

const quota = await fetchQuota();
console.log(`Weekly: ${quota.secondary.usedPercent}% used`);

How it works

Codex CLI ships with an experimental app-server subcommand that exposes a JSON-RPC interface over stdio. This tool:

  1. Spawns codex app-server as a subprocess
  2. Sends initialize + account/rateLimits/read via JSON-RPC
  3. Parses the response and exits

The app-server internally authenticates with chatgpt.com using your Codex OAuth token (~/.codex/auth.json). No API keys or browser cookies needed.

Note: The app-server command is marked as [experimental] by Codex CLI. This tool may break with future Codex CLI updates.

License

MIT