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

@arraystar/tokenscope

v0.1.0

Published

Token usage dashboard for Claude Code & Codex CLI — visualize your AI coding costs

Downloads

109

Readme

TokenScope

Token usage dashboard for Claude Code and Codex CLI — visualize your AI coding costs.

Features

  • Multi-source: Supports both Claude Code (~/.claude/projects/) and Codex CLI (~/.codex/sessions/)
  • Token breakdown: Input, output, cache read/write per model
  • Cost estimation: Configurable pricing for 20+ models (Anthropic, OpenAI, Google, Zhipu, DeepSeek)
  • Per-session detail: Drill into individual sessions to see turn-by-turn usage
  • Skill analysis: See which Claude Code skills consume the most tokens
  • i18n: Chinese / English UI toggle
  • Zero config: Auto-detects installed tools and parses all available data

Quick Start

git clone https://github.com/yanxuwang/tokenscope.git
cd tokenscope

npm install

# Build & preview (ships with sample data)
npm run build && npm run preview

Open http://localhost:4173 in your browser — you'll see sample data.

To use your own data:

# Parse your Claude Code + Codex CLI data (overwrites sample data.json)
npm run parse

# Rebuild & preview with your data
npm run build && npm run preview

CLI Options

# Parse both sources (default)
npm run parse

# Only Claude Code data
node --experimental-strip-types src/cli.ts --claude

# Only Codex CLI data
node --experimental-strip-types src/cli.ts --codex

# Export data.json only, don't serve
node --experimental-strip-types src/cli.ts --json-only

Development

npm run dev        # Vite dev server with hot reload
npm run build      # Type check + production build
npm run preview    # Preview production build
npm run lint       # ESLint

How It Works

  1. Parser (src/parser/) reads raw JSONL session files from local disk
    • claude.ts — parses ~/.claude/projects/**/*.jsonl
    • codex.ts — parses ~/.codex/sessions/**/*.jsonl
  2. Orchestrator merges sessions into unified public/data.json
  3. Dashboard (React + Vite) reads data.json and renders interactive charts

Pricing Configuration

Click the gear icon in the dashboard header to configure model pricing. The dashboard ships with pricing for common models, but you can:

  • Map detected models to known pricing entries
  • Set custom pricing per model
  • Switch between USD and CNY

Requirements

  • Node.js 22+ (for --experimental-strip-types)
  • Claude Code and/or Codex CLI installed with session history

License

MIT