Install
openclaw skills install openclaw-token-usageInspect token usage from local OpenClaw transcripts across a specified time range. Use when the user asks how many tokens were consumed in OpenClaw, GitHub Copilot model usage inside OpenClaw, or wants usage broken down by day, agent, provider, model, session, rankings, CSV exports, or markdown reports.
openclaw skills install openclaw-token-usageUse the bundled script to aggregate token usage recorded in local OpenClaw transcript files under ~/.openclaw/agents/*/sessions/.
Run:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8'
Default output includes:
Optional additions:
--top-sessions 10 for Top N session ranking--csv-dir ~/.openclaw/workspace/output/token-usage-csv for CSV exports--format json for structured output including session totals--format markdown for a ready-to-share reportUTC+8 unless they ask otherwise.--agents when the user asks for specific agents.--providers or --models when the user wants only some models.--top-sessions when the user wants ranking or hotspot analysis..reset / .deleted transcript copies.All agents, human-readable summary:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8'
Only GitHub Copilot provider:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8' \
--providers github-copilot
Specific agents:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8' \
--agents main,xiaocheng,xiaowen
Top sessions ranking:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8' \
--top-sessions 10
JSON export:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8' \
--format json \
--output ~/.openclaw/workspace/output/token-usage.json
CSV exports:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8' \
--csv-dir ~/.openclaw/workspace/output/token-usage-csv
Markdown report:
python3 ~/.openclaw/workspace/skills/openclaw-token-usage/scripts/report_openclaw_token_usage.py \
--from '2026-03-14' \
--to '2026-03-16' \
--tz 'UTC+8' \
--format markdown \
--output ~/.openclaw/workspace/output/token-usage-report.md
The script reports these metrics when present in transcripts:
inputoutputcacheReadcacheWritetotalTokensmessagesSession notes:
sessions.json indexes when available.file:<filename>.Markdown report notes:
Important:
--providers github-copilot.