ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified developer tools Safety 5/5

model-usage-linux

Track OpenClaw AI token usage and cost per model on Linux by parsing session JSONL files. Use when asked about: token usage, API cost, how much has been spent, which model was used most, usage summary, billing, cost breakdown. Linux replacement for the macOS-only model-usage/CodexBar skill.

Why use this skill?

Analyze your OpenClaw AI token usage and API costs on Linux. Track model performance and expenditure with this essential monitoring utility for your local sessions.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/hablabechir/model-usage-linux
Or

What This Skill Does

The model-usage-linux skill serves as a diagnostic and reporting tool designed specifically for Linux users of the OpenClaw AI platform. It provides a robust, command-line interface to analyze local session logs stored in JSONL format. By parsing these session files, the skill calculates detailed metrics, including token consumption (input, output, and cached tokens), turn counts, and estimated financial costs associated with specific LLM models. It is the direct functional equivalent to the legacy macOS-only model-usage or CodexBar tools, ensuring Linux developers maintain parity in tracking their AI infrastructure consumption.

Installation

To integrate this utility into your OpenClaw environment, execute the following command in your terminal:

clawhub install openclaw/skills/skills/hablabechir/model-usage-linux

Once installed, ensure your environment has Python 3 configured. The tool relies on the standard Python interpreter to parse session logs. No additional heavy dependencies are required, making it lightweight for server environments or local development machines. The tool defaults to looking for sessions in your local ~/.openclaw/agents/main/sessions directory, though this path can be customized via the --sessions-dir flag.

Use Cases

This skill is indispensable for power users, developers, and administrators who need to maintain tight control over their AI budgets. Use it to:

  • Monitor monthly token expenditure across different project sessions.
  • Analyze which models are the most cost-effective for specific tasks (e.g., comparing gpt-4o vs claude-3-5-sonnet).
  • Audit usage to detect anomalous high-token-count sessions that might indicate inefficient prompting.
  • Export consumption data for automated reporting via the --format json flag.

Example Prompts

  1. "How much have I spent on token usage across all my sessions this month?"
  2. "Show me a breakdown of which models I've used the most in my development sessions."
  3. "Can you provide a summary of my total token consumption and API costs for the last few days?"

Tips & Limitations

  • Tip: If you frequently analyze logs, consider aliasing the command in your .bashrc or .zshrc file for faster access.
  • Tip: Use the JSON output format to pipe results into visualization tools or custom dashboarding scripts for better data presentation.
  • Limitation: This skill is strictly read-only; it does not modify your session files, ensuring data integrity.
  • Limitation: It requires access to your local filesystem. Ensure your user permissions allow reading the directory where OpenClaw stores its session history.

Metadata

Stars2387
Views1
Updated2026-03-09
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-hablabechir-model-usage-linux": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#linux#usage#monitoring#billing#tokens
Safety Score: 5/5

Flags: file-read