Self-hosted service
xiufengsun/TokenTracker avatar
xiufengsun/TokenTracker

TokenTracker: A Local-First Token Meter for 34 AI Coding Tools

Project brief: Local-first AI token usage & cost tracker for 28 coding tools incl. Claude Code, Codex, Cursor, Gemini & Qoder-with native apps. Never reads prompts.

1,620 stars169 forksJavaScriptMIT

At a glance

What is it?
TokenTracker is an open-source, local-first dashboard that tracks token usage and cost across 34 AI coding tools, with native desktop apps and widgets. It auto-installs hooks, never reads prompts, and runs entirely without a cloud account.
Who is it for?
Adopt TokenTracker if you use multiple AI coding tools and want a private, zero-config way to track token consumption and costs without sending data to a cloud. Avoid it if you need deep per-prompt analytics or if you rely on unsupported tools.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 2 days ago.
What is it written in?
Mainly JavaScript, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 15, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

The Problem: Token Costs Are Invisible Across Many Tools

Developers using several AI coding assistants face a common accounting problem. Claude Code, Cursor, Gemini CLI, and a dozen other tools each track usage in their own way. Some store logs in SQLite databases, others in JSON files. None of them talk to each other. TokenTracker solves this by reading local usage data from 34 supported tools and presenting a unified dashboard. It is aimed at individual developers and small teams who want to know what they spend on AI coding tools without manually summing up numbers from each tool's settings page. The project's pitch is that you get a complete picture in 30 seconds, with no account and no API keys. That is a specific pain point, and the tool addresses it directly.

How It Works: Hooks, Local Files, and a Local Server

TokenTracker's mechanism is hook-based. On first run, the CLI installs hooks into each supported AI tool it detects on your machine. These hooks capture token usage events as they happen and write them to a local store. The dashboard then reads from that store. The README states that token data never leaves your machine, and the only optional network call is the leaderboard feature. For Cursor specifically, the tool reads token data from the local SQLite database using the system sqlite3 CLI, with a fallback to node:sqlite on supported Node releases. The dashboard runs on a local server at localhost:7680, showing usage trends, model breakdowns, cost analysis, and a GitHub-style activity heatmap. The desktop apps embed this same server in a native webview, so you get the same dashboard in a menu bar or tray window. The architecture is simple: local data in, local dashboard out.

Getting Started: One Command and a Few Options

The quickest path is npx tokentracker-cli. That command installs hooks, syncs data, and opens the dashboard at http://localhost:7680. The CLI requires Node.js 20 or newer. For a global install, npm i -g tokentracker-cli gives you the tokentracker command with subcommands: sync for manual sync, status to check hook status, status --json for machine-readable output, status --light for a plain ASCII table suitable for CI or SSH, and doctor for a health check. Homebrew users on macOS can install the menu bar app with brew install --cask xiufengsun/tokentracker/tokentracker, or just the CLI with brew install xiufengsun/tokentracker/tokentracker. Linux users get an AppImage that bundles its own Node runtime, but it depends on system libraries like webkit2gtk-4.1, gtk3, libayatana-appindicator, and librsvg. The README notes that on GNOME the tray icon requires the AppIndicator extension, and clicking the tray icon opens a menu rather than the window, a limitation of libayatana-appindicator. There is also an Arch PKGBUILD in the repository, though it is not published to the AUR.

The Desktop Pet and Widgets: Gimmick or Useful?

TokenTracker includes a desktop pet, a pixel companion that reacts to your coding activity. It works when you work, celebrates streaks, and sleeps when you rest. There are also four desktop widgets: Usage, Activity Heatmap, Top Models, and Usage Limits. These are pinned to your desktop. The pet is clearly a gamification feature, and it may appeal to some users. But it is not the core value. The widgets, on the other hand, serve a practical purpose: they put the most relevant metrics in view without opening the dashboard. The question is whether these features matter for a token tracker. For a solo developer, the widgets might be a nice way to keep an eye on costs. For a team, they are probably irrelevant. The pet feels like a distraction, but the achievement tracks, 15 of them, turn daily usage into a game. That could help some users build consistent habits around monitoring their AI usage. It is a design choice that sets TokenTracker apart from simpler trackers, and it is worth knowing before you adopt it.

Limitations and When It Is the Wrong Tool

TokenTracker has a few real constraints. First, it only works with the 34 tools listed in the README. If you use a tool not on that list, you get no data. Second, the hook-based approach depends on each tool's ability to emit hooks or expose local logs. The README specifically mentions that Cursor reading uses the system sqlite3 CLI, which means it relies on that tool being installed. If the sqlite3 CLI is missing and your Node version does not support node:sqlite, Cursor tracking may fail. Third, the desktop apps have platform quirks. On Linux, the tray icon behavior is limited, and you need specific system libraries. On GNOME, you must install an extension. These are not deal-breakers, but they are friction points. The tool is also not designed for deep prompt-level analysis. It tracks token counts and costs, not the content of prompts. If you need to audit what exactly was sent to a model, this is the wrong tool. It is a meter, not a recorder.

Alternatives: How It Differs from Other Trackers

The main alternative is using each AI tool's built-in usage page. Claude Code has its own cost tracking, and Cursor shows usage in its settings. That approach is free and requires no extra software, but it is fragmented. You have to log into each tool and manually compare numbers. TokenTracker centralizes that data. Another alternative is a cloud-based service that proxies your API calls and logs usage. Those services can give you per-request breakdowns and team-level reporting, but they require routing your traffic through their servers, which raises privacy concerns. TokenTracker's local-first approach is the opposite: it never sends your data anywhere. The trade-off is that you lose cross-device sync and any server-side aggregation. For a developer who values privacy and works on a single machine, TokenTracker is a better fit. For a team that needs centralized billing, a cloud proxy might be more appropriate.

Maintenance and License: What You Need to Know

TokenTracker is licensed under MIT, which means you can use, modify, and distribute it freely, including in commercial projects. There is no copyleft obligation. The project is actively maintained, with releases v0.94.0, v0.93.7, and v0.93.6 all pushed within a two-day window in late August 2026. That suggests a fast development cycle. The Homebrew tap auto-bumps within an hour of each release, so updates are easy. The CLI is published on npm as tokentracker-cli. Maintenance cost is low for users: you just upgrade the package or the desktop app. However, because the tool depends on hooks and local file formats of 34 different tools, each of those tools can change its internals and break TokenTracker. The maintainer seems responsive given the frequent releases, but you should expect occasional breakage when an upstream tool updates. The doctor command is there to help you diagnose such issues.

Editorial conclusion

Adopt TokenTracker if you use multiple AI coding tools and want a private, zero-config way to track token consumption and costs without sending data to a cloud. Avoid it if you need deep per-prompt analytics or if you rely on unsupported tools. Verify first that your AI tools are among the 34 supported, and check that your Node.js version is 20+ if using the CLI. On Linux, confirm your desktop environment can display tray icons, especially on GNOME. The project is actively maintained with frequent releases, but its reliance on hook-based detection may miss usage from tools that do not expose hook points.

Official sources

  1. Official documentation
  2. Official README
  3. Project repository
  4. Release notes
Community notes

Community notes