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

@_mergescout/token-tracker

v1.3.0

Published

Track Claude Code token usage per developer and per model. Reports locally or to a Merge Scout dashboard.

Readme

@_mergescout/token-tracker

CLI that tracks Claude Code token usage per developer and reports it to a Merge Scout org.

Installed as a Claude Code Stop hook — parses the session transcript when Claude Code exits and POSTs token counts (input, output, cache read, cache create) to Merge Scout. Also keeps a local JSONL log so summary works offline.

Previously published under the name llm-token-tracker. That name is now taken by an unrelated MCP-server package; this one moved to @_mergescout/token-tracker and the executable renamed to mergescout-token-tracker. If you had the old version installed, uninstall it first: npm uninstall -g llm-token-tracker.

Prerequisite — set your git identity globally

The CLI uses git config --global user.email to attribute each Claude Code session to a Merge Scout user. Set this before running setup or the hook silently drops every record. Use the email you sign into Merge Scout with.

git config --global user.email "[email protected]"
git config --global user.name  "Your Name"

setup hard-fails with clear instructions if this isn't set. setup --remote <KEY> and the standalone diagnose command verify that the email resolves to an actual Merge Scout user.

Install

# Using bun (recommended)
bun install -g @_mergescout/token-tracker

# Or using npm
npm install -g @_mergescout/token-tracker

Setup (one-time)

# Install the Claude Code hook (fails fast if git email isn't set globally)
mergescout-token-tracker setup

# Connect to Merge Scout (admin issues the key in Settings → Token Tracker)
# Also auto-runs an end-to-end check reporting auth, email attribution, and repo scope
mergescout-token-tracker setup --remote ms_abc123...

After that, every Claude Code session reports token usage automatically.

Scope: only sessions whose working directory is a clone of one of the org's selected GitHub repos are recorded in the Merge Scout dashboard. Sessions in other directories (side projects, personal repos, non-git dirs) are kept in the local log but dropped by the server. Adjust the selected set under Settings → GitHub Connection.

Commands

mergescout-token-tracker setup              Install the Claude Code Stop hook (requires global git email set)
mergescout-token-tracker setup --remote <KEY>   Connect to Merge Scout with an org API key + auto-diagnose
mergescout-token-tracker diagnose           Full end-to-end check (hook, auth, email, repo scope)
mergescout-token-tracker track              (internal — invoked by the hook)
mergescout-token-tracker summary            Show local usage summary (today)
mergescout-token-tracker summary --week     Last 7 days
mergescout-token-tracker summary --month    Last 30 days
mergescout-token-tracker summary --all      All time
mergescout-token-tracker summary --project <name>  Filter by project

Troubleshooting

If sessions aren't showing up in the Merge Scout dashboard, run mergescout-token-tracker diagnose from inside the repo where you work. It reports each link in the chain (hook installed, API key saved, git email set, email mapped to a Merge Scout user, repo in the selected-repos list) and prints a fix for any that fail.

Configuration

| File | Purpose | |------|---------| | ~/.claude/settings.json | Claude Code hook registration | | ~/.claude/token-tracker-config.json | Merge Scout API key | | ~/.claude/token-usage/usage.jsonl | Local usage log (offline backup) |

Environment variables

  • LLM_TOKEN_TRACKER_URL — override the Merge Scout server URL (default: https://mergescout.com). Useful for local development.

Privacy

Only token counts and session metadata (model, turns, git email, project basename, git remote owner/repo) are sent to Merge Scout. No prompt or response content ever leaves the machine.

Publishing

Published automatically by the publish-cli.yml GitHub Actions workflow whenever packages/token-tracker/** changes on the production branch and the version in package.json differs from the latest version on npm.

To cut a release: bump version in package.json, commit, push to production. The workflow handles the rest.

Development

Runtime dependencies: none (pure Node 18+).

The CLI is CommonJS JavaScript. No build step — what you see is what ships.