Claude Usage

io.github.syk8015由 GitHub 账号 syk8015 发布v1.0.0更新于 Oct 26, 2026

Measures whether your Claude subscription is paying off, from local logs. No upload.

发布方自己的服务:Claude Platform Docs

已验证STDIO仅桌面开发者工具数据与分析

概览

AI 生成的概览

分析本地 Claude Code 日志,评估 Claude 订阅是否划算:留存代码行、浪费与速率限制构成。

可以做什么
  • 报告订阅价值:最终留存的代码行、以 API 美元计的浪费、按活动分类的成本
  • 拆解 5 小时与每周速率限制的驱动因素
  • 估算 Claude Code 之外的聊天占用了多少额度
  • 显示当前限制及按产品划分的明细
  • 用自然语言回答订阅是否值得、额度为何消耗快等问题
适用场景
适合个人 Claude 订阅用户,想判断套餐是否划算、弄清额度被什么消耗,且只依赖本地日志而非团队 Git 或 PR 数据。
运行要求
需从 Git 仓库克隆后本地安装;Python 3.9 及以上,仅用标准库;实时额度工具需要 macOS。额度与聊天工具需在 Claude 设置文件中加入状态栏采集器;样本存于本地数据目录,可用 CLAUDEUSAGE_DATA 覆盖。
安装前请注意
实时用量工具会从 macOS 钥匙串读取 Claude Code 凭据并仅发送至 Anthropic 的 API,记录内容为白名单字段。项目已完结、不再开发,问题可能无人回复。准确性有限:仅凭日志会低估用量,部分模型权重基于少量干净窗口。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Claude Usage,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

claudeusage

Measure whether your Claude subscription is actually paying off — from local logs, with no upload and no Git integration.

Status: finished (October 2026). This was a personal research project. It works and stays public, but it is no longer developed and issues may go unanswered. The measurements below are from one account over about five weeks (2026-09-01 → 10-08).

한국어 문서: README.ko.md — the Korean version is the working notebook, with the full measurements and the mistakes we made getting there.

Why this exists

On a subscription you don't pay per token, so nothing tells you whether you are using it well. Most personal tools count how much you used. That is the wrong number: burning tokens in circles scores high. Meta ran an internal leaderboard like that and shut it down — people started idling AI to climb it. A few free profilers do look for waste, but they price it in API dollars — and on a subscription the thing that runs out is the limit gauge, which weighs tokens very differently (see below).

Tools that measure quality do exist, but they are all built for teams: they need your Git repo, your PRs, your issue tracker. That leaves a gap.

Team toolsclaudeusage
Who is measuredA lead measures the teamYou measure yourself
NeedsGit repo, PRs, trackerOne local log directory
MeasuresReturn on team investmentWhether your subscription pays off
PriceSaaS or self-hostedFree, runs locally

Git-based tools track code with git blame, so anything you never committed is invisible to them. This reconstructs the edit history itself, so experiments and code you rewrote before committing still count.

What it measures

Lines that survived. Every edit is folded in time order, so only what was still there at the end of the session counts. Code you rewrote three turns later drops out by itself. You cannot game the score by idling.

Waste, in money. Rework, failures and rejections add up to 4.1% here. Money spent because conversations got long: 12.3%. Both are API-dollar figures. Whether starting fresh conversations actually saves limit was never proven — a new conversation pays to re-read its context — so treat the 12.3% as a pointer, not a promise.

What the rate limit actually eats. Your real constraint is the limit gauge, not dollars. Cache reads are most of the cost but weigh about 1/70 of fresh input against the limit. Saving money and saving limit are different skills.

What chat ate. Limits apply to the whole account, so claude.ai chat and the mobile app drain the same gauge — while leaving no local trace. Any log-only tool undercounts. This one subtracts what the logs explain from what the gauge actually did, and checks that estimate against the per-product breakdown Anthropic returns.

What one account's data showed

Measured from about 52,000 status-line samples and 33,000 logged requests. Every multiplier names what it is divided by.

  • Cache reads weigh about 1/70 of fresh input against the limit (per token, fitted on 107 five-hour windows). They are 97% of all tokens and most of the dollar cost, yet the limit ends up split into similar shares between output, fresh input and cache reads. Dollar-based waste reports overstate them.
  • A weekly-limit change shows up in the gauges alone. Weekly rise ÷ five-hour rise moved from 0.099 (40 windows, 09-01→13) to 0.125 (41 windows, 09-15→10-02): 1.26×. Anthropic's announced change (bonus +50% → +25%) predicts 1.20×. This only confirms a published change; one account gives about ±3%.
  • Model weight per output token, Opus 5 = 1: Fable 5.1 ≈ 3.8×, Opus 4.8 ≈ 1.7× (few clean windows; direction solid, exact value not).
  • Chat outside Claude Code was about 10% of the limit, matching the 8–9% per-product breakdown Anthropic returns.

Install

Requires Python 3.9+ (standard library only, no dependencies) and macOS for the live-limit tool.

bash
git clone https://github.com/syk8015/claudeusage && cd claudeusage./install.sh                   # package + skill + MCP server (user scope)claude mcp list                # claudeusage … ✔ Connected

install.sh installs the package (trying uv, pipx, pip, then a dedicated venv — modern Pythons block system installs), drops the Claude Code skill in ~/.claude/skills/, and registers the MCP server. ./install.sh --uninstall reverses it.

That gives you the claudeusage command and the claudeusage-mcp server. There is no PyPI release; install from the clone.

One more step for the limit tools

Claude Code shows your limit gauge and throws it away — nothing stores it. claudeusage limit and claudeusage chat need that history, so a collector has to sit on your status line. Add this to ~/.claude/settings.json:

json
"statusLine": {  "type": "command",  "command": "claudeusage statusline --print"}

Already have a status line you like? Drop --print and pipe into it — the collector passes the JSON straight through:

json
"command": "claudeusage statusline | bash ~/.claude/my-statusline.sh"

Nothing edits your settings for you — your status line is yours.

claudeusage value and claudeusage usage work right away, with no collector. The limit analysis gets useful after a few days of samples.

Samples live in ~/.claudeusage/ (override with CLAUDEUSAGE_DATA). Running from a clone keeps using the repo's own data/ directory, so an existing history is never orphaned.

Use it from Claude

Ask in plain language — "am I getting my money's worth?", "why is my limit draining so fast?", "how much of my limit did chat eat?" The skill picks the right tool.

MCP toolWhat it answers
subscription_valueLines that survived, waste, cost by activity
limit_breakdownWhat drives the 5-hour and weekly limits
chat_shareHow much of the limit chat ate
current_limitsLimits right now, plus the per-product breakdown

Use it from the shell

bash
claudeusage value --all              # all projectsclaudeusage value --project PATH --wasteclaudeusage limit                    # limit burn per 5-hour windowclaudeusage limit --fit              # fit: what the gauge weighsclaudeusage chat                     # chat's share, weeklyclaudeusage usage                    # live limits + product breakdownclaudeusage check                    # both consistency checkers

Output is English by default. CLAUDEUSAGE_LANG=ko switches it to Korean.

How the chat estimate works

Three sources, each blind in a different way, so they are merged:

SourceGivesBlind when
Status line samples (claudeusage statusline)Gauge readings with reset timesClaude Code isn't running
Claude desktop app historyGauge readings every 15 minThe app isn't running
OAuth usage endpointPer-product truth (Claude Code / chat / Cowork)Only the current weekly window

The estimate is a subtraction: chat = gauge rise − what local logs explain. The "explained" part uses per-model weights fitted by claudeusage limit, fitted only on windows with no suspected off-log usage — otherwise chat usage inflates the weights and the estimator goes blind to itself.

Two things had to be corrected, both found by running it on real data:

  1. Half-observed windows tilt the subtraction. If the gauge is only watched for part of a window, the rise reads low while the attributed cost reads high. Only windows with a known reset time, watched from zero, are counted (55 of 107 here).
  2. Log-derived cost runs 6–9% low — background calls never reach the logs. Left alone, that gap becomes fake chat usage. Each window is scaled against the status line's own total.

claudeusage check verifies 15 invariants, including an anchor: a real window where chat was confirmed by hand.

Accuracy, honestly

  • The per-product breakdown is ground truth, but only two weekly windows of it were collected. Calling the estimator "validated" needs more.
  • The per-token fit is unstable for Opus 5.5: with 40 windows it drives the output-token weight to zero, which cannot be right. Inputs are correlated; per-dollar figures are steadier than per-token ones.
  • Claude Code deletes conversation logs after 30 days by default (cleanupPeriodDays). Gauge samples older than that lose the request data they need, so the limit fit only ever sees the last month.
  • Model weights come from 5–7 clean windows for the less-used models. Direction is solid; the exact multiplier still moves.
  • Limit gauges are integers. One change point is coarse; answers are averages over ~1,200 of them.
  • claudeusage usage reads Claude Code's credentials from the macOS keychain, sends them only to api.anthropic.com, and never prints or stores them. What it records is an allowlist: timestamp, limit kind, model name, percentage, reset time, product shares.

Scope

Claude only. Merging ChatGPT and Gemini exports was the original plan for "combine coding and chat"; it was dropped on purpose. Everything here is built around one Claude account and its rate limits.

Registry

Listed on the official MCP registry as io.github.syk8015/claudeusage.

Also listed on Glama.

License

MIT

来源:README.md,提交 b72735e

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Claude 集成