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

cc-statusline-simple

v0.1.3

Published

Minimal Claude Code status line: model-aware context %, cost, git status. No pets.

Readme

claude-statusline

Minimal Claude Code status line. No pets, no leaderboards, no sync:

Opus 4.7 │ Ctx 318.5K (31.9% / u 39.8%) │ $26.45 (1h0m) │ +12 -4 │ 5h 66% (2h37m) · wk 93% (3d7h) │ main ±3

| Segment | Source | | --- | --- | | Model | stdin model.display_name (or shortened model.id) | | Context | tail-scan of transcript_path jsonl; % computed against a per-model window table — Opus 4.6/4.7 and Sonnet 4.6 = 1M, Haiku 4.5 = 200K, family fallback otherwise. u is against 80% of the window (compaction-relevant). | | Cost + duration | stdin cost.total_cost_usd and cost.total_duration_ms (Claude Code's own numbers, not estimated) | | Edits | stdin cost.total_lines_added / total_lines_removed | | Usage quota | stdin rate_limits; 5h = 5-hour rolling window, wk = 7-day window. Shows remaining % (100 − used_percentage) and time-to-reset in parens. Only present for Claude.ai Pro/Max, and only after the session's first API response — hidden otherwise. | | Git | branch via git rev-parse --abbrev-ref HEAD; ±N = dirty file count, = clean |

Color thresholds on the Ctx value: green < 50% (usable), cyan < 80%, yellow < 95%, red otherwise. On the quota %: green > 20% remaining, yellow ≤ 20%, red ≤ 5%.

Why this exists

ccpet hardcodes the context window at 200K (line 2e5 / 16e4 in its bundle), so any session past 200K reads Ctx: 100.0% even though Opus 4.7 has a 1M window. The repo has been stale since 2025-08-30 and the bug isn't tracked. This is a strip-down replacement.

Install

npm install -g cc-statusline-simple

Then point ~/.claude/settings.json at the cc-statusline command:

{
  "statusLine": {
    "type": "command",
    "command": "cc-statusline",
    "padding": 0,
    "refreshInterval": 60
  }
}

Restart Claude Code (or open a new session) for the status line to appear.

refreshInterval (seconds) re-runs the command on a timer in addition to the event-driven updates, so the usage-quota countdown stays current while the session is idle. Drop it if you don't show the quota segment.

Usage-quota persistence

Whenever Claude Code supplies rate_limits, each render also writes the quota to disk so you can analyze it outside the status line:

| File | Contents | | --- | --- | | ~/.claude/cc-statusline/usage.json | Global "current" snapshot. Per window the freshest non-stale value wins, so a long-idle session can't clobber an active one. Written atomically. | | ~/.claude/cc-statusline/usage-<session_id>.jsonl | Per-session change history — one line appended only when that session's numbers change. The durable time series. |

rate_limits is account-global, but Claude Code hands each session the value from its own last API response. A long-idle session therefore reports a window that has already reset. Two rules keep the data honest:

  • Stale windows are dropped — any window whose resets_at_epoch is already in the past is neither shown nor persisted.
  • History is per-session — keyed by session_id, so concurrent sessions never interleave or race on one file.

Each record carries updated_at, session_id, plus per window used_percentage, remaining_percentage, resets_at_epoch, resets_at_raw, and resets_in_seconds. For a combined analysis across sessions, cat ~/.claude/cc-statusline/usage-*.jsonl. Writes are best-effort and never block or crash the status line.

From source

git clone https://github.com/ihainan/cc-statusline-simple.git
cd cc-statusline-simple
npm install
npm run build
# then set "command": "node /absolute/path/to/cc-statusline-simple/dist/cli.js"

Verify

npm run smoke

Spawns the CLI four times with synthetic payloads (Opus 4.7 / Haiku 4.5 / unknown model / no transcript) and prints each rendered line.

Extending

The whole thing is one ~200-line file (src/index.ts). Common edits:

  • New model windows — add to MODEL_WINDOW map.
  • Drop git — delete the readGitState block; saves a few ms per render.
  • More transcript stats (5h burn rate, cache hit %) — they're in readContextTokens's tail scan; aggregate while you're there.