LaunchKit · 2026
Back to Skills

token-counter

Track and analyze OpenClaw token usage across main, cron, and sub-agent sessions with category, client, model.

2
540 downloads
by @mkhaytman87

Setup & Installation

openclaw skills install @mkhaytman87/token-counter

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install token-counter

What This Skill Does

Parses local OpenClaw session transcripts, metadata, and cron definitions to produce token usage reports. Breaks down consumption by category, client, model, and tool across main, cron, and sub-agent sessions. Supports per-session drilldowns, time-range filters, and JSON export.

Reads directly from local transcript files rather than requiring a dashboard or external service, so reports reflect actual recorded usage with no data leaving the machine.

When to use it

  • Check where tokens went over the past week
  • Get a per-tool breakdown before optimizing a cron job
  • Export a 30-day usage snapshot for cost review
  • Drill into a single session to find a token spike
  • Save daily snapshots to track usage trends over time

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: show me a breakdown of token usage by tool and category for the last 7 days

AGENT
  1. 1Run token-counter with --period 7d and --breakdown tools,category
  2. 2Parser reads session transcripts from $OPENCLAW_DATA_DIR/agents/main/sessions/*.jsonl
  3. 3Attribution logic splits assistant-message tokens across tool calls in each message
  4. 4Aggregates counts by tool name and session category
OUTPUT

Console report listing token totals per tool and per category for the 7-day window