← 返回
AI智能 中文

Claude Usage Release

Check Claude Max plan usage limits by launching Claude Code and running /usage. Use when the user asks about Claude plan usage, remaining quota, rate limits,...
启动 Claude Code,运行 /usage 查看 Claude Max 计划使用限制。用户询问使用量、剩余配额或速率限制时使用。
chunhualiao
AI智能 clawhub v1.0.1 1 版本 99761.7 Key: 无需
★ 0
Stars
📥 1,256
下载
💾 54
安装
1
版本
#latest

概述

Claude Usage

Check Claude Max subscription usage by launching Claude Code interactively.

Requirements

  • expect must be installed (available at /usr/bin/expect on macOS)
  • Claude Code CLI must be installed and authenticated

Procedure

Use expect to automate the interactive TUI (the /usage command is a terminal UI, not a simple CLI):

  1. Run the expect script to launch Claude Code and execute /usage:

```bash

expect -c '

spawn claude

expect "Welcome"

send "/usage\r"

expect "Show plan usage"

sleep 1

send "\r"

expect "Resets"

'

```

  1. Parse the output for these metrics:
    • Current session: Look for "Current session" line with percentage and reset time
    • Current week (all models): Look for "Current week (all models)" with percentage and reset date
    • Current week (Sonnet only): Look for "Current week (Sonnet only)" with percentage
    • Extra usage: Look for "Extra usage" line
  1. Strip ANSI escape codes from output before parsing
  1. Format and relay the metrics to the user

Example Output

The expect script returns something like:

Current session     ██████████░░░░░░░░░░░░░░░░░ 21% used    Resets 5:59pm (America/Los_Angeles)

Current week (all models)
████████████████████████░░░░░░░░░░░░░ 28% used    Resets Feb 21 at 6am (America/Los_Angeles)

Current week (Sonnet only)
█████████████████████████░░░░░░░░░░░░ 29% used    Resets Feb 21 at 7am (America/Los_Angeles)

Extra usage
Extra usage not enabled • /extra-usage to enable

$50 free extra usage · /extra-usage to enable

Fallback

If expect is not available, fall back to:

  1. claude auth status - shows subscription type (Max/Pro)
  2. ~/.claude/stats-cache.json - shows local session token counts (limited data)

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-03-29 05:09 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Save to Obsidian

chunhualiao
通过 SSH 将 Markdown 内容保存到远程 Obsidian 库
★ 1 📥 1,876
ai-intelligence

ontology

oswalpalash
类型化知识图谱,用于结构化智能体记忆与可组合技能。支持创建/查询实体(人员、项目、任务、事件、文档)及关联...
★ 710 📥 243,637
ai-intelligence

self-improving agent

pskoett
捕获经验教训、错误和纠正,以实现持续改进。使用时机:(1)命令或操作意外失败;(2)用户纠正……
★ 4,058 📥 797,409