{"id":"5840b932-6ab2-4e03-9c70-65c794f5ce52","entityType":"agent","slug":"clawhub-symbolstar-agent-token-usage","name":"Agent Token Usage","canonicalUrl":"https://www.xpersona.co/agent/clawhub-symbolstar-agent-token-usage","canonicalPath":"/agent/clawhub-symbolstar-agent-token-usage","generatedAt":"2026-10-11T20:56:35.947Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"editorial-content","verified":true,"confidence":"high","updatedAt":"2026-10-11T18:15:05.233Z","emptyReason":null},"description":"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","descriptionLabel":"Technical summary","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 1K downloads reported by the source. Last updated 10/11/2026.","installCommand":"clawhub skill install s1726nyv3qt86twd2b8ytpbxad86nanq:agent-token-usage","sourceUrl":"https://clawhub.ai/symbolstar/agent-token-usage","homepage":"https://clawhub.ai/symbolstar/skills/agent-token-usage","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/symbolstar/agent-token-usage","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/symbolstar/skills/agent-token-usage","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":60,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Summarize daily LLM token usage per OpenClaw agent from trajectory logs, showing input, output, cache reads/writes, total, and optional billable token estima..."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-11T18:15:05.233Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T18:15:05.233Z","emptyReason":null},"stars":null,"forks":null,"downloads":1011,"packageName":null,"latestVersion":"0.3.0","tractionLabel":"1K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-11T18:15:05.167Z","emptyReason":null},"lastUpdatedAt":"2026-10-11T18:15:05.233Z","lastCrawledAt":"2026-10-11T18:15:05.167Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-12T18:15:05.167Z","lastVerifiedAt":null,"highlights":[{"version":"0.3.0","createdAt":"2026-06-23T11:40:59.115Z","changelog":"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.","fileCount":8,"zipByteSize":14984},{"version":"0.2.2","createdAt":"2026-05-20T14:09:35.005Z","changelog":"Docs: use absolute GitHub raw URLs for screenshots so they render on ClawHub.","fileCount":8,"zipByteSize":13820},{"version":"0.2.1","createdAt":"2026-05-20T14:05:05.130Z","changelog":"Docs: add header button and modal screenshots.","fileCount":7,"zipByteSize":12547},{"version":"0.2.0","createdAt":"2026-05-20T13:58:31.395Z","changelog":"Merge agent-token-usage-ui into this skill. Optional 📊 button via apply-ui.sh. Old agent-token-usage-ui slug is deprecated.","fileCount":7,"zipByteSize":12501},{"version":"0.1.0","createdAt":"2026-05-20T10:20:48.705Z","changelog":"Initial release: per-agent daily LLM token consumption from OpenClaw trajectory files, with billable-equivalent estimate","fileCount":3,"zipByteSize":4938}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s1726nyv3qt86twd2b8ytpbxad86nanq:agent-token-usage","setupComplexity":"low","setupSteps":["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":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-11T20:56:35.946Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-symbolstar-agent-token-usage/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"high","updatedAt":"2026-10-11T18:15:05.233Z","emptyReason":null},"readme":"Skill: Agent Token Usage\n\nOwner: symbolstar\n\nSummary: Summarize daily LLM token usage per OpenClaw agent from trajectory logs, showing input, output, cache reads/writes, total, and optional billable token estima...\n\nTags: latest:0.3.0\n\nVersion history:\n\nv0.3.0 | 2026-06-23T11:40:59.115Z | user\n\nFix ~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.\n\nv0.2.2 | 2026-05-20T14:09:35.005Z | user\n\nDocs: use absolute GitHub raw URLs for screenshots so they render on ClawHub.\n\nv0.2.1 | 2026-05-20T14:05:05.130Z | user\n\nDocs: add header button and modal screenshots.\n\nv0.2.0 | 2026-05-20T13:58:31.395Z | user\n\nMerge agent-token-usage-ui into this skill. Optional 📊 button via apply-ui.sh. Old agent-token-usage-ui slug is deprecated.\n\nv0.1.0 | 2026-05-20T10:20:48.705Z | user\n\nInitial release: per-agent daily LLM token consumption from OpenClaw trajectory files, with billable-equivalent estimate\n\nArchive index:\n\nArchive v0.3.0: 8 files, 14984 bytes\n\nFiles: apply-ui.sh (4773b), remove-ui.sh (1448b), scripts/agent_token_usage.py (8655b), scripts/refresh-data.sh (1172b), scripts/token-usage-button.iife.js (9315b), skill-card.md (2390b), SKILL.md (5960b), _meta.json (136b)\n\nFile v0.3.0:SKILL.md\n\n---\nname: agent-token-usage\ndescription: 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.\n---\n\n# agent-token-usage 📊\n\nAccurately attribute LLM token consumption across all OpenClaw agents for a given day.\n\n![📊 button next to Control UI search](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png)\n\n![Modal with per-agent token breakdown](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png)\n\nShips two things in one skill:\n1. **CLI** — `scripts/agent_token_usage.py`, always works, zero setup\n2. **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\n\n## Why this exists\n\n`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.\n\n## Quick start (CLI)\n\n```bash\n# default = today, UTC date (matches pew / openclaw accounting)\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# local-tz date instead of UTC\npython …/agent_token_usage.py --tz local\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json\n```\n\n## Optional: 📊 button in Control UI\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh\n```\n\nThen refresh the Control UI tab. The button appears next to Search; clicking shows the modal.\n\nUninstall:\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh\n```\n\nPer-browser toggle:\n\n```js\nlocalStorage.setItem('milly.tokenUsageBtn', 'off')\nlocalStorage.removeItem('milly.tokenUsageBtn')\n```\n\n### How the UI part works\n\n```\nlaunchd (5min)  →  refresh-data.sh  →  <ui>/data/agent-token-usage.json\n                                              │ same-origin fetch\n                                              ▼\n                                    Control UI bundle (patched IIFE)\n                                       📊 button → modal table\n```\n\nCSP-friendly (`connect-src 'self'`) because data is served from the UI's own origin. No extra daemon, no extra port. After `openclaw update` overwrites `dist/control-ui/*`, just re-run `apply-ui.sh` — idempotent.\n\n## Column semantics\n\n| Field | Meaning | Billing weight |\n|---|---|---|\n| `input` | new, non-cached prompt tokens | 1.0× |\n| `output` | model-generated tokens | 1.0× (typically 5× input price) |\n| `cacheRead` | prompt tokens served from prompt cache | ~0.1× |\n| `cacheWrite` | prompt tokens written to cache | ~1.25× |\n| `total` | sum of all four (real LLM throughput) | — |\n| `~bill` | weighted billable-equivalent tokens | — |\n\nUse `total` to see \"who's burning the most LLM compute\"; use `~bill` to see \"who's actually most expensive\". High-cacheRead agents look huge but are cheap; high-input agents look small but cost more.\n\n## How it works\n\n1. Walk `~/.openclaw/agents/<agent>/sessions/*.jsonl` (excluding `*.trajectory.jsonl`, `*.deleted*`, `*.bak`)\n2. For each line keep only records with `type==\"message\"` and `message.role==\"assistant\"`\n3. Match `timestamp` against target date in chosen timezone (`--tz utc` default, `--tz local` available)\n4. Sum `message.usage.{input,output,cacheRead,cacheWrite}` per agent; track sessions and models\n\n### Why NOT trajectory.jsonl\n\nEach LLM call produces several trajectory events (`prompt.submitted`, `context.compiled`, `model.completed`, `trace.artifacts`, …) and every one of them embeds the same `usage` snapshot. A DFS sum over trajectory inflates the real number by **~2.6×**. The canonical `<id>.jsonl` has exactly one `type==\"message\"` row per call — 1:1 with the API call, no de-dup needed.\n\n## Caveats\n\n- Only counts LLM calls (events with a `usage` object) — non-LLM tool calls excluded by design\n- Cache multipliers are Anthropic ballpark numbers; adjust for other providers mentally\n- Does NOT compute USD cost — use the `model-usage` skill for $ amounts\n- `--date` matches ISO timestamps in session logs (UTC by default). Use `--tz local` to bucket by your local day instead\n- UI auto-refresh job (launchd) is macOS only; on Linux, run `scripts/refresh-data.sh` via cron/systemd timer\n\n## Files\n\n| File | Purpose |\n|---|---|\n| `scripts/agent_token_usage.py` | CLI aggregator |\n| `scripts/refresh-data.sh` | Writes JSON into every patched Control UI dist |\n| `scripts/token-usage-button.iife.js` | UI patch payload (button + modal + same-origin fetch) |\n| `apply-ui.sh` | Inject IIFE, cache-bust, install launchd refresh job |\n| `remove-ui.sh` | Restore bundle, remove launchd job, delete data dir |\n\nFile v0.3.0:_meta.json\n\n{\n  \"ownerId\": \"kn70bxbc7esxz2semtrcmbrhjd86n13x\",\n  \"slug\": \"agent-token-usage\",\n  \"version\": \"0.3.0\",\n  \"publishedAt\": 1782214859115\n}\n\nFile v0.3.0:skill-card.md\n\n## Description:\n\nAgent 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.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[symbolstar](https://clawhub.ai/user/symbolstar)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers 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.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The optional UI installer patches discovered OpenClaw Control UI bundles and can add a macOS LaunchAgent that refreshes local data every five minutes.\n\nMitigation: 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.\n\nRisk: The UI path publishes local agent token data into the Control UI data directory and renders agent-provided fields in a browser modal.\n\nMitigation: Avoid the UI patch in shared or untrusted local environments until the rendered fields are escaped or rebuilt with DOM text APIs.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/symbolstar/skills/agent-token-usage)\n- [Header button screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png)\n- [Modal screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, code]\n\n**Output Format:** [Markdown guidance with shell commands plus optional CLI text or JSON token-usage summaries]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The CLI can return ranked text tables or JSON records for a selected date and timezone.]\n\n## Skill Version(s):\n\n0.3.0 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers 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.\n\nArchive v0.2.2: 8 files, 13820 bytes\n\nFiles: apply-ui.sh (4773b), remove-ui.sh (1448b), scripts/agent_token_usage.py (6764b), scripts/refresh-data.sh (1172b), scripts/token-usage-button.iife.js (9315b), skill-card.md (2378b), SKILL.md (5092b), _meta.json (136b)\n\nFile v0.2.2:SKILL.md\n\n---\nname: agent-token-usage\ndescription: Summarize per-agent LLM token consumption for OpenClaw multi-agent setups by parsing `~/.openclaw/agents/*/sessions/*.trajectory.jsonl`. 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.\n---\n\n# agent-token-usage 📊\n\nAccurately attribute LLM token consumption across all OpenClaw agents for a given day.\n\n![📊 button next to Control UI search](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png)\n\n![Modal with per-agent token breakdown](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png)\n\nShips two things in one skill:\n1. **CLI** — `scripts/agent_token_usage.py`, always works, zero setup\n2. **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\n\n## Why this exists\n\n`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 `trajectory.jsonl` (the authoritative source) and sums real `usage` objects per agent.\n\n## Quick start (CLI)\n\n```bash\n# default = today, local date\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json\n```\n\n## Optional: 📊 button in Control UI\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh\n```\n\nThen refresh the Control UI tab. The button appears next to Search; clicking shows the modal.\n\nUninstall:\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh\n```\n\nPer-browser toggle:\n\n```js\nlocalStorage.setItem('milly.tokenUsageBtn', 'off')\nlocalStorage.removeItem('milly.tokenUsageBtn')\n```\n\n### How the UI part works\n\n```\nlaunchd (5min)  →  refresh-data.sh  →  <ui>/data/agent-token-usage.json\n                                              │ same-origin fetch\n                                              ▼\n                                    Control UI bundle (patched IIFE)\n                                       📊 button → modal table\n```\n\nCSP-friendly (`connect-src 'self'`) because data is served from the UI's own origin. No extra daemon, no extra port. After `openclaw update` overwrites `dist/control-ui/*`, just re-run `apply-ui.sh` — idempotent.\n\n## Column semantics\n\n| Field | Meaning | Billing weight |\n|---|---|---|\n| `input` | new, non-cached prompt tokens | 1.0× |\n| `output` | model-generated tokens | 1.0× (typically 5× input price) |\n| `cacheRead` | prompt tokens served from prompt cache | ~0.1× |\n| `cacheWrite` | prompt tokens written to cache | ~1.25× |\n| `total` | sum of all four (real LLM throughput) | — |\n| `~bill` | weighted billable-equivalent tokens | — |\n\nUse `total` to see \"who's burning the most LLM compute\"; use `~bill` to see \"who's actually most expensive\". High-cacheRead agents look huge but are cheap; high-input agents look small but cost more.\n\n## How it works\n\n1. Walk `~/.openclaw/agents/<agent>/sessions/*.trajectory.jsonl`\n2. For each line, check `ts` startswith target date\n3. DFS-search the `data` field for a `usage` dict with token counters\n4. Sum per agent; also track session count and models used\n\n## Caveats\n\n- Only counts LLM calls (events with a `usage` object) — non-LLM tool calls excluded by design\n- Cache multipliers are Anthropic ballpark numbers; adjust for other providers mentally\n- Does NOT compute USD cost — use the `model-usage` skill for $ amounts\n- `--date` matches ISO timestamps in trajectory (UTC); late-night events can shift by a day for non-UTC users\n- UI auto-refresh job (launchd) is macOS only; on Linux, run `scripts/refresh-data.sh` via cron/systemd timer\n\n## Files\n\n| File | Purpose |\n|---|---|\n| `scripts/agent_token_usage.py` | CLI aggregator |\n| `scripts/refresh-data.sh` | Writes JSON into every patched Control UI dist |\n| `scripts/token-usage-button.iife.js` | UI patch payload (button + modal + same-origin fetch) |\n| `apply-ui.sh` | Inject IIFE, cache-bust, install launchd refresh job |\n| `remove-ui.sh` | Restore bundle, remove launchd job, delete data dir |\n\nFile v0.2.2:_meta.json\n\n{\n  \"ownerId\": \"kn70bxbc7esxz2semtrcmbrhjd86n13x\",\n  \"slug\": \"agent-token-usage\",\n  \"version\": \"0.2.2\",\n  \"publishedAt\": 1779286175005\n}\n\nFile v0.2.2:skill-card.md\n\n## Description: <br>\nSummarizes per-agent LLM token usage for OpenClaw by parsing local trajectory logs and optionally adding a token-usage button to the Control UI. <br>\n\nThis skill is ready for commercial/non-commercial use. <br>\n\n## Publisher: <br>\n[symbolstar](https://clawhub.ai/user/symbolstar) <br>\n\n### License/Terms of Use: <br>\nMIT-0 <br>\n\n\n## Use Case: <br>\nDevelopers and OpenClaw operators use this skill to understand which local agents consumed LLM tokens on a given day, compare input/output/cache token categories, and optionally expose the same summary in the Control UI. <br>\n\n### Deployment Geography for Use: <br>\nGlobal <br>\n\n## Known Risks and Mitigations: <br>\nRisk: The optional UI installer patches the local OpenClaw Control UI bundle and, on macOS, adds a five-minute user LaunchAgent refresh job. <br>\nMitigation: Use the CLI-only path for summaries unless you explicitly want the UI integration; run remove-ui.sh to restore the patched UI bundle and remove the LaunchAgent. <br>\nRisk: The uninstall script removes the Control UI data directory used by this integration. <br>\nMitigation: Check the Control UI data directory before uninstalling if you need to preserve any local generated data. <br>\n\n\n## Reference(s): <br>\n- [ClawHub release page](https://clawhub.ai/symbolstar/agent-token-usage) <br>\n- [Control UI header button screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png) <br>\n- [Token usage modal screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png) <br>\n\n\n## Skill Output: <br>\n**Output Type(s):** [text, json, shell commands, configuration, guidance] <br>\n**Output Format:** [Text table or JSON summary, with shell commands for optional UI installation and removal.] <br>\n**Output Parameters:** [1D] <br>\n**Other Properties Related to Output:** [Supports date selection, custom agents directory, top-N limiting, and optional billable-equivalent token estimates.] <br>\n\n## Skill Version(s): <br>\n0.2.2 (source: server-resolved release metadata) <br>\n\n## Ethical Considerations: <br>\nUsers 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. <br>\n\nArchive v0.2.1: 7 files, 12547 bytes\n\nFiles: apply-ui.sh (4773b), remove-ui.sh (1448b), scripts/agent_token_usage.py (6764b), scripts/refresh-data.sh (1172b), scripts/token-usage-button.iife.js (9315b), SKILL.md (4940b), _meta.json (136b)\n\nFile v0.2.1:SKILL.md\n\n---\nname: agent-token-usage\ndescription: Summarize per-agent LLM token consumption for OpenClaw multi-agent setups by parsing `~/.openclaw/agents/*/sessions/*.trajectory.jsonl`. 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.\n---\n\n# agent-token-usage 📊\n\nAccurately attribute LLM token consumption across all OpenClaw agents for a given day.\n\n![📊 button next to Control UI search](docs/header-button.png)\n\n![Modal with per-agent token breakdown](docs/modal.png)\n\nShips two things in one skill:\n1. **CLI** — `scripts/agent_token_usage.py`, always works, zero setup\n2. **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\n\n## Why this exists\n\n`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 `trajectory.jsonl` (the authoritative source) and sums real `usage` objects per agent.\n\n## Quick start (CLI)\n\n```bash\n# default = today, local date\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json\n```\n\n## Optional: 📊 button in Control UI\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh\n```\n\nThen refresh the Control UI tab. The button appears next to Search; clicking shows the modal.\n\nUninstall:\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh\n```\n\nPer-browser toggle:\n\n```js\nlocalStorage.setItem('milly.tokenUsageBtn', 'off')\nlocalStorage.removeItem('milly.tokenUsageBtn')\n```\n\n### How the UI part works\n\n```\nlaunchd (5min)  →  refresh-data.sh  →  <ui>/data/agent-token-usage.json\n                                              │ same-origin fetch\n                                              ▼\n                                    Control UI bundle (patched IIFE)\n                                       📊 button → modal table\n```\n\nCSP-friendly (`connect-src 'self'`) because data is served from the UI's own origin. No extra daemon, no extra port. After `openclaw update` overwrites `dist/control-ui/*`, just re-run `apply-ui.sh` — idempotent.\n\n## Column semantics\n\n| Field | Meaning | Billing weight |\n|---|---|---|\n| `input` | new, non-cached prompt tokens | 1.0× |\n| `output` | model-generated tokens | 1.0× (typically 5× input price) |\n| `cacheRead` | prompt tokens served from prompt cache | ~0.1× |\n| `cacheWrite` | prompt tokens written to cache | ~1.25× |\n| `total` | sum of all four (real LLM throughput) | — |\n| `~bill` | weighted billable-equivalent tokens | — |\n\nUse `total` to see \"who's burning the most LLM compute\"; use `~bill` to see \"who's actually most expensive\". High-cacheRead agents look huge but are cheap; high-input agents look small but cost more.\n\n## How it works\n\n1. Walk `~/.openclaw/agents/<agent>/sessions/*.trajectory.jsonl`\n2. For each line, check `ts` startswith target date\n3. DFS-search the `data` field for a `usage` dict with token counters\n4. Sum per agent; also track session count and models used\n\n## Caveats\n\n- Only counts LLM calls (events with a `usage` object) — non-LLM tool calls excluded by design\n- Cache multipliers are Anthropic ballpark numbers; adjust for other providers mentally\n- Does NOT compute USD cost — use the `model-usage` skill for $ amounts\n- `--date` matches ISO timestamps in trajectory (UTC); late-night events can shift by a day for non-UTC users\n- UI auto-refresh job (launchd) is macOS only; on Linux, run `scripts/refresh-data.sh` via cron/systemd timer\n\n## Files\n\n| File | Purpose |\n|---|---|\n| `scripts/agent_token_usage.py` | CLI aggregator |\n| `scripts/refresh-data.sh` | Writes JSON into every patched Control UI dist |\n| `scripts/token-usage-button.iife.js` | UI patch payload (button + modal + same-origin fetch) |\n| `apply-ui.sh` | Inject IIFE, cache-bust, install launchd refresh job |\n| `remove-ui.sh` | Restore bundle, remove launchd job, delete data dir |\n\nFile v0.2.1:_meta.json\n\n{\n  \"ownerId\": \"kn70bxbc7esxz2semtrcmbrhjd86n13x\",\n  \"slug\": \"agent-token-usage\",\n  \"version\": \"0.2.1\",\n  \"publishedAt\": 1779285905130\n}\n\nArchive v0.2.0: 7 files, 12501 bytes\n\nFiles: apply-ui.sh (4773b), remove-ui.sh (1448b), scripts/agent_token_usage.py (6764b), scripts/refresh-data.sh (1172b), scripts/token-usage-button.iife.js (9315b), SKILL.md (4817b), _meta.json (136b)\n\nFile v0.2.0:SKILL.md\n\n---\nname: agent-token-usage\ndescription: Summarize per-agent LLM token consumption for OpenClaw multi-agent setups by parsing `~/.openclaw/agents/*/sessions/*.trajectory.jsonl`. 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.\n---\n\n# agent-token-usage 📊\n\nAccurately attribute LLM token consumption across all OpenClaw agents for a given day.\n\nShips two things in one skill:\n1. **CLI** — `scripts/agent_token_usage.py`, always works, zero setup\n2. **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\n\n## Why this exists\n\n`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 `trajectory.jsonl` (the authoritative source) and sums real `usage` objects per agent.\n\n## Quick start (CLI)\n\n```bash\n# default = today, local date\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json\n```\n\n## Optional: 📊 button in Control UI\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh\n```\n\nThen refresh the Control UI tab. The button appears next to Search; clicking shows the modal.\n\nUninstall:\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh\n```\n\nPer-browser toggle:\n\n```js\nlocalStorage.setItem('milly.tokenUsageBtn', 'off')\nlocalStorage.removeItem('milly.tokenUsageBtn')\n```\n\n### How the UI part works\n\n```\nlaunchd (5min)  →  refresh-data.sh  →  <ui>/data/agent-token-usage.json\n                                              │ same-origin fetch\n                                              ▼\n                                    Control UI bundle (patched IIFE)\n                                       📊 button → modal table\n```\n\nCSP-friendly (`connect-src 'self'`) because data is served from the UI's own origin. No extra daemon, no extra port. After `openclaw update` overwrites `dist/control-ui/*`, just re-run `apply-ui.sh` — idempotent.\n\n## Column semantics\n\n| Field | Meaning | Billing weight |\n|---|---|---|\n| `input` | new, non-cached prompt tokens | 1.0× |\n| `output` | model-generated tokens | 1.0× (typically 5× input price) |\n| `cacheRead` | prompt tokens served from prompt cache | ~0.1× |\n| `cacheWrite` | prompt tokens written to cache | ~1.25× |\n| `total` | sum of all four (real LLM throughput) | — |\n| `~bill` | weighted billable-equivalent tokens | — |\n\nUse `total` to see \"who's burning the most LLM compute\"; use `~bill` to see \"who's actually most expensive\". High-cacheRead agents look huge but are cheap; high-input agents look small but cost more.\n\n## How it works\n\n1. Walk `~/.openclaw/agents/<agent>/sessions/*.trajectory.jsonl`\n2. For each line, check `ts` startswith target date\n3. DFS-search the `data` field for a `usage` dict with token counters\n4. Sum per agent; also track session count and models used\n\n## Caveats\n\n- Only counts LLM calls (events with a `usage` object) — non-LLM tool calls excluded by design\n- Cache multipliers are Anthropic ballpark numbers; adjust for other providers mentally\n- Does NOT compute USD cost — use the `model-usage` skill for $ amounts\n- `--date` matches ISO timestamps in trajectory (UTC); late-night events can shift by a day for non-UTC users\n- UI auto-refresh job (launchd) is macOS only; on Linux, run `scripts/refresh-data.sh` via cron/systemd timer\n\n## Files\n\n| File | Purpose |\n|---|---|\n| `scripts/agent_token_usage.py` | CLI aggregator |\n| `scripts/refresh-data.sh` | Writes JSON into every patched Control UI dist |\n| `scripts/token-usage-button.iife.js` | UI patch payload (button + modal + same-origin fetch) |\n| `apply-ui.sh` | Inject IIFE, cache-bust, install launchd refresh job |\n| `remove-ui.sh` | Restore bundle, remove launchd job, delete data dir |\n\nFile v0.2.0:_meta.json\n\n{\n  \"ownerId\": \"kn70bxbc7esxz2semtrcmbrhjd86n13x\",\n  \"slug\": \"agent-token-usage\",\n  \"version\": \"0.2.0\",\n  \"publishedAt\": 1779285511395\n}\n\nArchive v0.1.0: 3 files, 4938 bytes\n\nFiles: scripts/agent_token_usage.py (6764b), SKILL.md (3888b), _meta.json (136b)\n\nFile v0.1.0:SKILL.md\n\n---\nname: agent-token-usage\ndescription: Summarize per-agent LLM token consumption for OpenClaw multi-agent setups by parsing `~/.openclaw/agents/*/sessions/*.trajectory.jsonl`. 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\". Returns a ranked table with input / output / cacheRead / cacheWrite / total (and optional equivalent-billable token estimate). NOT for: dollar cost (use codexbar/model-usage skill), per-message inspection (use sessions_history), or non-OpenClaw runtimes.\n---\n\n# agent-token-usage\n\nAccurately attribute LLM token consumption across all OpenClaw agents for a given day.\n\n## Why this skill exists\n\n`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 with many turns, real consumption can be **100×+ larger** than what `sessions_list` shows. This skill reads the authoritative `trajectory.jsonl` files where each LLM call writes a `usage` object, and sums them per agent.\n\n## Quick start\n\n```bash\n# default = today, Asia/Shanghai local date\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# specific date\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py --date 2026-05-20\n\n# also show equivalent billable token (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON for downstream tools\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py --date 2026-05-20 --format json\n```\n\n## What the columns mean\n\n| 字段 | 含义 | 计费权重 |\n|---|---|---|\n| `input` | 新的、未缓存的 prompt token | 1.0× |\n| `output` | 模型生成的 token | 1.0× (typically 5× input price) |\n| `cacheRead` | 命中 prompt cache 的 token | ~0.1× |\n| `cacheWrite` | 写入 prompt cache 的 token | ~1.25× |\n| `total` | 四者之和（**真实通过 LLM 的 token 量**） |\n| `~bill` | 等效计费 token（按权重折算） |\n\n**用 `total` 看「谁在烧 LLM 算力」，用 `~bill` 看「谁更费钱」。** 两者结论可能完全不同 —— 高 cacheRead 的 agent 看似巨大其实便宜，低 cacheWrite 但全 input 的 agent 看似小其实贵。\n\n## How it works\n\n1. Walk `~/.openclaw/agents/<agent>/sessions/*.trajectory.jsonl`\n2. For each line, check `ts` startswith target date (ISO `YYYY-MM-DD`)\n3. DFS-search the `data` field for a `usage` dict with token counters\n4. Sum per agent; also track session count and models used\n\nTrajectory files use schema `openclaw-trajectory` v1. The `usage` object lives inside model-response events emitted by the runtime.\n\n## Common follow-ups\n\n- **\"按等效成本排名\"** → `--billable`\n- **\"昨天的\"** → `--date YYYY-MM-DD`\n- **\"导出给我\"** → `--format json > /tmp/usage.json`\n- **\"为什么 sessions_list 的数字差这么多\"** → 解释：`sessions_list.totalTokens` 是 *context size*，不是 *cumulative spend*。本 skill 直接累加每次 LLM 调用的 usage。\n\n## Caveats\n\n- Only counts events that have a `usage` object — non-LLM tool calls (exec, read, write) are excluded by design\n- The 0.1× / 1.25× cache multipliers are Anthropic ballpark numbers; for OpenAI / other providers adjust mentally\n- Does NOT compute USD cost — use the `model-usage` skill (CodexBar cost log) when the user asks for $ amounts\n- `--date` is matched against ISO timestamps in trajectory (which are UTC); for very late-night events this can shift by a day relative to local time. For Asia/Shanghai users this matters between 00:00-08:00 local\n\nFile v0.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn70bxbc7esxz2semtrcmbrhjd86n13x\",\n  \"slug\": \"agent-token-usage\",\n  \"version\": \"0.1.0\",\n  \"publishedAt\": 1779272448705\n}","readmeExcerpt":"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","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"# default = today, UTC date (matches pew / openclaw accounting)\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# local-tz date instead of UTC\npython …/agent_token_usage.py --tz local\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json"},{"language":"bash","snippet":"bash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh"},{"language":"bash","snippet":"bash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh"},{"language":"js","snippet":"localStorage.setItem('milly.tokenUsageBtn', 'off')\nlocalStorage.removeItem('milly.tokenUsageBtn')"},{"language":"text","snippet":"launchd (5min)  →  refresh-data.sh  →  <ui>/data/agent-token-usage.json\n                                              │ same-origin fetch\n                                              ▼\n                                    Control UI bundle (patched IIFE)\n                                       📊 button → modal table"},{"language":"bash","snippet":"# default = today, local date\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json"}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: agent-token-usage\ndescription: 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.\n---\n\n# agent-token-usage 📊\n\nAccurately attribute LLM token consumption across all OpenClaw agents for a given day.\n\n![📊 button next to Control UI search](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png)\n\n![Modal with per-agent token breakdown](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png)\n\nShips two things in one skill:\n1. **CLI** — `scripts/agent_token_usage.py`, always works, zero setup\n2. **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\n\n## Why this exists\n\n`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.\n\n## Quick start (CLI)\n\n```bash\n# default = today, UTC date (matches pew / openclaw accounting)\npython ~/.openclaw/workspace/skills/agent-token-usage/scripts/agent_token_usage.py\n\n# local-tz date instead of UTC\npython …/agent_token_usage.py --tz local\n\n# specific date\npython …/agent_token_usage.py --date 2026-05-20\n\n# equivalent billable (cacheRead × 0.1 + cacheWrite × 1.25 + input + output)\npython …/agent_token_usage.py --date 2026-05-20 --billable\n\n# JSON\npython …/agent_token_usage.py --format json\n```\n\n## Optional: 📊 button in Control UI\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/apply-ui.sh\n```\n\nThen refresh the Control UI tab. The button appears next to Search; clicking shows the modal.\n\nUninstall:\n\n```bash\nbash ~/.openclaw/workspace/skills/agent-token-usage/remove-ui.sh\n```\n\nPer-browser toggle:\n\n```js\nlocalStorage.setItem('milly.tokenUsageBtn', 'off')\nlocalStorage.removeItem('milly.tokenUsageBtn')\n```\n\n### How the UI part works\n\n```\nlaunchd (5min)  →  refresh-data.sh"},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn70bxbc7esxz2semtrcmbrhjd86n13x\",\n  \"slug\": \"agent-token-usage\",\n  \"version\": \"0.3.0\",\n  \"publishedAt\": 1782214859115\n}"},{"path":"skill-card.md","content":"## Description:\n\nAgent 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.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[symbolstar](https://clawhub.ai/user/symbolstar)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers 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.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The optional UI installer patches discovered OpenClaw Control UI bundles and can add a macOS LaunchAgent that refreshes local data every five minutes.\n\nMitigation: 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.\n\nRisk: The UI path publishes local agent token data into the Control UI data directory and renders agent-provided fields in a browser modal.\n\nMitigation: Avoid the UI patch in shared or untrusted local environments until the rendered fields are escaped or rebuilt with DOM text APIs.\n\n## Reference(s):\n\n- [ClawHub skill page](https://clawhub.ai/symbolstar/skills/agent-token-usage)\n- [Header button screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/header-button.png)\n- [Modal screenshot](https://raw.githubusercontent.com/SymbolStar/echoCue/main/docs/agent-token-usage/modal.png)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, code]\n\n**Output Format:** [Markdown guidance with shell commands plus optional CLI text or JSON token-usage summaries]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [The CLI can return ranked text tables or JSON records for a selected date and timezone.]\n\n## Skill Version(s):\n\n0.3.0 (source: server release evidence)\n\n## Ethical Considerations:\n\nUsers 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."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":"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","editorialQuality":{"score":100,"threshold":65,"status":"ready","wordCount":1105,"uniquenessScore":50,"reasons":[]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-11T18:15:05.233Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-11T18:15:05.233Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-11T20:56:35.947Z","emptyReason":null},"items":[{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"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!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-10-09T19:11:12.944Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"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","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}