搜索

PythonReactSEOPDF
OpenClaw

claude-usage

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, or sends /claude_usage.

chunhualiao0 来源安装数☆ 0 仓库 Stars

安装与使用

请根据来源仓库和你的 AI 工具说明安装此技能。先阅读技能文件和依赖要求,再添加到工作流。

SkillHub CLI

skillhub install chunhualiao/openclaw-claude-usage

打开来源仓库,查看说明和兼容环境后,按来源提供的命令或步骤安装。

将来源链接提供给你的 Agent,让它先读取说明、核对依赖,并向你说明将执行的安装步骤。

查看来源 ↗使用指南

技能说明

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:

    expect -c '
    spawn claude
    expect "Welcome"
    send "/usage\r"
    expect "Show plan usage"
    sleep 1
    send "\r"
    expect "Resets"
    '
    
  2. 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
  3. Strip ANSI escape codes from output before parsing

  4. 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)

来源信息

Source
github
Repository
openclaw/skills
Path
skills/chunhualiao/openclaw-claude-usage
Version
—
Commit
0b0f10f6c70ce4894049b563e24af9a2dca0fdaa
分类来源
rules
状态
active
可见性
public

这些信息来自收录时的来源分析,可能滞后;使用前请核对最新来源文件。

README

claude-usage

Check your Claude Max subscription usage limits via the Claude Code CLI.

What It Does

This skill launches the Claude Code CLI interactively, runs the /usage command, and extracts your current subscription usage metrics including:

  • Current session usage: percentage used and reset time
  • Current week (all models): percentage used and reset date
  • Current week (Sonnet only): percentage used (if available)

Perfect for monitoring your Claude API quota without leaving your agent workflow.

Requirements

  • Claude Code CLI must be installed and authenticated
    • Install: npm install -g @anthropic-ai/claude-code or brew install anthropic-ai/tap/claude
    • Authenticate: claude auth login
  • Claude Max subscription (the skill checks Max plan usage)
  • expect must be installed (available on macOS via /usr/bin/expect)

Installation

As a standalone skill:
cd ~/.openclaw/workspace/skills
git clone https://github.com/openclaw-community/openclaw-skill-claude-usage.git claude-usage

Usage

Ask your agent:

  • "What's my Claude usage?"
  • "How much Claude quota do I have left?"
  • "Check my Claude Max subscription limits"
  • Or send: /claude_usage

The agent will:

  1. Launch Claude Code CLI using expect script automation
  2. Execute the /usage command automatically
  3. Parse the output and strip ANSI codes
  4. Return your usage metrics in a readable format

Example Output

Current session: 21% used (Resets 5:59pm PST)
Current week (all models): 28% used (Resets Feb 21 at 6am PST)
Current week (Sonnet only): 29% used (Resets Feb 21 at 7am PST)
Extra usage: $50 free available

Scope & Boundaries

What this skill handles:

  • Reading Claude Max plan usage from Claude Code CLI
  • Parsing and formatting usage metrics for user

What this skill does NOT handle:

  • Modifying subscription plans or billing
  • Enabling/disabling extra usage
  • API credit management (separate from Max plan)
  • Checking...

来源内容

SKILL.md
# 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"
   '
   ```

2. 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

3. Strip ANSI escape codes from output before parsing

4. 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)
README
# claude-usage

Check your Claude Max subscription usage limits via the Claude Code CLI.

## What It Does

This skill launches the Claude Code CLI interactively, runs the `/usage` command, and extracts your current subscription usage metrics including:

- **Current session usage**: percentage used and reset time
- **Current week (all models)**: percentage used and reset date
- **Current week (Sonnet only)**: percentage used (if available)

Perfect for monitoring your Claude API quota without leaving your agent workflow.

## Requirements

- **Claude Code CLI** must be installed and authenticated
  - Install: `npm install -g @anthropic-ai/claude-code` or `brew install anthropic-ai/tap/claude`
  - Authenticate: `claude auth login`
- **Claude Max subscription** (the skill checks Max plan usage)
- **expect** must be installed (available on macOS via `/usr/bin/expect`)

## Installation

### As a standalone skill:

```bash
cd ~/.openclaw/workspace/skills
git clone https://github.com/openclaw-community/openclaw-skill-claude-usage.git claude-usage
```

## Usage

Ask your agent:
- "What's my Claude usage?"
- "How much Claude quota do I have left?"
- "Check my Claude Max subscription limits"
- Or send: `/claude_usage`

The agent will:
1. Launch Claude Code CLI using `expect` script automation
2. Execute the `/usage` command automatically
3. Parse the output and strip ANSI codes
4. Return your usage metrics in a readable format

## Example Output

```
Current session: 21% used (Resets 5:59pm PST)
Current week (all models): 28% used (Resets Feb 21 at 6am PST)
Current week (Sonnet only): 29% used (Resets Feb 21 at 7am PST)
Extra usage: $50 free available
```

## Scope & Boundaries

**What this skill handles:**
- Reading Claude Max plan usage from Claude Code CLI
- Parsing and formatting usage metrics for user

**What this skill does NOT handle:**
- Modifying subscription plans or billing
- Enabling/disabling extra usage
- API credit management (separate from Max plan)
- Checking...

相关技能

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

geo-optimization

capt-marbles

Generative Engine Optimization (GEO) for AI search visibility. Optimize content to appear in ChatGPT, Perplexity, Claude, and Google AI Overviews. Use when optimizing websites, pages, or content for LLM discove...

OpenClaw

0protocol

0isone

Agents can sign plugins, rotate credentials without losing identity, and publicly attest to behavior.