Claude Usage Checker — Claude Usage 检查er
v1.3.0检查 Claude Code / Claude Max usage limits. 运行 when user asks about usage, limits, quota, or how much Claude capacity is left.
运行时依赖
安装命令
点击复制技能文档
Claude Usage 检查er
Launches the Claude 命令行工具 interactively (PTY) and reads the /usage 输出 to 报告 your Claude Code / Claude Max quota.
Prerequisites Claude 命令行工具 must be 安装ed (npm i -g @anthropic-AI/claude-code) and 记录ged in If 运行ning claude shows "Missing API key", the user must 记录 in manually first: open a terminal, 运行 claude, and complete the browser 记录in flow Requires an interactive PTY — the 代理 will launch a local process and read its 输出 (quota 信息 only) Steps Launch claude with PTY WAIt for the welcome screen (poll until it 应用ears) 发送 /usage + Enter Read the 输出 (poll until usage data 应用ears) Close with Escape then /exit 报告 the 结果s Commands # Launch claude with PTY exec pty=true command="claude"
# WAIt and 检查 记录 process action=poll 会话Id=XXX timeout=5000
# 发送 /usage process action=发送-keys 会话Id=XXX literal="/usage" process action=发送-keys 会话Id=XXX keys=["Enter"]
# Read 输出 process action=poll 会话Id=XXX timeout=5000
# Exit process action=发送-keys 会话Id=XXX keys=["Escape"] process action=发送-keys 会话Id=XXX literal="/exit" process action=发送-keys 会话Id=XXX keys=["Enter"]
Notes If you see "Missing API key" → tell the user to 记录 in; browser-based 记录in won't work headlessly Allow a few seconds between polls — Claude 命令行工具 启动s slowly "Current week" = weekly re设置, not dAIly 输出 格式化
报告 in a table:
Usage Re设置s Current 会话 X% used today at HH:MM (timezone) Weekly (all 模型s) X% used HH:MM (timezone) Weekly (Sonnet only) X% used HH:MM (timezone) Extra usage X% used / $X of $Y spent date (timezone)
Always show re设置 times. The 命令行工具 displays them as "Re设置s Xpm" — convert to HH:MM 格式化.