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

tkusage

v0.1.6

Published

Unified local usage and cost estimation CLI for Claude Code, Codex, and OpenClaw

Readme

tkusage

Unified local usage reporting for Claude Code, Codex, and OpenClaw.

tkusage reads your local logs from ~/.claude/projects, ~/.codex/sessions, and ~/.openclaw/agents/*/sessions, builds a cache, and prints source-aware daily, monthly, session, and statusline reports. It does not depend on ccusage or @ccusage/codex at runtime.

tkusage demo

Why it exists

  • One CLI for Claude Code, Codex, and OpenClaw
  • Fully local reporting after install
  • Estimated USD output with embedded pricing tables
  • Daily output that merges the date column while keeping Claude and Codex separate
  • Normalized token columns so Claude and Codex rows are directly comparable
  • Fast warm-cache runs for bars and repeated checks

Install

# one-off
npx tkusage daily --source all

# bun users
bunx tkusage daily --source all

# global install
npm install -g tkusage

Quick start

# merged daily report
npx tkusage daily --source all

# date-filtered daily report
npx tkusage daily --source all --since 2026-03-01 --until 2026-03-09

Date filters

Use --since and --until to limit the report range:

npx tkusage daily --source all --since 2026-03-01 --until 2026-03-09

What it shows

  • daily: token and cost estimates grouped by day
  • monthly: the same rollup grouped by month
  • session: per-session usage and recency
  • statusline: a compact one-line summary for shell bars or window managers

Common flags

--source all|claude|codex|openclaw
--since YYYY-MM-DD
--until YYYY-MM-DD
--timezone America/Los_Angeles
--locale en-US
--json
--compact
--breakdown
--claude-home /path/to/.claude
--codex-home /path/to/.codex
--openclaw-home /path/to/.openclaw
--main-thread-only         # Claude only: exclude sidechains/subagents
--format plain|json   # statusline only

Example output

tkusage daily report
Selection: all
Pricing: Estimated USD using embedded Claude and Codex token pricing plus native OpenClaw session-log costs when available. Claude totals include sidechains/subagents by default unless --main-thread-only is set. Not a vendor billing statement.
Tokens: Input = total prompt input, Cached = cached subset of input, Output includes reasoning, Total = Input + Output.

┌────────────┬────────┬──────┬──────────────┬─────────────┬─────────────┬───────────┬─────────────┬─────────┐
│ Date       │ Source │ Sess │ Models       │       Input │      Cached │    Output │       Total │    Cost │
├────────────┼────────┼──────┼──────────────┼─────────────┼─────────────┼───────────┼─────────────┼─────────┤
│ 2026-03-07 │ Claude │   13 │ • opus-4-6   │  57,192,635 │  57,186,549 │   477,030 │  57,669,665 │  $72.43 │
│            ├────────┼──────┼──────────────┼─────────────┼─────────────┼───────────┼─────────────┼─────────┤
│            │ Codex  │    6 │ • gpt-5.4    │  38,799,713 │  36,998,144 │   302,821 │  39,102,534 │  $18.30 │
├────────────┼────────┼──────┼──────────────┼─────────────┼─────────────┼───────────┼─────────────┼─────────┤
│ 2026-03-08 │ Claude │    4 │ • opus-4-6   │   8,729,612 │   8,724,119 │    70,994 │   8,800,606 │  $10.56 │
│            ├────────┼──────┼──────────────┼─────────────┼─────────────┼───────────┼─────────────┼─────────┤
│            │ Codex  │    1 │ • gpt-5.4    │   9,237,933 │   8,838,400 │   107,986 │   9,345,919 │   $4.83 │
├────────────┼────────┼──────┼──────────────┼─────────────┼─────────────┼───────────┼─────────────┼─────────┤
│ Total      │        │      │              │ 333,038,959 │ 321,292,317 │ 2,565,045 │ 335,604,004 │ $259.03 │
└────────────┴────────┴──────┴──────────────┴─────────────┴─────────────┴───────────┴─────────────┴─────────┘

Data sources

  • Claude Code: ~/.claude/projects/**/*.jsonl
  • Codex: ~/.codex/sessions/**/*.jsonl
  • OpenClaw: ~/.openclaw/agents/*/sessions/*.jsonl

If you store logs elsewhere, use --claude-home, --codex-home, or --openclaw-home.

Cost model

  • Cost is an estimated USD equivalent derived from embedded token pricing tables for Claude/Codex
  • OpenClaw uses the native usage.cost.total value already stored in its session logs when available
  • Claude reports include sidechains/subagents by default; use --main-thread-only to restore the older main-transcript-only view
  • It is not your Anthropic invoice
  • It is not your ChatGPT subscription or Codex credits statement
  • It is not your OpenClaw vendor billing statement

Notes

  • Input is normalized to total prompt input for both sources
  • Cached is the cached subset of Input
  • Output includes reasoning tokens when the source exposes them
  • Total is Input + Output
  • Claude usage is deduplicated by requestId because transcript logs can repeat usage events
  • Claude request deduping also collapses duplicate request IDs that appear in both main and subagent transcripts
  • Codex usage is reconstructed from cumulative token snapshots, so repeated snapshots do not double count
  • OpenClaw usage is read from assistant message usage blocks and skips zero-usage/internal mirror events
  • The first run may take a while on large session folders because it builds the local cache

Development

cd tkusage
bun install
bun run test
bun run build
bun run demo

bun run demo regenerates the GIF used in the README at tkusage/assets/demo.gif.