← 返回 Skills 市场
Token Counter
作者
mkhaytman87
· GitHub ↗
· v1.0.0
806
总下载
2
收藏
2
当前安装
1
版本数
在 OpenClaw 中安装
/install token-counter
功能描述
Track and analyze OpenClaw token usage across main, cron, and sub-agent sessions with category, client, model, and tool attribution. Use when the user asks where tokens are being spent, wants daily/weekly token reports, needs per-session drilldowns, or is planning token-cost optimizations and needs evidence from transcript data.
安全使用建议
This skill appears to do what it says: parse local OpenClaw session data and produce token-usage reports. Before installing or running it, do the following: (1) Inspect scripts/token_counter.py locally (you already have it) to ensure no unexpected network or credential use — the script appears local-only. (2) Note that SKILL.md expects an executable named token-counter but the shipped file is token_counter.py; run it explicitly with python3 or add a wrapper. (3) Be aware the tool reads session transcripts and cron payloads (sensitive data). If you don't want it to access your real OpenClaw data, run it in a sandbox or point it to a copy by setting the appropriate env vars/CLI args. (4) Consider editing the hard-coded DEFAULT_* paths to use your environment variables or explicit CLI arguments to avoid accidental reads of /Users/mikek/... . (5) If you need higher assurance, run the script in a restricted environment and grep for any network/socket calls before allowing it to access production data.
功能分析
Type: OpenClaw Skill
Name: token-counter
Version: 1.0.0
The OpenClaw AgentSkills skill bundle 'token-counter' is benign. Its code and documentation are fully aligned with its stated purpose of analyzing local OpenClaw token usage. The `SKILL.md` and `agents/openai.yaml` files contain no prompt injection attempts or instructions for unauthorized actions. The `scripts/token_counter.py` script accesses only local OpenClaw data files, performs no network communication, and lacks any malicious execution patterns. While the `--output` argument in `token_counter.py` could theoretically allow writing to arbitrary file paths if an absolute path is provided, this is a common feature for reporting tools and does not indicate malicious intent by the skill author, especially given the `SKILL.md` examples show writing within the designated `$OPENCLAW_WORKSPACE`.
能力评估
Purpose & Capability
The skill's name/description (token usage reporting) matches the code's behavior (reads local OpenClaw transcripts and produces reports). However, the SKILL.md examples call an executable named token-counter (hyphen) while the repo contains scripts/token_counter.py (underscore) and there is no install step to create that wrapper. The Python script also embeds default paths under /Users/mikek/.openclaw rather than relying only on the environment variables mentioned in the docs — this divergence is likely accidental but should be fixed or documented.
Instruction Scope
Instructions explicitly direct the skill to read local OpenClaw session index, .jsonl transcripts, and cron/job definitions and to write JSON snapshots to the workspace — this is consistent with the stated purpose. Note: reading session transcripts will expose potentially sensitive conversation content and metadata; the instructions don't attempt to read unrelated system files or network endpoints.
Install Mechanism
There is no install spec (instruction-only skill with a shipped script), so nothing will be downloaded or executed automatically. Risk from installation is low, but the lack of an install step also explains the missing wrapper/executable mentioned above.
Credentials
The skill declares no required env vars or credentials (appropriate), but the docs reference $OPENCLAW_* env vars while the Python script uses hard-coded defaults in /Users/mikek/.openclaw. This mismatch could cause accidental reading/writing of unexpected paths or make the script fail silently. Also the classification rules include specific personal markers (email/domain strings) — those are used for attribution but are static and possibly privacy-sensitive.
Persistence & Privilege
The skill is not always-enabled and is user-invocable. It does not request elevated privileges, nor does it modify other skills or global agent settings according to the provided files.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install token-counter - 安装完成后,直接呼叫该 Skill 的名称或使用
/token-counter触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release: Track and analyze OpenClaw token usage across sessions with category, client, model, and tool attribution
元数据
常见问题
Token Counter 是什么?
Track and analyze OpenClaw token usage across main, cron, and sub-agent sessions with category, client, model, and tool attribution. Use when the user asks where tokens are being spent, wants daily/weekly token reports, needs per-session drilldowns, or is planning token-cost optimizations and needs evidence from transcript data. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 806 次。
如何安装 Token Counter?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install token-counter」即可一键安装,无需额外配置。
Token Counter 是免费的吗?
是的,Token Counter 完全免费(开源免费),可自由下载、安装和使用。
Token Counter 支持哪些平台?
Token Counter 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Token Counter?
由 mkhaytman87(@mkhaytman87)开发并维护,当前版本 v1.0.0。
推荐 Skills