Agent Token Usage
Summarize daily LLM token usage per OpenClaw agent from trajectory logs, showing input, output, cache reads/writes, total, and optional billable token estima... Skill: Agent Token Usage Owner: symbolstar Summary: Summarize daily LLM token usage per OpenClaw agent from trajectory logs, showing input, output, cache reads/writes, total, and optional billable token estima... Tags: latest:0.3.0 Version history: v0.3.0 | 2026-06-23T11:40:59.115Z | user Fix ~2.6x over-count: switch source from *.trajectory.jsonl (which emits multiple events per LLM call, each carrying the same usag
Rank
62
Safety
84
Downloads
1.0k
Updated
Oct 11, 2026
Version
0.3.0
Source
CLAWHUB
About
What it does, and when to use it.
Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.
Avoid when
- Contract metadata is missing or unavailable for deterministic execution.
Risk flags: missing_or_unavailable_contract, trust_data_unavailable, schema_references_missing
Public facts
Every fact links back to the source it came from.
- Vendor
- Clawhubvendor · observed Oct 11, 2026
- Protocol compatibility
- OpenClawcompatibility · observed Oct 11, 2026
- Adoption signal
- 1K downloadsadoption · observed Oct 11, 2026
- Latest release
- 0.3.0release · observed Jun 23, 2026
- Handshake status
- UNKNOWNsecurity
Install and run
Setup complexity: low.
clawhub skill install s1726nyv3qt86twd2b8ytpbxad86nanq:agent-token-usage- Setup complexity is LOW. This package is likely designed for quick installation with minimal external side-effects.
- Final validation: Expose the agent to a mock request payload inside a sandbox and trace the network egress before allowing access to real customer data.
Contract: missing
curl -s "https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/snapshot"
Run-check
$0.02 USD1 measured facts are behind this paywall: success rate and latency, uptime and estimated cost, when not to use it, how to call it, benchmark scores.
Agents pay $0.02 in USDC. A card payment is $0.50, the smallest a card allows.
Documentation
CLAWHUB
32,047 characters of source documentation, loaded on request.
Extracted files
3 files captured from the source.
SKILL.md
---
name: agent-token-usage
description: Summarize per-agent LLM token consumption for OpenClaw multi-agent setups by parsing `~/.openclaw/agents/*/sessions/<id>.jsonl` session logs (type=message, role=assistant). Ships both a CLI (Python) and an optional 📊 button injected into the Control UI header next to Search. Use when the user asks "今天哪个 agent 用了多少 token / 消耗了多少 token / token 排行 / token 统计 / how much did agent X spend today / which agent burns the most tokens / token usage breakdown / billable token estimate", or asks to install/remove the 📊 token-usage button in Control UI. Returns a ranked table with input / output / cacheRead / cacheWrite / total (and equivalent-billable token estimate). NOT for: dollar cost (use codexbar/model-usage skill), per-message inspection (use sessions_history), or non-OpenClaw runtimes.
---
# agent-token-usage 📊
Accurately attribute LLM token consumption across all OpenClaw agents for a given day.


Ships two things in one skill:
1. **CLI** — `scripts/agent_token_usage.py`, always works, zero setup
2. **UI button** — optional `apply-ui.sh` injects a 📊 button into Control UI's header next to Search; clicking shows today's per-agent table in a modal
## Why this exists
`sessions_list` returns each session's `totalTokens` field which is the **last context window size**, NOT the cumulative consumption across all LLM calls in that session. For long-running sessions, real consumption can be **100×+ larger**. This skill reads the canonical session log (`<id>.jsonl`, NOT `<id>.trajectory.jsonl`) and sums every `type=="message"` / `role=="assistant"` row's `usage` object — exactly one entry per real LLM API call. This matches `pew` / openclaw's own accounting.
## Quick start (CLI)
```bash
# default = today, UTC date (matches pew / openclaw accounting)
python ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py
# local-tz date instead of UTC
python …/agent_token_usage.py --tz local
# specific date
python …/agent_token_usage.py --date 2026-05-20
# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)
python …/agent_token_usage.py --date 2026-05-20 --billable
# JSON
python …/agent_token_usage.py --format json
```
## Optional: 📊 button in Control UI
```bash
bash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh
```
Then refresh the Control UI tab. The button appears next to Search; clicking shows the modal.
Uninstall:
```bash
bash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh
```
Per-browser toggle:
```js
localStorage.setItem('milly.tokenUsageBtn', 'off')
localStorage.removeItem('milly.tokenUsageBtn')
```
### How the UI part works
```
launchd (5min) → refresh-data.sh_meta.json
{
"ownerId": "kn70bxbc7esxz2semtrcmbrhjd86n13x",
"slug": "agent-token-usage",
"version": "0.3.0",
"publishedAt": 1782214859115
}skill-card.md
## Description: Agent Token Usage summarizes per-agent LLM token consumption for OpenClaw by reading canonical assistant message usage records from session JSONL logs and optionally installing a Control UI button for daily summaries. This skill is ready for commercial/non-commercial use. ## Publisher: [symbolstar](https://clawhub.ai/user/symbolstar) ### License/Terms of Use: MIT-0 ## Use Case: Developers and engineers use this skill to inspect daily OpenClaw agent token usage, rank agents by input, output, cache read, cache write, total, and billable-equivalent tokens, and optionally expose the same summary in the local Control UI. ### Deployment Geography for Use: Global ## Known Risks and Mitigations: Risk: The optional UI installer patches discovered OpenClaw Control UI bundles and can add a macOS LaunchAgent that refreshes local data every five minutes. Mitigation: Use the CLI-only path when a token summary is sufficient; review apply-ui.sh before running it and use remove-ui.sh to restore patched UI assets and remove the scheduled job. Risk: The UI path publishes local agent token data into the Control UI data directory and renders agent-provided fields in a browser modal. Mitigation: Avoid the UI patch in shared or untrusted local environments until the rendered fields are escaped or rebuilt with DOM text APIs. ## Reference(s): - [ClawHub skill page](https://clawhub.ai/symbolstar/skills/agent-token-usage) - [Header button screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png) - [Modal screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png) ## Skill Output: **Output Type(s):** [text, markdown, shell commands, configuration, code] **Output Format:** [Markdown guidance with shell commands plus optional CLI text or JSON token-usage summaries] **Output Parameters:** [1D] **Other Properties Related to Output:** [The CLI can return ranked text tables or JSON records for a selected date and timezone.] ## Skill Version(s): 0.3.0 (source: server release evidence) ## Ethical Considerations: Users should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.
AionUi
Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!
activepieces
AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
cherry-studio
AI productivity studio with smart chat, autonomous agents, and 300+ assistants.
CopilotKit
The Frontend for Agents & Generative UI. React + Angular
Machine-readable data
The same record, as JSON, for agents and crawlers.
{
"facts": [
{
"factKey": "vendor",
"category": "vendor",
"label": "Vendor",
"value": "Clawhub",
"href": "https://clawhub.ai/symbolstar/skills/agent-token-usage",
"sourceUrl": "https://clawhub.ai/symbolstar/skills/agent-token-usage",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T18:15:05.233Z",
"isPublic": true
},
{
"factKey": "protocols",
"category": "compatibility",
"label": "Protocol compatibility",
"value": "OpenClaw",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/contract",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/contract",
"sourceType": "contract",
"confidence": "medium",
"observedAt": "2026-10-11T18:15:05.233Z",
"isPublic": true
},
{
"factKey": "traction",
"category": "adoption",
"label": "Adoption signal",
"value": "1K downloads",
"href": "https://clawhub.ai/symbolstar/agent-token-usage",
"sourceUrl": "https://clawhub.ai/symbolstar/agent-token-usage",
"sourceType": "profile",
"confidence": "medium",
"observedAt": "2026-10-11T18:15:05.233Z",
"isPublic": true
},
{
"factKey": "latest_release",
"category": "release",
"label": "Latest release",
"value": "0.3.0",
"href": "https://clawhub.ai/symbolstar/agent-token-usage",
"sourceUrl": "https://clawhub.ai/symbolstar/agent-token-usage",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-23T11:40:59.115Z",
"isPublic": true
},
{
"factKey": "handshake_status",
"category": "security",
"label": "Handshake status",
"value": "UNKNOWN",
"href": "https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/trust",
"sourceUrl": "https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/trust",
"sourceType": "trust",
"confidence": "medium",
"observedAt": null,
"isPublic": true
}
],
"events": [
{
"eventType": "release",
"title": "Release 0.3.0",
"description": "Fix ~2.6x over-count: switch source from *.trajectory.jsonl (which emits multiple events per LLM call, each carrying the same usage snapshot) to canonical session *.jsonl (type=message, role=assistant). Add --tz utc|local (default utc, aligns with pew). Pew's 86.9M vs old 229M for the same day was caused by this bug.",
"href": "https://clawhub.ai/symbolstar/agent-token-usage",
"sourceUrl": "https://clawhub.ai/symbolstar/agent-token-usage",
"sourceType": "release",
"confidence": "medium",
"observedAt": "2026-06-23T11:40:59.115Z",
"isPublic": true
}
]
}Record generated Oct 11, 2026.
