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

@tokn-ai/llm-tokei

v0.1.13

Published

Token usage stats CLI for local coding-agent sessions

Readme

llm-tokei

CI crates.io docs.rs License Rust Usage

See where your local coding-agent tokens went.

Website: agentic.tokn-ai.dev/llm-tokei

llm-tokei scans the session files already on your machine and turns them into fast, grouped usage reports: input, output, reasoning, cache tokens, sessions, turns, and estimated cost.

llm-tokei --cost-per provider --cost official --month -h

llm-tokei terminal table output

Why Use It

  • One report across agents: Codex CLI, OpenCode, Claude Code, GitHub Copilot Chat, GitHub Copilot CLI, and Pi Agent.
  • Useful default table: grouped by source and model, with cost columns included.
  • Time windows that match how people ask: --24h, --7d, --1m, --today, --week, --month.
  • Activity at a glance: hourly and daily plots for short windows, plus GitHub-style heatmaps for longer ones.
  • Cost visibility: bundled timestamp-aware price history works offline; llm-tokei update refreshes it.
  • Table and automation output: readable terminal tables or stable JSON for scripts.
  • Replayable transcripts: dump Codex and Copilot sessions into JSONL message streams.
  • Safe local reads: parses local files and opens OpenCode's SQLite database read-only.

Activity Graphs

Use llm-tokei graph for a GitHub-style calendar heatmap of the trailing year. Shorter ranges automatically switch to plots: hourly below 30 hours and daily for ranges up to 30 dates.

llm-tokei graph --format svg > activity.svg

Calendar heatmap

GitHub-style token activity calendar heatmap

Hourly and daily plots

| Hourly (--24h) | Daily (--month) | | --- | --- | | Hourly token activity plot | Daily token activity plot |

Install

npm i -g @tokn-ai/llm-tokei

Or install with Cargo:

cargo install llm-tokei

Or build a local binary:

cargo build --release
./target/release/llm-tokei --help

Quick Examples

# Default report: source x model
llm-tokei

# Human-readable numbers for this week
llm-tokei --week -h

# Last 24 hours by project
llm-tokei --24h --group-by project,source,model

# Top expensive sessions in the last 7 days
llm-tokei --7d --group-by session,source,model --sort cost --limit 10

# Daily trend for the current month
llm-tokei --month --group-by date,source --date-bucket day

# GitHub-style activity graph for the trailing year
llm-tokei graph

# Daily activity plot for a short range
llm-tokei graph --7d

# Hourly activity plot for a sub-30-hour range
llm-tokei graph --24h

# Native SVG activity graph
llm-tokei graph --format svg > activity.svg

# Set the SVG's default palette (it still adapts automatically)
llm-tokei graph --format svg --svg-theme light > activity.svg

# JSON for scripts
llm-tokei --7d --format json --group-by source,model,project

# Show input/output as bytes instead of tokens
llm-tokei --bytes

# Dump replayable messages
llm-tokei dump --codex ~/.codex/sessions/2026/05/12/rollout-example.jsonl
llm-tokei dump --copilot --out ./sessions-jsonl

Supported Sources

| Source | Default location | | --- | --- | | Codex CLI | $CODEX_HOME/sessions or ~/.codex/sessions | | OpenCode | $OPENCODE_DATA_DIR/opencode.db, $XDG_DATA_HOME/opencode/opencode.db, or ~/.local/share/opencode/opencode.db | | Claude Code | $CLAUDE_HOME/projects or ~/.claude/projects | | GitHub Copilot Chat | VS Code, Insiders, VSCodium, and Cursor workspaceStorage roots | | GitHub Copilot CLI | ~/.copilot/session-state | | Pi Agent | ~/.pi/agent/sessions |

Use --source and source path flags to narrow or override discovery.

Pi Agent support includes exact assistant usage records and estimated pi-web-access summary-review tool results when the plugin stores the curated search payload and summary metadata.

Learn More

Read the full usage guide: docs/usage.md.

The guide covers config defaults, periods, filters, grouping, table fitting, JSON output, pricing overrides, token semantics, source caveats, caching, and the dump subcommand.

To regenerate the showcase SVG from real CLI output:

cargo run --example gen-showcase -- --args "--cost-per provider --cost official --month -h" --out docs/assets/showcase.svg