Token导航 LogoToken导航TokenDH.com
Claude Usage Rs logo
开发工具未说明官方级别未说明来源级核验

Claude Usage Rs

MCP Server

用于跟踪Claude API使用情况、速率限制和健康状态的监控工具,可集成到Shell提示符、tmux和Claude Code状态栏中。

工具数

1

提示词数

0

GitHub Stars

0

资源数

0
RustClaude开发工具Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

abhay

提供方

abhay

最后核验

2026/5/17 20:22

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

详细介绍

克劳德用法

claude-usage statusline

跟踪Claude使用窗口、费率限制和API运行状况。固定到shell提示符、tmux和Claude Code状态栏上。

显示促销乘数(2倍非高峰时段等)、5小时和7天费率限制使用情况,包括重置倒计时、上下文窗口填充、每日/每周代币总额、会话成本和Anthropic API状态,以及每个组件的健康和事件详细信息。

配置驱动。 新的促销活动开始了 ~/.claude/usage-windows.json。无需更改代码。

它是什么样子的

克劳德代码状态栏(低使用率-紧凑型):

⚡ 2x OFF-PEAK  ends in 7h 59m
Opus 4.6 (1M context) │ ctx 6% │ d 123k │ w 890k │ ~$4.51 ($6.00/h) │ 5h 9% │ 7d 1%

Claude Code状态栏(使用率高——带有节奏标记的栏):

⚡ 2x OFF-PEAK  ends in 7h 59m
Opus 4.6 (1M context) │ ctx ███████░ 85% │ d 123k │ w 890k │ ~$19.09 ($8.33/h) │ 5h ██▊████░ 92% ↻23m │ 7d ████░┊░░ 45%

标记显示了均匀使用的位置。如果填充超过标记,则燃烧速度比平均速度快。

状态检查:

$ claude-usage
🟢 API: All Systems Operational (just now)
🟢 Off-peak (standard) (1x usage)
   Ends in:      1d 16h
   Promo: Peak Hours Session Limit Adjustment (ongoing)

跨时区日程安排:

$ claude-usage schedule
Peak Hours Session Limit Adjustment
  Peak: mon, tue, wed, thu, fri UTC 13:00 – 19:00

  City               Peak start      Peak end
  ────────────────   ──────────    ──────────
  San Francisco         6:00 AM      12:00 PM
  New York              9:00 AM       3:00 PM
  London                1:00 PM       7:00 PM
  Tokyo                10:00 PM       4:00 AM

API降级(带有事件详细信息):

$ claude-usage api-status
🟠 API: Partially Degraded Service (just now)
  ⚡ Elevated error rates on Claude API [major]
  ↳ Claude API: partial_outage

API降级(通过直接探测检测到5xx):

$ claude-usage api-status
🟠 API overloaded (529)

推迟决定:

$ claude-usage defer large
✅ PROCEED: large at 2x (already in favorable window)

安装

自制:

brew tap abhay/tap
brew install claude-usage

外壳安装程序(macOS/Linux):

curl -fsSL https://raw.githubusercontent.com/abhay/claude-usage-rs/main/install.sh | sh

来源:

cargo install --path .

设置

claude-usage init

写入 usage-windows.json,注册状态行,并设置MCP服务器。如果你有多个 ~/.claude* 目录, init 自动查找并配置所有这些。

要使用最新的嵌入式默认值更新现有配置,请执行以下操作:

claude-usage init --force

要针对特定实例:

CLAUDE_CONFIG_DIR=~/.claude-work claude-usage init

命令

claude-usage              # human-readable status (includes API health)
claude-usage schedule     # peak/off-peak times across timezones
claude-usage watch        # monitor status changes with desktop notifications
claude-usage api-status   # check Anthropic API status (status page + direct probe)
claude-usage label        # compact PS1/Starship token: ⚡2x
claude-usage tmux         # tmux status bar segment
claude-usage statusline   # Claude Code status bar (reads JSON from stdin)
claude-usage json         # machine-readable JSON
claude-usage windows      # list all configured windows
claude-usage defer large  # should I defer this task? (small|medium|large|xl)
claude-usage wait         # block until a favorable window opens

Shell 集成

Zsh/Bash (.zshrc / .bashrc):

PROMPT='$(claude-usage label 2>/dev/null) %n@%m %~ %# '

星舰 (starship.toml):

[custom.claude_usage]
command = "claude-usage label"
when = true
format = "[$output]($style) "
style = "bold green"

终端复用器 (~/.tmux.conf):

set -g status-right '#(claude-usage tmux) | %H:%M'
set -g status-interval 60

阻挡,直到2x开始:

claude-usage wait && claude "refactor the auth module"

MCP服务器(克劳德代码集成)

Claude可以通过MCP在任务中期检查使用窗口:

{
  "mcpServers": {
    "claude-usage": {
      "command": "claude-usage",
      "args": ["mcp"]
    }
  }
}

或者跑 claude-usage init 自动注册。

可用工具:

  • should_defer_task:返回给定任务大小的推迟/继续建议

添加促销

编辑 ~/.claude/usage-windows.json 并输入一个条目:

{
  "id": "anthropic-summer-2026",
  "label": "Summer 2026 Promo",
  "description": "2x usage on weekends",
  "source": "https://support.claude.com/...",
  "active_range": {
    "start": "2026-06-01T00:00:00Z",
    "end":   "2026-06-30T23:59:59Z"
  },
  "tiers": [
    {
      "id": "weekend",
      "label": "Weekend (2x)",
      "multiplier": 2.0,
      "favorable": true,
      "schedule": {
        "type": "recurring",
        "days": ["sat", "sun"],
        "utc_start": "00:00",
        "utc_end": "23:59"
      }
    },
    {
      "id": "weekday",
      "label": "Weekday (1x)",
      "multiplier": 1.0,
      "favorable": false,
      "schedule": {
        "type": "recurring",
        "days": ["mon", "tue", "wed", "thu", "fri"],
        "utc_start": "00:00",
        "utc_end": "23:59"
      }
    }
  ],
  "plans": ["pro", "max", "team"]
}

计划类型

类型它做什么
recurring匹配特定工作日+UTC时间窗口
inverse_recurring匹配一切 *外面* 循环窗口
always始终匹配(整个促销活动的扁平倍数)

平台支持

macOS和Linux。目前还不支持Windows。

许可证

麻省理工学院

目录标签

目录标签

RustClaude开发工具API监控本地部署速率限制状态栏集成Shell插件成本管理

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

未说明

鉴权方式(authType,认证方式)

token

工具数量(toolCount,工具数)

1

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

未说明token部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

仍需确认:installCommand

来源信息

继续浏览同类 MCP