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

ai-agent-usage-analyzer

v1.0.1

Published

Unified AI coding assistant usage analyzer - supports Claude Code, Cursor, OpenCode, Codex CLI, Gemini CLI

Readme

ai-agent-usage-analyzer

Unified CLI tool that aggregates and analyzes AI coding assistant usage across multiple platforms. Tracks sessions, tokens, costs, tool usage, and code changes — then generates an interactive HTML dashboard.

Supported Providers

| Provider | Source | Tracks | |----------|--------|--------| | Claude Code | ~/.claude/projects/ | tokens, cost, tools, git branch | | Cursor | ~/Library/Application Support/Cursor/ | tools, code changes | | OpenCode | ~/.local/share/opencode/ | tokens, cost, code changes | | Codex CLI | ~/.codex/sessions/ | tokens, cost, tools | | Gemini CLI | ~/.gemini/tmp/ | tokens, cost, tools |

Providers are auto-detected based on what's installed on your system.

Install

# Global install
npm install -g

# Or run directly without installing
npx ai-agent-usage-analyzer

Uses better-sqlite3 (native) with automatic sql.js fallback if the native build fails.

Usage

# Today (default)
ai-agent-usage-analyzer

# Yesterday
ai-agent-usage-analyzer --yesterday

# Specific date
ai-agent-usage-analyzer --date 2026-03-08

# Date range
ai-agent-usage-analyzer --from 2026-03-01 --to 2026-03-09

# Current / previous month
ai-agent-usage-analyzer --this-month
ai-agent-usage-analyzer --last-month

# All time
ai-agent-usage-analyzer --all

# Filter by provider
ai-agent-usage-analyzer --provider claude-code,cursor

# Load all providers (even if not installed)
ai-agent-usage-analyzer --all-providers

# Import Cursor API usage CSV
ai-agent-usage-analyzer --csv ~/cursor-export.csv

# Custom output directory
ai-agent-usage-analyzer --output /tmp/my-report

Output

ai-usage-export/
├── report.html        # Interactive dashboard (auto-opens in browser)
├── exports/           # Plain text session transcripts
└── sessions/          # Individual HTML session pages

The HTML report includes:

  • Cost and token summaries per provider/model
  • Hourly and daily activity distribution charts
  • Tool usage breakdown
  • Filterable session table with search
  • Clickable session detail pages with full conversation transcripts

Pricing

Token costs are calculated using model pricing from OpenRouter. Pricing snapshots are cached in data/pricing-snapshots.json and auto-updated on each run when online.

License

MIT