← 返回
开发者工具 中文

Claude Usage Checker

Check Claude Code / Claude Max usage limits. Run when user asks about usage, limits, quota, or how much Claude capacity is left.
检查 Claude Code/Claude Max 使用限制。当用户询问使用情况、限制、配额或剩余容量时运行。
aligurelli
开发者工具 clawhub v1.3.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 1,629
下载
💾 19
安装
1
版本
#latest

概述

Claude Usage Checker

Launches the Claude CLI interactively (PTY) and reads the /usage output to report your Claude Code / Claude Max quota.

Prerequisites

  • Claude CLI must be installed (npm i -g @anthropic-ai/claude-code) and logged in
  • If running claude shows "Missing API key", the user must log in manually first: open a terminal, run claude, and complete the browser login flow
  • Requires an interactive PTY — the agent will launch a local process and read its output (quota info only)

Steps

  1. Launch claude with PTY
  2. Wait for the welcome screen (poll until it appears)
  3. Send /usage + Enter
  4. Read the output (poll until usage data appears)
  5. Close with Escape then /exit
  6. Report the results

Commands

# Launch claude with PTY
exec pty=true command="claude"

# Wait and check log
process action=poll sessionId=XXX timeout=5000

# Send /usage
process action=send-keys sessionId=XXX literal="/usage"
process action=send-keys sessionId=XXX keys=["Enter"]

# Read output
process action=poll sessionId=XXX timeout=5000

# Exit
process action=send-keys sessionId=XXX keys=["Escape"]
process action=send-keys sessionId=XXX literal="/exit"
process action=send-keys sessionId=XXX keys=["Enter"]

Notes

  • If you see "Missing API key" → tell the user to log in; browser-based login won't work headlessly
  • Allow a few seconds between polls — Claude CLI starts slowly
  • "Current week" = weekly reset, not daily

Output Format

Report in a table:

UsageResets
---------
Current sessionX% usedtoday at HH:MM (timezone)
Weekly (all models)X% usedHH:MM (timezone)
Weekly (Sonnet only)X% usedHH:MM (timezone)
Extra usageX% used / $X of $Y spentdate (timezone)

Always show reset times. The CLI displays them as "Resets Xpm" — convert to HH:MM format.

版本历史

共 1 个版本

  • v1.3.0 当前
    2026-03-29 04:15 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Perplexity Web Search

aligurelli
使用Perplexity Sonar Pro进行网络搜索和URL获取。适用于网络搜索、查找信息、获取URL内容或配置网络搜索设置。
★ 6 📥 1,624
developer-tools

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 671 📥 324,378
developer-tools

Gog

steipete
Google Workspace 命令行工具,支持 Gmail、日历、云端硬盘、通讯录、表格和文档。
★ 921 📥 185,826