claude-usage

Query Claude API quota usage for Session, Week, and Sonnet with CLI outputs.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/leonardofhy/openclaw-workspace --skill claude-usage-leonardofhy
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: claude-usage
Source: https://github.com/leonardofhy/openclaw-workspace/tree/main/skills/claude-usage
Command: npx skills add https://github.com/leonardofhy/openclaw-workspace --skill claude-usage-leonardofhy

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

提供即時的 Claude API 使用額度狀態,讓使用者掌握 Session、Week 與 Sonnet 的剩餘與占用,便於資源規劃。

Core Features & Use Cases

  • 即時查看 Session、Week、Sonnet 的使用比率與剩餘容量。
  • 支援命令列輸出格式選項:--oneline、--json,或預設的圖形化輸出。
  • 具備自動重試機制以提高穩定性與可靠性,可在 API 或 CLI 側出現暫時性錯誤時重試。

Quick Start

在終端執行 python3 skills/claude-usage/scripts/claude_usage.py 即可查看當前額度。

Frequently Asked Questions about claude-usage

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I check Claude API quota usage from the CLI?

You can check Claude API quota usage by running a Python script that queries the Claude CLI to display Session, Week, and Sonnet usage ratios and remaining capacity for resource planning.

Can I get Claude API usage data in JSON format for dashboards?

Yes, you can output Claude API usage data in JSON format using the --json flag, or use --oneline for compact output, enabling integration into dashboards or automation workflows.

What should I do when Claude API usage queries fail intermittently?

When Claude API usage queries fail intermittently, an automatic retry mechanism handles transient CLI or API errors, improving query stability and reliability without manual intervention.

Does the Claude usage monitoring script require external dependencies?

No, the Claude usage monitoring script requires no external dependencies; it runs as a standalone Python script querying the existing Claude CLI for quota data.

Why monitor Session, Week, and Sonnet quotas separately for Claude API?

Monitoring Session, Week, and Sonnet quotas separately provides visibility into distinct usage limits, enabling developers and operators to plan API resource allocation proactively.

What is the best way to track Claude API usage limits in automation workflows?

The best way to track Claude API usage limits in automation workflows is executing the Python script with --oneline or --json flags to output structured quota data for programmatic consumption.