Skip to main content

TokenCat

TokenCat cat icon

PyPI License

See token usage and estimated costs across your coding agents and subagents. TokenCat reads local usage records from Codex, Claude Code, OpenCode, and Antigravity. Use the macOS app to follow usage as records arrive and explore task families, or the CLI to review a period and export JSON.

  • Follow a task and its subagents. In the app, expand recorded parent-child relationships and distinguish a task's own estimated cost from the cost of its whole family.
  • Understand the numbers. Explore usage by tool, model, project, and task; inspect cache usage, pricing coverage, unknown prices, and uncertain estimates.
  • Keep collection local and read-only. No provider credentials are needed for reporting. Session IDs are anonymized and project paths stay hidden by default.

Costs are API-equivalent estimates, not your bill or remaining subscription quota. App updates follow locally recorded usage; data can appear only after your coding tool writes it.

macOS app · Terminal CLI · Prices and privacy · Feedback and contributing

TokenCat macOS dashboard

Choose an interface

Both interfaces support Codex, Claude Code, OpenCode, and Antigravity. The app requires macOS 14 or newer. The CLI supports macOS and Linux with Python 3.9 or newer; Windows is not supported.

Interface Use it for Availability
macOS app Background monitoring, task trees, and interactive breakdowns Build from source
Terminal CLI Period reviews, provider filters, calendar grouping, and JSON exports PyPI release or source checkout

Starting with 0.9.0, the CLI provides local dashboards and JSON export. Remote aggregation, the older report/server commands, Gemini CLI, and GitHub Copilot are unavailable in these versions.

The app and CLI keep separate settings and usage histories; they do not automatically synchronize. To compare results, use the same source roots, time window, time zone, and pricing catalog. Previously collected history can still differ.

macOS app

Install from source

You need Rust and Xcode's Swift toolchain with the macOS 26 SDK or newer. The app runs independently of Python and pipx.

Clone this repository, then build and launch:

git clone https://github.com/xiaoran007/TokenCat.git
cd TokenCat
bash macos/scripts/build-app.sh
open build/TokenCat.app

The app is created at build/TokenCat.app. Move it to /Applications before enabling Launch at Login in Settings. To update, rebuild, quit the running copy, and open the new app.

Use the app

Click the cat in the menu bar to open the usage panel. Choose Today, 7 days, or 30 days, then open the dashboard for more detail.

In the dashboard you can:

  • Search models, projects, and tasks; sort by cost, tokens, or recent activity.
  • Switch the activity chart between recorded tokens and known API cost.
  • Open a task to inspect its own usage and related subagents.

For a task with recorded subagents, expand its row in Tasks and open the parent. Direct task cost shows that task's own usage; Task and subagents includes its descendants. Open a child to inspect its contribution. Relationships and usage depend on what the source records expose.

Open Settings with the settings button or Command–comma. Choose language, appearance, time zone, refresh interval, and source folders. English and Simplified Chinese are included. By default, the app waits two seconds after each refresh before scanning again and refreshes when the Mac wakes. This is near-real-time monitoring of local records, not token-by-token streaming from the provider.

Settings → General → Show today’s usage in menu bar optionally adds today’s cost or token count next to the cat icon. It is off by default. Enable it and choose Menu bar content → Cost or Tokens; both the switch and selection are saved.

In Settings → General → Menu panel style, choose System for a continuous panel or Glass cards for separate usage modules and a grouped action area. The choice is saved and applies immediately to the menu panel. Glass cards use Liquid Glass on macOS 26 or later, standard material on earlier versions, and opaque surfaces when reduced transparency or increased contrast is enabled. Dashboard and Settings keep their existing layouts.

Standard source locations are detected automatically:

Tool Default locations
Codex ~/.codex/sessions and ~/.codex/archived_sessions
Claude Code ~/.claude/projects and ~/.config/claude/projects
OpenCode ~/.local/share/opencode/opencode.db, honoring XDG_DATA_HOME
Antigravity conversations under ~/.gemini/antigravity and ~/.gemini/antigravity-cli

If your tools store data elsewhere, set their roots in Settings. Project paths stay hidden unless you enable them.

First run: use a supported coding tool under the same user account, then choose a TokenCat period containing that activity. You should see recorded tokens for that tool. Missing prices do not mean missing usage; check pricing coverage. If the panel is empty, check source roots in Settings and troubleshooting.

Terminal CLI

Install or upgrade

Install or upgrade from PyPI:

pipx install tokencat
# Update an existing installation:
pipx upgrade tokencat

To install from source, you need Python 3.9+, pipx, Rust, and a C compiler:

git clone https://github.com/xiaoran007/TokenCat.git
cd TokenCat
pipx install .

If TokenCat is already installed with pipx, use pipx install --force . from this checkout instead.

If you previously installed the candidate alongside TokenCat, remove that extra with pipx uninject tokencat tokencat-native. Use tokencat for the current CLI. Its first run copies saved candidate usage into the CLI data directory and keeps the original candidate ledger. An existing CLI ledger takes precedence.

Use the dashboard

After installing, run tokencat --since 7d. You should see recorded tokens, model totals, and pricing coverage for supported tools with local activity in that period. No provider login is needed for TokenCat. If the view is empty, check warnings, confirm you used a supported tool under this user account, and try --since 30d.

The CLI scans once per invocation. Use the app for automatic background refreshes.

tokencat                                      # Last seven days
tokencat dashboard                            # Also show recent sessions
tokencat --since 30d --weekly
tokencat --provider claude
tokencat --since 2026-10-01 --until 2026-10-03
tokencat --since 7d --json
TZ=America/New_York tokencat --since 7d

Use --daily, --weekly, or --monthly for calendar grouping, and --theme auto|light|dark for terminal colors. Repeat --provider to select several tools. Time windows use the system time zone; set TZ to choose another. --until includes the specified end time or the whole day for date-only values.

Standard source locations are detected automatically. Claude honors comma-separated roots in CLAUDE_CONFIG_DIR and XDG_CONFIG_HOME; OpenCode honors XDG_DATA_HOME. Run tokencat --help or tokencat dashboard --help for all options.

The CLI includes offline prices without automatic catalog downloads. Missing prices appear as unknown, and uncertain estimates appear as a range. Use --no-price to show usage without cost estimation. JSON exports anonymize session IDs and hide project paths; diagnostic warnings may include source file paths.

TokenCat terminal dashboard

Prices and privacy

Costs are API-equivalent estimates, not your bill or subscription balance. Unknown model prices remain unpriced. Ambiguous recorded usage favors the higher defensible estimate; requests missing from local logs cannot be counted. Usage without a confirmed date may contribute to a window's totals while remaining outside the calendar timeline; warnings explain this difference. Estimates do not include every billing tier, tool fee, or regional adjustment.

Both interfaces include offline prices and show pricing coverage and sources. The app checks for price updates every 24 hours by default; Settings offers manual refresh, other intervals, an off switch, and a custom catalog. Different catalogs, source roots, and independently saved history can produce different totals between interfaces.

Usage collection reads local records. TokenCat does not proxy requests, change provider endpoints, or read OAuth/session credentials for reporting. Reports exclude prompt and response bodies. App price updates and CLI version checks access the network.

Troubleshooting

A tool is missing or shows no usage. Make sure it has recorded local activity under the same user account. Check source roots in app Settings and warnings in the CLI output. For nonstandard CLI locations, CLAUDE_CONFIG_DIR accepts comma-separated Claude roots and XDG_DATA_HOME sets the OpenCode data location.

Costs look different from an invoice. TokenCat estimates standard API usage, including when a tool is used through a subscription. Check pricing coverage and unknown models before comparing totals. Updating the catalog can change estimates for earlier dates.

A native extension cannot be loaded. Reinstall TokenCat using a wheel matching your operating system and architecture. For a source installation, make sure Rust and a C compiler are available, then reinstall. TokenCat requires its native extension to collect usage.

Where is TokenCat's data stored? The app keeps usage and downloaded prices in ~/Library/Application Support/TokenCat/. The CLI keeps usage in ~/.tokencat/usage.sqlite3. Candidate history remains in ~/.tokencat-candidate/ after migration. Removing source logs does not erase already saved usage.

Feedback and contributing

  • Missing usage, unexpected totals, or installation trouble? Report a bug with your version, coding tool, time window, and time zone.
  • Did TokenCat help with a real task? Share your experience, including what was useful and where you got stuck.
  • Have a workflow in mind? Suggest an improvement with a concrete example.
  • Want to contribute? Start with the contributor guide for setup, code locations, and checks. Compatibility fixes, synthetic usage samples, interface improvements, and documentation are welcome.

English and Simplified Chinese are welcome. Review exports and screenshots for private file paths before sharing. Do not attach full logs, databases, credentials, or conversation bodies.

If TokenCat is useful to you, a GitHub star helps others discover it and lets you bookmark the project.

Metadata

Release files for tokencat 0.9.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tokencat 0.9.1
File Size Uploaded Provenance Actions
tokencat-0.9.1.tar.gz 261.2 kB With provenance Details for tokencat-0.9.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for tokencat 0.9.1
File Actions
tokencat-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for tokencat-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
tokencat-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for tokencat-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
tokencat-0.9.1-cp39-abi3-macosx_11_0_x86_64.whl CPython 3.9 abi3 macOS 11.0+ x86-64 Details for tokencat-0.9.1-cp39-abi3-macosx_11_0_x86_64.whl
tokencat-0.9.1-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for tokencat-0.9.1-cp39-abi3-macosx_11_0_arm64.whl

Total release size: 9.1 MB

Release files / tokencat-0.9.1.tar.gz

Download URL tokencat-0.9.1.tar.gz
Size 261.2 kB
Tags Source
SHA-256 checksum
How to use checksums
a101b5a8eea35da3f1b9be59fa0fec6cdac2ca4d7405f34d3a1d90f4ca0be15b
BLAKE2b-256 checksum
How to use checksums
39870b4bb6959432abadf120f272527cf8d8e5f181eefff164d3bdc96092e89d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / tokencat-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL tokencat-0.9.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.3 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0c730bbe4adb751faa91dfc02c61faea1511c5171c8b1f6135421e1c7df0d811
BLAKE2b-256 checksum
How to use checksums
b55931ae0f4f991ec72019f25b19e4e561e9ae610db7b6e4718c24551c8810d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / tokencat-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

Download URL tokencat-0.9.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Size 2.3 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
d3e0ac5fa5290241f80dade5a5e0b4cb70b71ff347f0a7dea52b7b0ebeb3a6fd
BLAKE2b-256 checksum
How to use checksums
3008a8e2f1a812f4ef2dee8d06ed6380e8935473a612ca10999e99f9cfbd627b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / tokencat-0.9.1-cp39-abi3-macosx_11_0_x86_64.whl

Download URL tokencat-0.9.1-cp39-abi3-macosx_11_0_x86_64.whl
Size 2.1 MB
Tags CPython 3.9 abi3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
b9fd5744cdf184ee2e886e566ef7094905ab45dda70e45f139159dbeb64e2731
BLAKE2b-256 checksum
How to use checksums
c263e3931c68df0fcc99bfaaaaa68cf1ac2363bfa1fe8d6e2e61d1fb5cd575da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Release files / tokencat-0.9.1-cp39-abi3-macosx_11_0_arm64.whl

Download URL tokencat-0.9.1-cp39-abi3-macosx_11_0_arm64.whl
Size 2.1 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
7aab2196eca71c3bdffec8edb95c4b84bdc9f6315a786efe2839d71af72dd0cc
BLAKE2b-256 checksum
How to use checksums
8a852e6126fd6c37f46f279b331c339d33b6114961478d83a6ad183dabe48b59
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

Security for tokencat 0.9.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for tokencat-0.9.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 13, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page