TokenTracker  by mm7894215

Monitor AI coding token usage locally

Created 3 weeks ago

New!

313 stars

Top 86.1% on SourcePulse

GitHubView on GitHub
Project Summary

Summary

Token Tracker addresses the challenge of monitoring AI token usage across diverse coding tools by providing a local-first, zero-configuration solution. It targets developers and power users seeking granular visibility into AI-driven development costs and consumption patterns, offering a unified view without requiring cloud accounts or API keys.

How It Works

The project employs a local-first architecture, automatically detecting and integrating with 11 supported AI CLI tools via lightweight hooks or by passively reading existing log files (SQLite, JSONL, OTEL). Token counts are parsed locally, aggregated into 30-minute UTC buckets within a local SQLite database, ensuring user data never leaves the machine. This data snapshot powers a web dashboard, a native macOS menu bar application, and desktop widgets, offering real-time insights into usage trends and costs.

Quick Start & Requirements

Installation is streamlined: run npx tokentracker-cli for immediate use, or install globally with npm i -g tokentracker-cli tokentracker. macOS users can opt for Homebrew: brew install --cask mm7894215/tokentracker/tokentracker for the menu bar app or brew install mm7894215/tokentracker/tokentracker for the CLI. Prerequisites include Node.js 20+ and bash. The CLI operates on macOS, Linux, and Windows, while the menu bar app and Cursor SQLite reader are macOS-exclusive. Setup is estimated at under 30 seconds. Useful diagnostic commands include tokentracker status and tokentracker doctor. Official documentation and the GitHub repository are available for further details.

Highlighted Details

  • Supports 11 AI tools including Claude Code, Codex CLI, Cursor, Gemini CLI, Kiro, OpenCode, OpenClaw, Every Code, Hermes Agent, GitHub Copilot, and Kimi Code.
  • Features a 100% local data model, eliminating the need for accounts or API keys and ensuring privacy.
  • Provides a beautiful, interactive dashboard with usage trends, model breakdowns, cost analysis, and a GitHub-style activity heatmap.
  • Offers a native macOS menu bar application with desktop widgets for persistent on-screen monitoring.
  • Includes real-time rate limit tracking for multiple AI providers and a cost engine with extensive model pricing tables.
  • An optional, opt-in global leaderboard allows users to compare their AI usage patterns anonymously.

Maintenance & Community

The project shows signs of active maintenance through regular release updates indicated by npm and GitHub badges. Community interaction and support are facilitated via GitHub Discussions, with clear guidelines for bug reporting, feature requests, and contributions, including adding new AI tool integrations.

Licensing & Compatibility

Token Tracker is distributed under the permissive MIT License, allowing for broad compatibility and commercial use without significant restrictions. However, advanced features like the native macOS menu bar app and specific integrations are platform-dependent.

Limitations & Caveats

The native menu bar app and desktop widgets are exclusively available on macOS. The macOS application is ad-hoc signed, requiring users to manually bypass Gatekeeper security prompts on initial launch. Certain integrations, such as Cursor and Kiro, necessitate granting the application elevated permissions to access local user data directories. Building the macOS app requires Xcode 16+.

Health Check
Last Commit

23 hours ago

Responsiveness

Inactive

Pull Requests (30d)
12
Issues (30d)
21
Star History
317 stars in the last 21 days

Explore Similar Projects

Feedback? Help us improve.