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

codebrag

v0.1.6

Published

CLI tool for tracking Claude Code usage and leaderboard participation

Readme

Codebrag CLI

NPX package for tracking Claude Code usage and participating in the leaderboard with Twitter authentication.

Installation

npx codebrag

Usage

First Time Setup

# Run the CLI and follow the authentication prompts
npx codebrag

Commands

# Authenticate with Twitter
npx codebrag auth

# View your usage statistics
npx codebrag stats

# View the leaderboard
npx codebrag leaderboard

# View help
npx codebrag --help

Features

  • One-command setup: npx codebrag handles everything
  • Automatic hook installation: Token tracking is set up automatically on first run
  • Seamless Twitter Authentication: OAuth 1.0a skips login if you're already signed in
  • Usage tracking: Seamless integration with Claude Code
  • Leaderboard: See how you rank among other users
  • Real-time stats: View your usage statistics
  • Secure storage: Encrypted token storage

Requirements

  • Node.js 16.0.0 or higher
  • Claude Code with hook system configured
  • Twitter account for authentication

Configuration

The CLI automatically creates and manages ~/.claude/leaderboard.json with your authentication data and API endpoint configuration.

Development

# Install dependencies
npm install

# Run locally
npm run dev

# Test the CLI
node bin/cli.js --help

Environment Variables

Optional

  • ENCRYPTION_KEY: Key for encrypting stored tokens (default provided)
  • API_BASE_URL: Backend API URL (default: https://codebrag.example.com)

Support

If you encounter issues, please check:

  • Your internet connection
  • Backend API is running
  • Twitter app configuration is correct
  • Claude Code hook system is properly configured

How It Works

  1. Automatic Setup: On first run, Codebrag automatically installs a token counting hook
  2. Token Tracking: Every time you use Claude Code, your usage is tracked
  3. Authentication: Link your Twitter account to join the leaderboard
  4. Real-time Updates: Your stats update automatically after each Claude Code session

The hook is installed to:

  • ~/.claude/count_tokens.js - The counting script
  • ~/.claude/settings.toml & settings.json - Hook configuration
  • ~/.claude/leaderboard.json - Your authentication data

OAuth 1.0a Authentication

This CLI uses Twitter OAuth 1.0a authentication which provides:

  • Seamless login: If you're already logged into Twitter, you skip directly to authorization
  • No expiration: Tokens are valid indefinitely (until revoked)
  • Better for CLI tools: No need to refresh tokens
  • Simple setup: Just need consumer key and secret from Twitter Developer Portal