claude-usage-dashboard

中文文档
1.12.1发布于 2026/11/03ISCES Module构建来源已验证

Claude Code usage dashboard — token costs, quota cycle tracking, cache efficiency, multi-machine sync across all your devices

原始使用文档
文档目录13 节
  1. Value
  2. Cycles
  3. Consumption
  4. Sessions
  5. One ledger, every machine
  6. Specification
  7. Design
  8. Install
  9. Multi-machine sync
  10. How it works
  11. Tests
  12. Releases
  13. License

Claude Usage Dashboard

A flat fee tells you nothing about what you used.

npm version npm downloads license no telemetry

npx claude-usage-dashboard

Value · Cycles · Consumption · Sessions · Specification · Install

Dashboard

Claude Code writes a log every time it works. This reads those logs and puts a number on them.

Value

Quota meters, subscription value and model mix

A subscription is a fixed number. What it buys is not.

One figure carries the rail: API-equivalent value per subscription dollar, at full quota utilization. A $200 plan routinely meters five figures of API-equivalent traffic in a month.

Above it, the windows you are actually rationed by — five-hour and seven-day — read from Anthropic with the OAuth credentials already sitting on your machine. Plan tier is detected, not declared.

Below, the crossing point: the share of the quota window at which the API bill would have overtaken the fee. It is only drawn when the selected range is that window; a 90-day cost and a 7-day utilization are not the same measurement, and the panel would rather say nothing than average them.


Cycles

Anthropic does not publish token limits, and limits move without announcement.

Quota cycles

Every seven-day window is recorded as it closes — consumption by kind, and the ceiling implied at 100% utilization. Ten cycles retained, pooled across machines.

The Δ column carries the change from the window before. When that number falls and your habits did not, you have the record.


Consumption

Token consumption

Hourly through monthly. Tokens or dollars. Four bands in every bar, ordered by price: cache read, cache write, input, output.

Cache read is usually most of the mass and a fraction of the cost — the shape of that stack is the shape of your bill. Underneath, the hours you actually work, aggregated across the range.

API-equivalent costs use current standard Claude API prices, including for historical logs, with 5-minute cache writes. Haiku 5.5 uses higher rates when a single request exceeds 100,000 input tokens, counting cache reads and writes. Fast mode, 1-hour cache writes, batch discounts, and regional premiums are not included.


Sessions

Sessions

Bar length is session size; the segments are the token mix. Sortable by date, cost, or tokens, filterable by project. Exact counts on hover.


One ledger, every machine

A laptop, a desktop, a work machine. Each one only ever sees itself.

Point them all at a single shared folder — Drive, Dropbox, OneDrive, a NAS, an rsync target — and the logs roll into one view. No server, no account, no API key. A folder you already have.


Specification

Reads~/.claude/projects/**/*.jsonl
QuotaAnthropic API · local OAuth credentials
Refresh5 s log re-read · 30 s dashboard · 30 s sync copy · 120 s quota
Retained10 quota cycles
GranularityHourly · daily · weekly · monthly
RangesQuota window · 7 / 30 / 90 days · custom
PersistsRange, granularity, plan, refresh — localStorage
TypefacesInstrument Serif, IBM Plex Sans, IBM Plex Mono — bundled, not fetched
StackNode · Express · D3. No build step.
Leaves the machineThe quota read. Nothing else.

Design

Near-monochrome and warm. A single accent — Claude's terracotta — spent only on the figure that matters and on anything past a threshold. Healthy meters stay neutral: colour is an alarm here, not decoration.

Instrument Serif for figures, IBM Plex Sans for the interface, IBM Plex Mono wherever you might compare one row against another. All three ship inside the package, so first render works offline and no request goes anywhere it was not promised. One page, no routes — the header anchors move you without reloading you.


Install

npx claude-usage-dashboard

Open localhost:3000.

If that port is taken — or silently blocked, which Windows does more often than you would expect — it falls through 8080, then 8765, then whatever the OS hands out, and prints the address it actually got.

From source
git clone https://github.com/ludengz/claude-usage-dashboard.git
cd claude-usage-dashboard
npm install
npm start
A chosen port
PORT=8080 npx claude-usage-dashboard

Set explicitly, it does not fall back. It fails, and tells you why.

Multi-machine sync

Two environment variables per machine, then start normally.

# ~/.bashrc, ~/.zshrc, etc.
export CLAUDE_DASH_SYNC_DIR="$HOME/Google Drive/claude-sync"
export CLAUDE_DASH_MACHINE_NAME="MacBook"   # optional — defaults to hostname
Windows, and inline

As user environment variables:

[Environment]::SetEnvironmentVariable('CLAUDE_DASH_SYNC_DIR', 'C:\Users\you\Google Drive\claude-sync', 'User')
[Environment]::SetEnvironmentVariable('CLAUDE_DASH_MACHINE_NAME', 'Desktop', 'User')

Or inline, per run:

CLAUDE_DASH_SYNC_DIR="/path/to/shared" CLAUDE_DASH_MACHINE_NAME="MacBook" npx claude-usage-dashboard

Local logs are copied into <sync_dir>/<machine_name>/ on startup and every 30 seconds thereafter. The dashboard then reads every machine folder in that directory. Any machine pointed at the same folder contributes to the aggregate.

Works with anything that syncs a folder: Google Drive, Dropbox, OneDrive, iCloud Drive, Syncthing, a NAS, a plain rsync cronjob.

How it works

The data already exists. Claude Code writes JSONL session logs to ~/.claude/projects/ as it runs; this reads them, prices each record server-side, and aggregates on request. Logs are re-read every five seconds, and only files whose size or mtime changed are parsed again — new usage appears without a restart.

Quota comes from the Anthropic API, authenticated with the OAuth credentials the claude CLI already stored locally. That request is the only thing that leaves your machine.

Tests

npm test

Releases

Push a stable vX.Y.Z tag matching package.json on a commit already on main to run Publish. It runs the tests on Windows, packs and installs the package in isolation, and checks that npx remains in the foreground. Only that verified tarball is published to npm using OIDC. The workflow verifies the registry version, latest tag, and downloaded tarball integrity before creating the GitHub Release.

The npm Trusted Publisher is bound to ludengz/claude-usage-dashboard, workflow publish.yml, and GitHub environment npm, with direct npm publish permission. No npm token secret is required. Account 2FA remains enabled for interactive account and package administration.

Use Actions → Publish → Run workflow on main for a verification-only run. For a failed release, rerun its workflow on the same tag; an already-published version is accepted only when its integrity matches the verified artifact.

License

ISC. Bundled typefaces are SIL Open Font License 1.1 — see public/fonts/OFL.txt.

版本与发布记录

claude-usage-dashboard 共发布 48 个版本,首次发布于 2026/03/16;过去 12 个月发布了 48 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.12.1latest2026/11/03今天
1.12.02026/11/03今天
1.11.02026/09/261 个月前
1.10.02026/09/061 个月前
1.9.12026/07/253 个月前
1.9.02026/07/253 个月前

关于 claude-usage-dashboard 的常见问题

claude-usage-dashboard 是什么?

克劳德代码使用仪表板-令牌成本,配额周期跟踪,缓存效率,跨所有设备的多机同步

如何安装 claude-usage-dashboard?

在项目目录运行 npm install claude-usage-dashboard,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 claude-usage-dashboard,可以用 npx claude-usage-dashboard 直接运行。

claude-usage-dashboard 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/claude-usage-dashboard 是否存在。

claude-usage-dashboard 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

claude-usage-dashboard 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18.0.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

claude-usage-dashboard 可以商用吗?

claude-usage-dashboard 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

claude-usage-dashboard 还在维护吗?

最新版本 1.12.1 发布于 2026/11/03(今天);至今共发布 48 个版本,其中过去 12 个月发布了 48 个;首次发布于 2026/03/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。