Claude Code Leaderboard banner
grp06 grp06

Claude Code Leaderboard

Development community intermediate

Description

Track your Claude Code usage and compete on the global leaderboard! This CLI automatically monitors your token usage and posts your stats to the leaderboard after each Claude Code session.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

Claude Code Leaderboard CLI

Track your Claude Code usage and compete on the global leaderboard! This CLI automatically monitors your token usage and posts your stats to the leaderboard after each Claude Code session.

Quick Start

npx claude-code-leaderboard

Follow the setup prompts to authenticate with Twitter and start tracking your usage automatically.

How It Works

The CLI integrates with Claude Code's hook system to automatically track your usage:

  1. Automatic Setup: Installs a tracking hook in your Claude Code configuration
  2. Usage Monitoring: After each Claude Code session ends (STOP command), your token usage is collected
  3. Data Submission: Usage data is automatically sent to our backend service
  4. Leaderboard Updates: Your stats appear on the public leaderboard at claudecount.com

What Gets Tracked

  • Input tokens used
  • Output tokens generated
  • Cache creation/read tokens
  • Session timestamps
  • Model used (e.g., claude-sonnet-4)

Your actual prompts and responses are never collected - only usage statistics.

Understanding Claude Code Hooks

What Are Hooks?

Claude Code hooks are user-defined shell commands that execute automatically at specific points during Claude Code's execution lifecycle. They allow you to inject deterministic, programmatic actions directly into the agent's workflow - ensuring that key tasks always occur exactly when intended, rather than relying on the AI to remember to do them.

Hook Types

Claude Code supports hooks at different lifecycle events:

  • Start: When a Claude Code session begins
  • Stop: When a Claude Code session ends
  • PreTool: Before any tool or command is executed
  • PostTool: After a tool or command completes

How This Project Uses Hooks

This leaderboard CLI specifically uses a **Stop** hook, which means:

  • Every time you finish a Claude Code session (when Claude Code exits)

...