tokscale README

The project's README from github.com/junhoyeo/tokscale. As one markdown file: README.md.

Tokscale

A high-performance CLI tool and visualization dashboard for tracking token usage and costs across multiple AI coding agents.

[!TIP]

I drop new open-source work every week. Don't miss the next one.

GitHub Follow Follow @junhoyeo on GitHub for more projects. Hacking on AI, infra, and everything in between.
Discord link Come hang out in our Discord — and surround yourself with the world's top-tier vibers.
Sponsor Tokscale Support Tokscale's continued development through GitHub Sponsors.

GitHub Release npm Version npm Downloads GitHub Contributors GitHub Forks GitHub Stars GitHub Issues License Coverage

🇺🇸 English | 🇰🇷 한국어 | 🇯🇵 日本語 | 🇨🇳 简体中文

Overview Models
TUI Overview TUI Models
Daily Summary Stats
TUI Daily Summary TUI Stats
Frontend (3D Contributions Graph) Wrapped 2025
Frontend (3D Contributions Graph) Wrapped 2025

Run bunx tokscale@latest submit to submit your usage data to the leaderboard and create your public profile!

Overview

Tokscale helps you monitor and analyze your token consumption from:

Logo Client Data Location
OpenCode OpenCode ~/.local/share/opencode/opencode.db (1.2+, all channels including opencode-stable.db) or/and ~/.local/share/opencode/storage/message/ (legacy/unmigrated)
Claude Claude Code ~/.claude/projects/ and ~/.claude/transcripts/
OpenClaw OpenClaw ~/.openclaw/agents/ (*/agent/openclaw-agent.sqlite + */sessions/*.jsonl; + legacy: .clawdbot, .moltbot, .moldbot)
Codex Codex CLI ~/.codex/sessions/
Prime Agent Prime Agent ~/.prime/agent/sessions/ and ~/.prime/agent/session-artifacts/ (RLM child sessions)
Sakana Fugu Sakana Fugu via Codex — ~/.codex/sessions/*.jsonl (model_provider: sakana)
Copilot GitHub Copilot CLI ~/.copilot/otel/*.jsonl (+ COPILOT_OTEL_FILE_EXPORTER_PATH)
Hermes Agent Hermes Agent $HERMES_HOME/state.db and $HERMES_HOME/profiles/*/state.db (fallback: ~/.hermes/...)
Gemini Gemini CLI $GEMINI_CLI_HOME/tmp/*/chats/*.json (fallback: ~/.gemini/tmp/*/chats/*.json)
Cursor Cursor IDE Cursor API export cached at ~/.config/tokscale/cursor-cache/usage*.csv (desktop auto-login or cookie paste; not ~/.cursor)
Amp Amp (AmpCode) ~/.local/share/amp/threads/
Codebuff Codebuff ~/.config/manicode/ (+ manicode-dev, manicode-staging; override via CODEBUFF_DATA_DIR)
Freebuff Freebuff shares ~/.config/manicode/ with Codebuff (same runtime); token usage is estimated from the transcript (no local usage; override via FREEBUFF_DATA_DIR)
Droid Droid (Factory Droid) ~/.factory/sessions/
Pi Pi ~/.pi/agent/sessions/
Oh My Pi Oh My Pi ~/.omp/agent/sessions/**/*.jsonl
Senpi Senpi (OmO Native) ~/.senpi/agent/sessions/ (override via SENPI_CODING_AGENT_DIR)
Kimchi Kimchi Coding ~/.config/kimchi/harness/sessions/ (override via KIMCHI_CODING_AGENT_DIR)
Reasonix Reasonix ~/.reasonix/stats/*.jsonl (override via REASONIX_STATE_HOME or REASONIX_HOME)
Kimi Kimi CLI / Kimi Code kimi-cli: ~/.kimi/sessions/ kimi-code: ~/.kimi-code/sessions/ (override via KIMI_CODE_HOME) kimi-work: desktop app-data root (auto-discovered)
Qwen Qwen CLI ~/.qwen/projects/
Roo Code Roo Code ~/.config/Code/User/globalStorage/rooveterinaryinc.roo-cline/tasks/ (+ server: ~/.vscode-server/data/User/globalStorage/rooveterinaryinc.roo-cline/tasks/)
Kilo Kilo ~/.config/Code/User/globalStorage/kilocode.kilo-code/tasks/ (+ server: ~/.vscode-server/data/User/globalStorage/kilocode.kilo-code/tasks/)
Kilo CLI Kilo CLI ~/.local/share/kilo/kilo.db
Mux Mux ~/.mux/sessions/
Crush Crush $XDG_DATA_HOME/crush/projects.json (project registry; fallback: ~/.local/share/crush/projects.json)
Goose Goose ~/.local/share/goose/sessions/sessions.db (+ macOS Application Support, legacy Block/goose paths; override via GOOSE_PATH_ROOT)
Antigravity Google Antigravity Cached via tokscale antigravity sync to ~/.config/tokscale/antigravity-cache/sessions/*.jsonl (live RPC against the local language server)
Antigravity CLI Antigravity CLI ~/.gemini/antigravity-cli/conversations/*.db (override the Gemini home via GEMINI_CLI_HOME; local SQLite, read directly — no antigravity sync needed)
Trae Trae IDE / Trae Solo (international) Cached via tokscale trae sync to ~/.config/tokscale/trae-cache/sessions/*.json (account-level usage from the official API)
Warp Warp / Oz Cached via tokscale warp sync to ~/.config/tokscale/warp-cache/usage.json (aggregate requests and spend only; no token transcripts)
Grok Build Grok Build $GROK_HOME/sessions/*/*/updates.jsonl (fallback: ~/.grok/sessions/*/*/updates.jsonl)
Zed Agent Zed Agent ~/.local/share/zed/threads/threads.db (macOS: ~/Library/Application Support/Zed/threads/threads.db; Windows: %LOCALAPPDATA%/Zed/threads/threads.db; hosted Zed models only, not external ACP agents)
Kiro Kiro ~/.kiro/sessions/cli/*.json (+ *.jsonl), ~/.local/share/kiro-cli/data.sqlite3 (macOS: ~/Library/Application Support/kiro-cli/data.sqlite3), and Kiro IDE globalStorage snapshots (Kiro/User/globalStorage/kiro.kiroagent; macOS Application Support, Linux ~/.config/Kiro, Windows %APPDATA%\Kiro)
Cline Cline VS Code globalStorage tasks (Linux: ~/.config/Code/...; macOS: ~/Library/Application Support/Code/...; Windows: %APPDATA%\Code\...; server: ~/.vscode-server/data/User/globalStorage/saoudrizwan.claude-dev/tasks/) + Cline CLI sessions (first available root, in order: $CLINE_SESSION_DATA_DIR, $CLINE_DATA_DIR/sessions/, $CLINE_DIR/data/sessions/, fallback ~/.cline/data/sessions/; blank/whitespace-only environment values are ignored)
Gajae-Code gajae-code (gjc) ~/.gjc/agent/sessions/ (override via GJC_CODING_AGENT_DIR, GJC_CONFIG_DIR, PI_CONFIG_DIR; $XDG_DATA_HOME/gjc/sessions/ on Linux/macOS)
Cherry Studio Cherry Studio %APPDATA%\CherryStudio\Data\Agents\.claude\projects\*.jsonl and legacy %APPDATA%\CherryStudio\.claude\projects\*.jsonl (macOS: ~/Library/Application Support/CherryStudio/Data/Agents/.claude/projects/; Linux: $XDG_CONFIG_HOME/CherryStudio/Data/Agents/.claude/projects/; Agent / Claude Code mode transcripts; V2 root preferred, legacy keeps untransferred history)
LM Studio LM Studio ~/.lmstudio/server-logs/**/*.log (LM_STUDIO_HOME supported; Chat Completions and Responses API final-response usage only; prompts and responses are not retained; local inference cost is $0)
Unsloth Studio Unsloth Studio $UNSLOTH_STUDIO_HOME/studio.db (fallback: ~/.unsloth/studio/studio.db; exact internal-chat and authenticated API inference usage; message content is not read; training metrics are excluded; local inference cost is $0)
Hindsight Hindsight $HINDSIGHT_HOME/usage/*.jsonl (fallback: ~/.hindsight/usage/*.jsonl; populated via tokscale hindsight sync)
Jcode Jcode ~/.jcode/sessions/session_*.json + session_*.journal.jsonl sidecars (override via JCODE_HOME)
MiMo Code MiMo Code ~/.local/share/mimocode/mimocode.db (XDG data dir; SQLite)
Junie Junie ~/.junie/sessions/*/events.jsonl
Command Code Command Code ~/.commandcode/projects/**/*.jsonl (v3 transcripts persist per-request usage and cost; estimated fallback only for legacy transcripts without a usage block)
ZCode ZCode ~/.zcode/cli/db/db.sqlite (v2 usage database) and ~/.zcode/projects/**/*.jsonl (legacy transcripts)
OpenCodeReview OpenCodeReview ~/.opencodereview/sessions/**/*.jsonl
CodeBuddy CodeBuddy (CLI, IDE, VS Code plugin) ~/.codebuddy/projects/**/*.jsonl + extension logs
WorkBuddy WorkBuddy ~/.workbuddy/projects/**/*.jsonl + SQLite fallback
Devin CLI Devin CLI ~/.local/share/devin/cli/sessions.db (SQLite)
Devin Desktop Devin Desktop ACP events: macOS ~/Library/Application Support/Devin/User/acp-events/; Linux ~/.config/Devin/User/acp-events/; Windows %APPDATA%\Devin\User\acp-events\
Augment Code Augment Code (Auggie CLI) ~/.augment/sessions/*.json
Synthetic Synthetic Re-attributed from other sources via hf: model prefix or synthetic provider (+ Octofriend: ~/.local/share/octofriend/sqlite.db)
DeepSeek Harness DeepSeek Harness ~/.dsh/sessions/**/session.jsonl.zstd (or session.jsonl when written uncompressed; override via DSH_HOME)
MiniMax Code MiniMax Code ~/.config/tokscale/headless/mcode/*.jsonl (headless capture of mcode exec --output-format stream-json; override via TOKSCALE_HEADLESS_DIR)
Fx fx ~/.fx/sessions/<sessionId>/usage-v2.json (per-session aggregates)

Get real-time pricing calculations using 🚅 LiteLLM's pricing data, with support for tiered pricing models and cache token discounts.

Why "Tokscale"?

Tokscale

This project is inspired by the Kardashev scale, a method proposed by astrophysicist Nikolai Kardashev to measure a civilization's level of technological advancement based on its energy consumption. A Type I civilization harnesses all energy available on its planet, Type II captures the entire output of its star, and Type III commands the energy of an entire galaxy.

In the age of AI-assisted development, tokens are the new energy. They power our reasoning, fuel our productivity, and drive our creative output. Just as the Kardashev scale tracks energy consumption at cosmic scales, Tokscale measures your token consumption as you scale the ranks of AI-augmented development. Whether you're a casual user or burning through millions of tokens daily, Tokscale helps you visualize your journey up the scale—from planetary developer to galactic code architect.

Contents

tokscale (junhoyeo/tokscale)

Searching Database…

这是什么东西?Tokscale 是一个终端工具,用来跟踪你在 Claude Code、Codex、Cursor、Gemini CLI 这类 AI 编程助手上消耗了多少 token、花了多少钱,还带有仪表盘和一个全球排行榜。
它是在我的终端里运行,还是一个单独的仪表盘?两者都有:核心是你在终端里运行的 CLI 和 TUI,可以看每日汇总、统计数据和筛选;另外还有一个前端界面,带 3D 贡献图和 Wrapped 2025 年度回顾。
我怎么把它跑起来?用 Bun 运行:`bunx tokscale@latest`。也有用 Cargo 加 Bun 从源码构建的路线,仓库里还附带了 Docker 和 Compose 文件。
它到底能跟踪哪些编程助手?好几十个:Claude Code、OpenCode、Codex CLI、Gemini CLI、Cursor IDE、GitHub Copilot CLI、Amp、Droid、Hermes Agent、OpenClaw 等等——它会读取每个工具本地的会话文件,比如 ~/.claude/projects/ 或 ~/.codex/sessions/。
是不是每个助手拿来就能用,还是有些需要额外设置?大部分数据直接从磁盘读取,但有少数需要先同步或导出——Cursor IDE 要通过 API 导出,用桌面端自动登录或粘贴 cookie;Google Antigravity、Trae、Warp 这类客户端则需要用专门的同步命令来缓存数据。
它在 Windows 和 Linux 上能用吗,还是只支持 macOS?三个平台都支持——它是一个跨平台的 Rust CLI,README 里把 macOS、Linux 和 Windows 的数据路径并列写在一起。
我的使用数据会离开我的电脑吗?只要你不上传就不会:统计是在本地针对你的助手已经写好的文件进行的,唯一的上传途径是 submit 命令,它会把你的使用量发布到公开排行榜上。
它为什么叫 Tokscale?它的命名借鉴了卡尔达肖夫指数(Kardashev scale),那个指数按能量消耗给文明分级——作者的设想是 token 就是新时代的能源,所以 Tokscale 用来衡量你从“行星级开发者”到“银河级代码架构师”的进阶之路。
那些可视化图表实际展示了什么?终端里有每日汇总和各平台的统计数据;前端则有一个类似 3D 贡献图的界面展示你的活动,还有一个 Wrapped 2025 年度回顾,总结你这一年消耗的 token。
全球排行榜是怎么回事?运行 `bunx tokscale@latest submit` 会把你的使用量发布到一个公开的个人主页下,这样你就能和其他开发者比一比谁的 token 消耗更多;项目方说目前已经跟踪了数万亿个 token。
Creator
junhoyeo
Size
100.8 MB
Stars
5.7K
Age
10mo
Commits · 90 Days