← Back to Skills Marketplace
Token Stats
by
A_Saul读A不读鹅
· GitHub ↗
· v1.0.0
· MIT-0
242
Downloads
0
Stars
3
Active Installs
1
Versions
Install in OpenClaw
/install token-stats
Description
统计 OpenClaw 的 token 用量。扫描所有 session JSONL 文件,输出 prompt/cache/output token 明细。Use when: user asks about token usage, cost, consumption, how many tokens were u...
Usage Guidance
This skill appears to do exactly what it says: locally scan your OpenClaw session JSONL files and report token usage. Before running, consider: (1) inspect the included scripts/token_stats.py (already provided) to confirm you’re comfortable with its file reads; (2) it reads files under ~/.openclaw/agents/<agent>/sessions (and optional .deleted/.bak files) — if those files contain sensitive content beyond token metadata, be aware the script will read them locally; (3) SKILL.md uses a {baseDir} example but the script reads your home path directly, so you can run it from anywhere with python3; (4) no network or credential access is required. If you want extra assurance, run the script in a restricted environment or review it line-by-line (it is short and uses only standard library file I/O and JSON parsing).
Capability Analysis
Type: OpenClaw Skill
Name: token-stats
Version: 1.0.0
The skill provides token usage statistics by scanning local OpenClaw session JSONL files. The Python script (scripts/token_stats.py) uses only standard libraries to aggregate data from the application's own data directory (~/.openclaw/) and contains no network activity, obfuscation, or unauthorized file access.
Capability Assessment
Purpose & Capability
Name/description (token usage stats) match the provided script and SKILL.md. The script only needs to read session JSONL files under ~/.openclaw/agents/<agent>/sessions to compute prompt/cache/output token details, which is exactly what the description promises.
Instruction Scope
SKILL.md instructs running the included Python script. The script's runtime behavior is limited to reading session JSONL files and sessions.json in the user's OpenClaw home directory and aggregating usage fields. It does not access unrelated system paths, environment variables, or external endpoints. Minor note: SKILL.md examples use a {baseDir} placeholder, but the script itself reads ~/.openclaw directly, so running it from any directory works.
Install Mechanism
No install specification (instruction-only plus an included script). No downloads or package installs are performed by the skill; it requires only a Python interpreter present on the system, which is proportional for a Python utility.
Credentials
The skill declares no required environment variables or credentials. The script reads only files under ~/.openclaw/agents/<agent>/sessions and sessions.json, which is appropriate for computing OpenClaw token statistics; no unrelated secrets or cloud credentials are requested.
Persistence & Privilege
Flags show no forced persistence (always:false). The skill does not modify other skills or global agent configuration; it only reads session files and prints results. It does not store tokens or install background services.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install token-stats - After installation, invoke the skill by name or use
/token-stats - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release: scan OpenClaw session JSONL files, report prompt/cache/output token breakdown with correct negative-input handling
Metadata
Frequently Asked Questions
What is Token Stats?
统计 OpenClaw 的 token 用量。扫描所有 session JSONL 文件,输出 prompt/cache/output token 明细。Use when: user asks about token usage, cost, consumption, how many tokens were u... It is an AI Agent Skill for Claude Code / OpenClaw, with 242 downloads so far.
How do I install Token Stats?
Run "/install token-stats" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Token Stats free?
Yes, Token Stats is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Token Stats support?
Token Stats is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Token Stats?
It is built and maintained by A_Saul读A不读鹅 (@asauler); the current version is v1.0.0.
More Skills