Token Tracker CLI

Counts token use and cost of Claude Code and Codex sessions from local logs and shows remaining limits in the status line

  • 535 ★ on the repository
  • Last commit
  • MIT
CLI

Extended access

Why this level

  • Edits agent settings: adds a statusLine to Claude Code and hooks to Codex and Kimi Code that fire on every answer and prompt
  • Reads session logs that hold the full text of your prompts
  • Installs through a curl-to-bash script that picks the installation method on its own
All reasons and checks

stormzhang/token-tracker

Install

In your terminal, with SkillFoxx CLI

npx skillfoxx add cli/token-tracker

Detects the agents on your machine, shows the access level and pins the version.

Other ways to install

Access and checks

How we review

Extended accessThe tool runs code or makes network calls and only reads external data.

  • Edits agent settings: adds a statusLine to Claude Code and hooks to Codex and Kimi Code that fire on every answer and prompt
  • Reads session logs that hold the full text of your prompts
  • Installs through a curl-to-bash script that picks the installation method on its own

This is third-party code. Review the repository files before installing.

What it does

Token Tracker reads the local session logs of Claude Code, Codex and Kimi Code and shows token use, equivalent cost and remaining limits. Plain tt draws a year-long GitHub-style heatmap. tt status prints today's summary with the 5-hour and 7-day quotas, and tt weekly, tt monthly and tt sessions build reports by week, month and individual session. tt setup wires up the status line. In Claude Code it uses the official statusLine interface and shows the project, branch, session tokens, cost, remaining quota and context window fill. Codex has no status line of its own, so after every answer Token Tracker appends two lines of text through a Stop hook. Kimi Code gets the status_line interface. tt sidebar opens a narrow panel with every active session: its state, recent prompts and a suggested next step. Clicking a session jumps to the matching iTerm2 or tmux pane. The tool takes prices from LiteLLM and falls back to a table bundled in the package when offline.

Who it is for. For developers working in Claude Code, Codex or Kimi Code who want to see token use and remaining limits without opening a web dashboard.

Good fit when

  • You are on a Claude Code or Codex subscription and want the remaining limit in the status line itself
  • You need to know which project and model burn the most tokens: tt monthly breaks usage down by both
  • You run several sessions in iTerm2 or tmux and want tt sidebar to show which one is waiting for your answer
  • Codex needs at least a text indicator of usage after every answer
  • The agent runs through a third-party API provider such as DeepSeek and you need a cost estimate for the session

Not a fit when

  • You need an exact billing statement: report costs are equivalent costs calculated from public prices
  • You use another agent: only Claude Code, Codex and Kimi Code have adapters
  • You want usage analytics for a whole team: Token Tracker sees only the logs on your machine
  • You already have a custom statusLine in Claude Code and want to keep it untouched: you can decline in the wizard, but then tt status has no subscription quota data

Example request

Install Token Tracker, set up the Claude Code status line and show me how many tokens each project used this week

Limitations

  • Python 3.11 or newer is required.
  • Quotas exist only on a subscription. In API mode the status line shows context fill only.
  • Claude Code quota reaches the disk only through the status line, so without it tt status has no such data.
  • The Codex status hook prints plain text without colors. Codex asks you to confirm unfamiliar hooks with /hooks.
  • The on-the-fly split needs iTerm2, Ghostty 1.3.0 or newer, or tmux. On macOS the system asks for permission to control the terminal on first use.
  • For an unknown model the price may not be found, and the tool reports the rate as missing.

How to disable. tt unsetup removes the status lines, hooks and skills that tt setup installed and restores your previous agent settings. Then remove the package the same way you installed it, for example with pip uninstall token-tracker.

FAQ

How do I install Token Tracker for Claude Code?

Run curl -sSL https://raw.githubusercontent.com/stormzhang/token-tracker/main/install.sh | bash: the script picks uv, pipx or a private virtual environment on its own. Then run tt setup and go through the wizard: language, theme and consent to connect the Claude Code status line. Upgrade by running the same command again.

How do I see my Claude Code limit in the status line?

After tt setup the second line of the status panel shows the 5-hour and 7-day quota with a countdown to reset. The context window size and fill sit next to it.

How do I show token use in Codex?

Codex has no configurable status line, so tt setup installs a Stop hook, and after every answer two lines appear with the project, branch, session tokens, model, quotas and context. Since Codex 0.156.0 color codes in hook output are filtered, so the lines come uncolored.

Does Token Tracker send my data over the network?

Data stays local, the tool only reads agent logs and has no telemetry. Two things go over the network: current prices from LiteLLM and the cloud limit query for Kimi Code, refreshed every 2 minutes.

How do I open the sidebar for the current Codex session?

Type $tt-sidebar in Codex; tt setup installs the skill. A panel one third of the window wide opens on the right with full prompts from newest to oldest. After installation you have to trust the hook in Codex with /hooks.

Discussion

No questions or reviews yet.

CLI tools

TokenTracker counts tokens and spend across Claude Code, Codex, Cursor, Gemini CLI and other agents from local logs and shows them on a local dashboard

CLIBroad access2.1KRepository stars
Editors’ pick

Token and cost reports for Claude Code, Codex, Gemini CLI and other agents from local logs, by day, month and session

CLIExtended access19.3KRepository stars

A real-time terminal monitor for Claude Code usage: tokens, messages and cost in the five-hour window, with forecasts and export

CLIExtended access8.8KRepository stars

A Claude Code plugin: a status line with context, 5-hour and 7-day limits, cost and usage of Codex, Gemini and z.ai

PluginBroad access584Repository stars
Official

A CLI and MCP server that tally token spend across 41 tools and agents, break it down by project and model, and help cut wasted tokens

CLIExtended access11.6KRepository stars

A statusline for Claude Code: token and cost usage, context left, rate limits and git branch in four styles and six themes

PluginExtended access1.2KRepository stars

Comparison with similar tools

Entries that share the main search query, and how they differ.

EntryOfficialRepository starsMain difference
Token Tracker (this entry)no535
ccusageno19,251log reports in the terminal only, no status line or sidebar
ccstatuslineno13,462a configurable status line for Claude Code only
Claude HUDno29,003a plugin showing context, tools and subagents in the Claude Code status line, no cost reports

README in short

The main README is in Chinese, with an English version in README_EN.md. The page moves from a feature list and report screenshots to sections on status lines, the sidebar, installation, six color themes and a table of the paths the tool reads logs from.

README badge

Report a problem

Foxx AIToken Tracker
Foxx AI

I am Foxx AI and I have already vetted this tool. Ask about install, setup or anything else, and I will keep it simple.