Claude Code usage

Toktrack

Ultra-fast token & cost tracker for LLM Token Usage (e.g. Claude Code)

197 stars 22 forksUsage & cost trackers Source

Install

Install
npx toktrack

Found in the project README. Check it for setup steps after installing.

From source
git clone https://github.com/mag123c/toktrack.git

From the README

English | 한국어
⚠️ Did you know? Claude Code deletes your session data after 30 days by default. Once deleted, your token usage and cost history are gone forever — unless you preserve them.

The token & cost tracker that never loses your history. Most tools re-read your CLI's session files on every run — so when Claude Code deletes them after 30 days, your cost history goes with them. toktrack keeps a persistent cache, so your history survives.

Track usage across all your AI coding CLIs — Claude Code, GitHub Copilot CLI, Codex CLI, Gemini CLI, Qwen Code, OpenCode, PI Agent, Antigravity, and Grok CLI — in one dashboard. Built in Rust, so it stays fast even on huge histories (simd-json + rayon).

Why toktrack?

Features

- Data Preservation — Persistent cache keeps your cost history even after a CLI deletes its own session files
- Multi-CLI Support — Claude Code, GitHub Copilot CLI, Codex CLI, Gemini CLI, Qwen Code, OpenCode, PI Agent, Antigravity, Grok CLI in one place
- TUI Dashboard — 5 tabs (Overview, Stats, Models, Projects, Audit) with daily/weekly/monthly views
- Per-Project Breakdown — the Projects tab shows token & cost usage per project (the session working directory), for CLIs that record one. Drill into any project for its day-by-day, per-model breakdown. Usage from CLIs that don't record a project is grouped under (no project). Press * on a project to star it as a root folder: every project under it folds into its row (saved to ~/.toktrack/config.toml as project_roots). Sessions in a git worktree fold into the root of their main repository, even after the worktree is deleted (links are kept in ~/.toktrack/cache/worktree_links.json). Worktrees are matched through their .git link, so this works for any tool. The one tool-specific exception: a T3 Code worktree…
Read the full README on GitHub

Details

Language
Rust
License
MIT
Last updated
3 November 2026
Topics
ai-billingai-codingai-costai-toolsanthropicclaude-codeclicodex-clicost-monitorcost-trackingdeveloper-toolsgemini-cli

FAQ

What is Toktrack?

Ultra-fast token & cost tracker for LLM Token Usage (e.g. Claude Code) It is a usage for Claude Code, from mag123c/toktrack on GitHub.

How do I install Toktrack?

Run npx toktrack, then follow the setup in the README.

Is Toktrack popular?

mag123c/toktrack has 197 GitHub stars and 22 forks, and is included in 1 curated Claude Code list. It was last updated on 3 November 2026.

More usage & cost trackers

Browse the most popular Claude Code mods, all usage & cost trackers, or the skills and MCP server directories.