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

agstats

v0.0.3

Published

What your coding agents did, from their own transcripts — Claude Code, Codex CLI, Gemini CLI and more, side by side.

Readme

agstats

What your coding agents did, from their own transcripts — Claude Code, Codex CLI, Gemini CLI and Cursor, side by side.

npx agstats agents     # which agents are on this machine, and how much history each has
npx agstats hours      # how long they actually ran, per day
npx agstats blast      # what they did that cannot be undone

Every coding agent writes its transcript to disk. agstats reads all of them into one model, so the same metric comes out comparable across agents. Local files only, no network, zero dependencies. Node ≥ 22.13.

Agents

| agent | reads | |---|---| | Claude Code | ~/.claude/projects/**/*.jsonl (subagents included) | | Codex CLI | ~/.codex/sessions/**/rollout-*.jsonl | | Gemini CLI | ~/.gemini/tmp/*/chats/*.jsonl (+ legacy logs.json) | | Cursor | …/Cursor/User/globalStorage/state.vscdb (read-only, via node:sqlite) |

A missing agent shows as not installed, never as zero. Sessions a program wrote (a cron job, an a2a server) are flagged automated and left out of every metric unless --include-automated.

Commands

| command | answers | |---|---| | agents | what was found, where, how far back — and when Claude Code's cleanup deletes the oldest | | hours | agent-hours per day / month / project; --card, --svg for a share card | | tools | which tools fail and how often; --suggest clusters the causes | | blast | actions that escaped git and temp dirs — pushes, publishes, outbound calls | | leaks | secrets sitting in plaintext (exit 1 on findings, 3 if a source was unreadable); leaks scrub redacts them | | stats | prompts, replies, hours of day, tokens by model | | timeline | a calendar of the work and streaks | | quota | share of tokens per project against a budget | | diff | what one session changed: files, churn, commands | | skills | which Claude Code skills actually fire | | attention | how often you had to step in per errand | | overlap | the same file written by two sessions close together | | waits | time you waited for the agent, and the agent for you | | advise | what to change, from what was measured (changes nothing itself) | | guards | whether a hook you added stopped the failure — before vs after | | sends | what each request sent: real totals, cache split, estimated breakdown, overhead before your first message; --by-agent compares agents |

Every command takes --json, and a period: --today, --week, --month, --days N, --all, --since YYYYMMDD, --until YYYYMMDD (leaks picks files by modification time, so it takes a start but refuses --until). --dir claude=/some/copy reads a copy instead of the live directory. --archive [dir] also reads a cclogsall backup of Claude Code sessions (default ~/.cclogsall), so metrics reach past the cleanup; a session still live is read from there.

How hours are measured

Gaps between consecutive transcript entries are summed, and any gap over 60 seconds is dropped: a working agent writes every few seconds, so a minute of silence means it stopped (or sat on a permission prompt). Parallel agents add up; wall-clock time is shown beside them.

Limits

  • The only writes are hours --svg, quota --set/--clear and guards add/rm (under ~/.agstats/), and leaks scrub, which asks first and keeps a backup.
  • History is only as long as each agent keeps it (Claude Code: 30 days by default — agents says when the next deletion is due, and --archive reads past it).
  • sends totals are the providers' own usage figures; the breakdown is estimated from bytes (~4/token), and "invisible" (system prompt, tool definitions) is the remainder. Claude's attachment lines (skill listings, MCP instructions, reminders) count as injected context when they record the text they sent (Claude Code 2.1.263+); older ones stay in the remainder. Cursor shows totals only: whether its token count is per request or per turn is undocumented, so its breakdown is n/a. --by-agent compares interactive sessions; headless runs (claude -p, codex exec, CI) are separate rows, and a row shows medians only from 20 sessions that recorded usage (--min-sessions N). An agent that records no usage shows not recorded.
  • attention flags are regex heuristics (English and Japanese) — read them as a trend.

As a library

const { readers, model, metrics } = require('agstats');
const found = readers.readAll({ sinceMs: Date.now() - 86400000 });

License

MIT