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

@modelstat/agent

v0.0.10

Published

modelstat companion — reads local AI-tool usage and ships tokenised events to modelstat.

Downloads

129

Readme

modelstat

See every AI token your team spends. Local companion for modelstat — reads the session logs your AI coding tools already write (Claude Code, Codex, Cursor, Cline, Continue, Aider, Windsurf, Zed, Copilot, Claude Desktop), tokenises events on-device, and uploads only metadata to your modelstat dashboard.

Your prompts never leave your machine. The agent uploads only token counts, model ids, timestamps, and a provider-assigned session id. Source is auditable on GitHub.

Install

The fastest way:

curl -fsSL https://install.modelstat.ai | sh

Or via Homebrew:

brew install modelstat/tap/modelstat
modelstat connect

Or via npm / pnpm / bun:

npm install -g @modelstat/agent && modelstat connect
pnpm add -g @modelstat/agent && modelstat connect
bun add -g @modelstat/agent && modelstat connect

modelstat connect installs a launchd user agent on macOS (at ~/Library/LaunchAgents/ai.modelstat.agent.plist) or a systemd user unit on Linux (at ~/.config/systemd/user/modelstat.service). The daemon starts automatically on login.

Requires Node 20+ (or skip Node entirely with the Homebrew route). macOS and Linux (x86_64, arm64) supported.

Commands

modelstat connect              # pair + install background service, then exit
modelstat status               # show pairing + service state
modelstat paths [--json]       # print state file + log paths + API URL
modelstat stop                 # stop and uninstall the service
modelstat scan                 # one-shot parse + upload of local JSONL
modelstat watch                # foreground watcher (no service install)
modelstat discover             # report detected tool installs + identities

Programmatic pairing (used by harness skills for OpenClaw, NanoClaw, etc.):

modelstat connect --json --no-browser

Emits one NDJSON event per line. Schema documented at integrations/harness-skills/modelstat-connect/README.md.

Shared state across install methods

Installing via both Homebrew and npm on the same laptop produces the same binary reading the same state file — on macOS that's ~/Library/Preferences/modelstat-agent-dev-nodejs/config.json. Your device UUID, bearer token, and pairing state persist across install methods. No duplicate devices on the server side either — the API upserts on (user_id, machine_id).

MCP server

Pair the agent, then install @modelstat/mcp to query your own spend from inside Claude Desktop, Cursor, Cline, Continue, or Zed:

# Claude Code
claude mcp add modelstat -- npx -y @modelstat/mcp

Full wire-up docs per client: https://modelstat.ai/mcp

Self-host

To point the agent at your own modelstat API (not the hosted SaaS):

export AGENT_API_URL=https://your-modelstat-api.example.com
modelstat connect

AGENT_API_URL can also be set persistently via .env or in the systemd/launchd unit.

Privacy

  • Agent reads local session logs written by the tools you use. Nothing is intercepted — the tools already write these files.
  • Upload payload: token counts, model name, timestamps, provider-assigned session id, git remote URL (redactable), redacted work-type summary.
  • Never uploaded: prompt text, model responses, file contents, tool-call arguments, environment variables, SSH keys, secrets.
  • Redaction is on-device via @modelstat/parsers.
  • Offline mode: buffered locally, uploaded when network returns. modelstat scan --dry-run for local-only analytics.

Pricing

  • Free: 100M tokens/month, 1 device, no card.
  • Team: $5/seat/month with 250M pooled tokens; overage at $25/billion.
  • Enterprise: SSO/SCIM, on-prem ingest, SLAs — contact [email protected].

License

Apache-2.0. Source at https://github.com/modelstat/modelstat/tree/main/apps/agent-dev.