Claude Usage Calculator for Openclaw

A specialized tool to track and visualize Claude Max subscription consumption and rate limits from session data.

lemodigital
v1.0.0
Feb 10, 2026
0
1.8k
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install claude-usage

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install claude-usage using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Claude Usage Calculator?

The Claude Usage Calculator is a technical utility designed to provide transparency into how Claude Max subscriptions consume credits. By analyzing session data, it offers developers and power users a detailed look at their credit consumption against weekly budgets and 5-hour sliding windows, ensuring you never hit unexpected rate limits while using Openclaw Skills.

This tool is essential for managing costs and optimizing session length across different Claude models like Opus, Sonnet, and Haiku. It bridges the gap between raw session logs and actionable subscription management, providing a clear visual representation of your remaining resources.

Claude Usage Calculator Use Cases

  • Monitoring credit consumption during heavy development sessions.
  • Checking the remaining weekly budget for a specific Claude subscription plan.
  • Identifying which specific sessions or models are consuming the most resources.
  • Avoiding 5-hour rate limit throttles by checking usage windows.
  • Auditing token usage including input, output, and cache writes.

How Claude Usage Calculator Works

  1. The skill accesses the local session JSONL files located in the agent directory.
  2. It parses token data for input, output, and cache writes for every interaction within the specified timeframes.
  3. Credits are calculated using a model-specific formula that weights different token types while treating cache reads as free.
  4. The script compares total usage against the user's specific plan (Pro, 5x, or 20x) and weekly reset schedule.
  5. A comprehensive report is generated, displaying a progress bar for weekly budgets and warnings for the 5-hour sliding rate limit window.

Claude Usage Calculator Setup

To begin tracking your usage with Openclaw Skills, you first need to identify your weekly reset time and plan level from your Claude account settings. Run the following command to save your configuration:

python3 {SKILL_DIR}/scripts/claude-usage.py "2026-02-09 14:00" --plan 5x --save

Ensure you have Python 3.9+ installed and that your session files are located in the default directory at ~/.openclaw/agents/main/sessions/.

Claude Usage Calculator Data Schema & Taxonomy

The skill organizes data by reading from JSONL session files and applying the following credit rates per model:

Model Input Rate Output Rate
Claude Haiku 2/15 10/15
Claude Sonnet 6/15 30/15
Claude Opus 10/15 50/15

It calculates total consumption using the formula: credits = (input_tokens + cache_write_tokens) * input_rate + output_tokens * output_rate. The system also tracks plan-specific thresholds such as the 550,000 credit limit for Pro plans versus the 11,000,000 credit limit for 20x plans.

Claude Usage Calculator Advanced Features

  • Sliding 5-hour window analysis to prevent rate limit lockouts during intense coding sessions.
  • Support for multiple subscription tiers (Pro, 5x, 20x) with custom budget calculations.
  • Granular session search using substring matches on session keys or unique IDs.
  • JSON output mode for integration with other automated workflows or custom developer dashboards.
  • Automatic detection and filtering of non-Claude models to ensure credit accuracy in multi-model environments.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*