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.
Maintainers
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 tortaor install it globally:
npm install --global torta
tortaRequires 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.jsSee 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
