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

claude-usage-tray

v0.3.0

Published

Windows system tray icon showing Claude Code session + weekly usage percentages.

Downloads

506

Readme

claude-usage-tray

Windows system tray indicator for Claude Code session + weekly usage %. Live color-coded dot next to your clock, local SQLite history, interactive stats.

MIT License npm Windows


What it does

  • 🟢 Colored dot in the Windows tray that reflects your current 5-hour session usage (🟢 <50% → 🟡 50–80% → 🟠 80–95% → 🔴 >95%)
  • 🕑 Tooltip on hover: current session %, reset countdown, weekly % across all models
  • 📊 Stats report on right-click "View stats…": line chart of session % over time, hourly heatmap, velocity (%/h), ETA-to-100%
  • 💾 Local SQLite stores every snapshot — all your historical usage is yours
  • 🚀 Optional autostart with Windows (HKCU registry, no admin needed)

Quick start

npx claude-usage-tray

Or grab the binary directly from the Releases page.

How it gets the data

This tool reads your Claude Code CLI's local OAuth credentials (~/.claude/.credentials.json) and calls Anthropic's undocumented usage endpoint (the same one the Claude desktop app uses for the Settings → Usage view).

  • No new credentials — it piggy-backs on your existing Claude Code auth.
  • No data leaves your machine except the usage check itself, directly to api.anthropic.com.
  • No telemetry, no analytics server.

⚠️ The endpoint is undocumented. It may be removed or changed by Anthropic without notice. Rate limits are aggressive (~5 calls, then 429 for ~30 min) — polling is intentionally throttled to every 5 minutes.

Requirements

  • Windows 10 / 11 (Linux / macOS builds are best-effort)
  • Claude Code CLI installed and logged in (~/.claude/.credentials.json present)

Configuration

The first run creates %APPDATA%\claude-usage-tray\config.toml. You can edit:

api_poll_secs = 300          # minimum 300 — do not lower
local_poll_secs = 60
retention_days = 90
autostart = false
alert_threshold_pct = 90.0

Database lives at %APPDATA%\claude-usage-tray\usage.sqlite (WAL mode, readable by other SQLite tools).

Build from source

cargo build --release --bin claude-usage-tray
# Output: target\release\claude-usage-tray.exe

Architecture

  • crates/core — domain types, SQLite storage, OAuth fetch, analytics queries, HTML report generation. Pure Rust lib, UI-agnostic.
  • crates/tray — winit event loop + tray-icon integration, polling thread, tooltip/icon updates.
  • npm/ — thin Node wrapper that downloads the platform binary on install and spawns it via npx.
┌─ Main thread (winit event loop) ───────────────────────┐
│   TrayIcon + Menu + UserEvent dispatch                 │
└─────────▲───────────────────────────▲──────────────────┘
          │ UserEvent::Poller(snap)   │ Menu / Tray events
          │                           │
┌─────────┴───────────┐  ┌────────────┴────────────────┐
│ Update forwarder    │  │ tray-icon global channels   │
│ (update_rx → proxy) │  └─────────────────────────────┘
└─────────▲───────────┘
          │ PollerUpdate
┌─────────┴───────────────────────────────────────────────┐
│ Poller thread                                           │
│  - Fetch usage every ≥5 min (API)                       │
│  - Insert into SQLite                                   │
│  - Backoff exponentially on 429                         │
└─────────────────────────────────────────────────────────┘

License

MIT © 2026 Laurent Rochetta

Acknowledgments