Skip to content

[Resource]: TokenTracker #1899

@mm7894215

Description

@mm7894215

Display Name

TokenTracker

Category

Tooling

Sub-Category

Tooling: Usage Monitors

Primary Link

https://github.com/mm7894215/TokenTracker

Author Name

mm7894215

Author Link

https://github.com/mm7894215

License

MIT

Other License

No response

Description

Local-first menu bar app and CLI that tracks token usage and cost across 20+ AI coding tools, including Claude Code, Codex, Cursor, Gemini, and Copilot. Parses local log files on disk with no API keys, no network telemetry, and no access to prompts or message content. Distributed as a Node CLI (npm) and a native macOS menu bar app (Homebrew tap + DMG).

Validate Claims

Install the CLI with npm install -g tokentracker, then run a few Claude Code sessions. Run tokentracker sync followed by tokentracker serve and open http://localhost:7680 to see per-model token usage and cost broken down by hour, with Claude Code, Codex, Cursor, and other detected tools listed separately. No login, no API keys, no network traffic to TokenTracker servers — verify with lsof -i -P -n | grep tokentracker after sync (only the local :7680 listener is expected).

Network behaviour: TokenTracker makes NO outbound network calls during sync or serve. It only reads local log files on disk (e.g. ~/.claude/projects/, ~/.codex/sessions/, ~/.gemini/). The web dashboard binds to 127.0.0.1:7680. The optional tokentracker login (account leaderboard) uses InsForge OAuth and is fully opt-in.

Specific Task(s)

Have Claude Code attribute a session's token usage and cost correctly without any outbound network calls from TokenTracker.

  1. In any small repo, run a short Claude Code session (e.g. ask it to explain one function).
  2. In a terminal: tokentracker sync && tokentracker serve
  3. Open http://localhost:7680 and confirm a row for Claude Code with non-zero token counts and a cost that matches Anthropic's billing dashboard for the same period.
  4. Optionally: lsof -i -P -n | grep tokentracker — only the local :7680 listener should appear, no outbound connections.

Specific Prompt(s)

Suggested prompt to Claude Code while testing:

Explain what the parseClaudeIncremental function in src/lib/rollout.js does and how it deduplicates messages.

Then, in a separate terminal, run:

npm install -g tokentracker
tokentracker sync
tokentracker serve --no-sync

Open http://localhost:7680. The Claude Code row should reflect the tokens used by the prompt above. Cross-check against claude --usage or Anthropic's billing dashboard.

Uninstall: npm uninstall -g tokentracker (CLI) or drag TokenTracker.app to Trash + delete ~/.tokentracker/ (macOS app).

Additional Comments

  • Repo: https://github.com/mm7894215/TokenTracker
  • Website: https://www.tokentracker.cc
  • License: MIT (LICENSE in repo root)
  • First public commit: well over one week old; latest release v0.24.8 on 2026-05-26
  • Source of truth for supported providers: parse*Incremental functions in src/lib/rollout.js — currently 20+ AI coding tools including Claude Code, Codex / Every Code, Cursor, Gemini CLI, GitHub Copilot, Kiro, OpenCode, Goose, Zed, Antigravity, Kimi, Grok, Droid (Factory CLI), OpenClaw, OMP, PI, Craft, Codebuddy, RooCode, Kilocode, Hermes
  • Featured in 阮一峰科技爱好者周刊 Bring back "Latest Additions" #393 (2026-05-23)
  • Network policy: sync/serve make NO outbound network calls. The optional tokentracker login feature (account-level leaderboard) is fully opt-in and uses InsForge OAuth.
  • Auto-update: standard channels only — npm (npm install -g tokentracker@latest is user-initiated) and Homebrew tap (brew upgrade --cask tokentracker). The macOS app does NOT auto-download or auto-execute updates in the background.
  • Permissions: does NOT require --dangerously-skip-permissions. Reads its own log files in known locations under ~/.

Recommendation Checklist

  • I have checked that this resource hasn't already been submitted
  • It has been over one week since the first public commit to the repo I am recommending
  • All provided links are working and publicly accessible
  • I do NOT have any other open issues in this repository
  • I am primarily composed of human-y stuff and not electrical circuits

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions