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

torta

v1.0.1

Published

See your AI usage as a pie chart 🍰 β€” Claude Code, Codex CLI and Gemini CLI, all in one terminal view.

Readme

torta 🍰

See your AI usage as a pie chart β€” for Claude Code, Codex CLI, and Gemini CLI, all in one terminal view.

torta means "cake" in Italian: usage, sliced.

It reads local session data those CLIs already write to disk β€” no API keys, no network calls, no telemetry, nothing sent anywhere.

🍰 torta β€” AI usage overview

Share of total tokens
   β–„β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„β–„     β–  Claude Code 90.8%
 β–„β–ˆβ–ˆβ–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„   β–  Codex CLI   9.2%
β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
 β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ
  β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€
     β–€β–€β–€β–€β–€

Claude Code
  β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„    β–  Input       0.0%
β–„β–ˆβ–ˆβ–ˆβ–€β–€β–€β–ˆβ–ˆβ–ˆβ–„  β–  Output      0.8%
β–ˆβ–ˆβ–ˆ     β–ˆβ–ˆβ–ˆ  β–  Cache read  97.1%
β–ˆβ–ˆβ–ˆβ–„   β–„β–ˆβ–ˆβ–ˆ  β–  Cache write 2.1%
 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€
   β–€β–€β–€β–€β–€
178.57M tokens Β· $87.66 Β· 10 sessions Β· last active just now

Codex CLI
  β–„β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–„    β–  Input      9.7%
β–„β–ˆβ–ˆβ–ˆβ–€β–€β–€β–€β–ˆβ–ˆβ–„  β–  Output     0.4%
β–ˆβ–ˆβ–ˆ     β–ˆβ–ˆβ–ˆ  β–  Cache read 89.8%
β–ˆβ–ˆβ–ˆβ–„   β–„β–ˆβ–ˆβ–ˆ  β–  Reasoning  0.1%
 β–€β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–€
   β–€β–€β–€β–€β–€
18.09M tokens Β· $4.93 Β· 3 sessions Β· last active 110d ago

Total: 196.66M tokens Β· $92.59 estimated

(a real run on a real machine β€” your numbers will differ)

Install

npx torta

or install it globally:

npm install --global torta
torta

Requires Node.js β‰₯ 22.

Usage

torta                                  # everything, all-time
torta --days 7                         # only the last 7 days
torta --provider claude                # just one provider
torta --provider claude --provider codex
torta --json > usage.json              # machine-readable, no UI

| Flag | Short | Description | | -------------------- | ----- | ---------------------------------------------------------- | | --days <n> | -d | Only include usage from the last n days (default: all time) | | --provider <name> | -p | Limit to claude, codex, and/or gemini (repeatable) | | --json | | Print machine-readable JSON instead of the interactive UI | | --version | | Show version number | | --help | | Show help |

Supported providers, and where their data comes from

There's no public "usage" API for any of these CLIs, so torta parses the session logs each one already writes locally:

| Provider | Reads from | Notes | | ---------------- | ------------------------------------ | ------- | | Claude Code | ~/.claude/projects/**/*.jsonl | Full token accounting (input/output/cache read/cache write) per message. | | Codex CLI | ~/.codex/sessions/**/*.jsonl and ~/.codex/archived_sessions/ | Full token accounting. Older Codex CLI versions (pre ~Sept 2025) didn't record token counts at all β€” those sessions are counted but contribute 0 tokens. | | Gemini CLI | ~/.gemini/tmp/**/ | Session/message activity is always shown. Token counts are not persisted locally by default in the Gemini CLI builds we tested against β€” torta reports it clearly with a warning instead of a fake $0. Enable gemini --telemetry --telemetry-target local if you want Gemini token data to exist on disk at all. |

Each provider's directory can be overridden with the same environment variable the underlying CLI itself uses: CLAUDE_CONFIG_DIR, CODEX_HOME, GEMINI_DATA_DIR.

A provider showing "(CLI not found on PATH)" just means the binary isn't currently installed β€” its historical usage data (if any) is still shown.

About the cost estimates

Costs are computed from a small built-in, static USD-per-million-token table (see src/pricing/index.ts) and are approximate β€” provider pricing changes over time and isn't fetched live. Unknown models are excluded from totals rather than priced at $0, so a total can be a partial sum. Treat the numbers shown as directional, not a bill.

Why this exists / what it isn't

There's already a much more complete tool for this β€” aiusage β€” with 20+ providers, a SQLite cache, sync backends, and a web dashboard. torta is the opposite: one screen, three providers, no persistence, no config. If you want daily/ weekly breakdowns, billing-window tracking, or historical trends, use ccusage instead.

Development

git clone <this repo>
cd torta
npm install
npm run typecheck
npm run build
node dist/cli.js

See AGENTS.md for the full technical spec β€” exact on-disk JSON formats for each provider, the accounting rules (Claude is per-message, Codex is cumulative-per-session, Gemini is best-effort), and how to add a new provider.

License

MIT