← Back to Skills Marketplace
huyiling1111

Token Stats

by huyiling1111 · GitHub ↗ · v2.6.1 · MIT-0
cross-platform ⚠ suspicious
58
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install ai-agent-usage-stats
Description
选择要监控的 AI 助手 → 查看 token 消耗。支持 Hermes / Claude Code / CodeX / OpenClaw,每次都让你选
README (SKILL.md)

agent-usage-stats — 选个 Agent 看它的消耗

核心原则

  1. 每次运行都弹菜单 — 你想看哪个 Agent 就选哪个,不预设
  2. 数据来自本地 — 不联网,纯读你的 Agent 本地数据文件
  3. 零依赖 — 纯 Python 标准库,装完即用

前置条件

  • Python 3.11+
  • 至少一种 Agent 有使用记录:Hermes / Claude Code / CodeX / OpenClaw
  • 安装方式:clawhub install ai-agent-usage-stats,然后 python3 ~/skills/ai-agent-usage-stats/agent-usage-stats.py setup

用法速查

# 交互式菜单(默认)
agent-usage-stats

# 跳过菜单直接看
agent-usage-stats -a hermes
agent-usage-stats -a claude-code
agent-usage-stats -a codex

# 实时监控
agent-usage-stats --watch
agent-usage-stats -a hermes --watch

# 查看本机装了哪些 Agent
agent-usage-stats --list-backends

# 查看版本
agent-usage-stats --version

Hermes 集成

Hermes 的 SKILL.md 里可以这样用:

run: agent-usage-stats -a hermes

这样每次任务结束会自动输出 Hermes 的 token 消耗,不弹菜单。

数据源说明

Agent 数据读哪里
Hermes ~/.hermes/state.db → sessions 表
Claude Code ~/.claude/projects/**/*.jsonl
CodeX ~/.codex/state_*.sqlite → threads 表
OpenClaw ~/.openclaw/agents/main/sessions/
Usage Guidance
Install only if you are comfortable with a local tool reading your AI assistant usage/history files and changing PATH/wrapper/config files during setup or uninstall. Be especially cautious on Windows+WSL, avoid editing its saved paths.json to untrusted paths, and prefer manual ClawHub updates over the built-in update command until the WSL subprocess construction and setup/update confirmations are improved.
Capability Tags
requires-sensitive-credentials
Capability Assessment
Purpose & Capability
The core function of reading local AI-agent usage logs is coherent with the stated purpose, and the main README discloses the local data sources. However, the executable also includes setup, uninstall, and self-update flows beyond simple viewing.
Instruction Scope
Normal stats commands are user-directed and mostly scoped to selected agents, but '--all' and the menu can read multiple local agent history stores. The short SKILL.md lists fewer supported agents than the fuller README/code.
Install Mechanism
The setup flow creates wrappers and modifies PATH through shell rc files or the Windows user PATH; the update flow invokes ClawHub commands and copies updated files into the skill directory. These actions are disclosed but broad for a stats utility and lack strong confirmation/dry-run controls.
Credentials
Reading local SQLite/JSONL usage files is proportionate, but the WSL fallback dynamically builds a python3 -c script with path data, creating avoidable code-injection risk if path/config data is maliciously shaped.
Persistence & Privilege
The skill persists a wrapper in ~/.local/bin, edits user PATH configuration, stores discovered agent paths under ~/.config/agent-usage-stats, and uninstall removes those config directories. These are user-commanded, not hidden, but they materially change the local environment.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install ai-agent-usage-stats
  3. After installation, invoke the skill by name or use /ai-agent-usage-stats
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.6.1
Initial release as ai-agent-usage-stats
Metadata
Slug ai-agent-usage-stats
Version 2.6.1
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is Token Stats?

选择要监控的 AI 助手 → 查看 token 消耗。支持 Hermes / Claude Code / CodeX / OpenClaw,每次都让你选. It is an AI Agent Skill for Claude Code / OpenClaw, with 58 downloads so far.

How do I install Token Stats?

Run "/install ai-agent-usage-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 huyiling1111 (@huyiling1111); the current version is v2.6.1.

💬 Comments