← 返回 Skills 市场
Agent Usage Stats
作者
zhouhaoyong
· GitHub ↗
· v2.1.3
· MIT-0
100
总下载
0
收藏
0
当前安装
23
版本数
在 OpenClaw 中安装
/install agent-usage-stats
功能描述
选择要监控的 AI 助手 → 查看 token 消耗。支持 Hermes / Claude Code / CodeX / OpenClaw,每次都让你选
使用说明 (SKILL.md)
token-stats — 选个 Agent 看它的消耗
核心原则
- 每次运行都弹菜单 — 你想看哪个 Agent 就选哪个,不预设
- 数据来自本地 — 不联网,纯读你的 Agent 本地数据文件
- 零依赖 — 纯 Python 标准库,装完即用
前置条件
- Python 3.8+
- 至少一种 Agent 有使用记录:Hermes / Claude Code / CodeX / OpenClaw
- 安装方式:
clawhub install agent-usage-stats,然后python3 ~/skills/agent-usage-stats/token-stats.py setup
用法速查
# 交互式菜单(默认)
token-stats
# 跳过菜单直接看
token-stats -b hermes
token-stats -b claude-code
token-stats -b codex
# 实时监控
token-stats --watch
token-stats -b hermes --watch
# 查看本机装了哪些 Agent
token-stats --list-backends
# 查看版本
token-stats --version
Hermes 集成
Hermes 的 SKILL.md 里可以这样用:
run: token-stats -b hermes
这样每次任务结束会自动输出 Hermes 的 token 消耗,不弹菜单。
数据源说明
| Agent | 数据读哪里 |
|---|---|
| Hermes | ~/.hermes/state.db → sessions 表 |
| Claude Code | ~/.claude/projects/**/*.jsonl |
| CodeX | ~/.codex/state_*.sqlite → threads 表 |
| OpenClaw | ~/ai-testing-lab/openclaw/data/.../sessions.json |
安全使用建议
Before installing, understand that this tool reads local AI-assistant logs and state files to calculate usage, and its setup creates a persistent `token-stats` command. The documented behavior is coherent and local-only, but verify the installed version because the bundled files show some version drift.
能力标签
能力评估
Purpose & Capability
The purpose is coherent: it reports token usage for Hermes, Claude Code, CodeX, and OpenClaw. It necessarily reads local agent state/log files, which may contain sensitive session metadata even though the advertised output is usage statistics.
Instruction Scope
Usage is mostly user-directed through a menu or explicit backend flags. The optional Hermes integration can run automatically after tasks, but the documented action is limited to printing token usage.
Install Mechanism
There is no install spec, but the README instructs the user to run a Python setup command that creates a global wrapper. This is disclosed and purpose-aligned, though Python/setup requirements are not fully reflected in registry requirements.
Credentials
The skill’s file access is scoped to known local AI-assistant data locations and exports only on user request. Reading all Claude Code project logs or all agents is still something users should understand before use.
Persistence & Privilege
Setup creates a persistent local command under the user account, without elevated privilege in the provided artifacts. No hidden background service or self-propagation is shown.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install agent-usage-stats - 安装完成后,直接呼叫该 Skill 的名称或使用
/agent-usage-stats触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.1.3
Version 2.1.3
- Updated version number in documentation.
- No feature or functionality changes.
v2.1.2
修复: Claude Code 按消息时间戳精确过滤(非 mtime)、Hermes 包含跨天会话
v2.1.1
多 Agent 导出、每模型今日明细、无变化 tick 只显示一行
v2.1.0
- Updated version to 2.1.0.
- Documentation files (README.md, README.zh.md, SKILL.md) updated.
- No feature or breaking changes indicated.
v2.0.9
fix: Hermes 当前会话改读 sessions.json 精确匹配
v2.0.8
fix: --setup/-b conflict; compare dynamic alignment; watch shows tick activity + time-range summary on stop
v2.0.7
fix: --setup conflict, compare alignment, watch separators; new: command reference in README and --help
v2.0.6
单行格式 + 时间段 + 对比 + 导出 + Ctrl+C修复
v2.0.5
setup 检测旧 alias 冲突;卸载说明增加 alias 清理步骤
v2.0.4
修复 token-stats.py 内版本号不同步;README 新增完整环境依赖说明
v2.0.3
README 新增完整环境依赖说明(Python/Node.js/ClawHub)和 FAQ
v2.0.2
setup 改为 shell 包装器,不依赖脚本 +x 权限;README 统一加 python3 前缀
v2.0.1
修复 OpenClaw 数据结构适配(dict 非 list)
v2.0.0
**Major update: Now features interactive agent selection and simplified monitoring.**
- Every run now prompts you with a menu to select which AI agent's usage to view—no more fixed backend.
- Simplified usage: zero dependencies, runs with standard Python, now supports Python 3.8+.
- Easily monitor Hermes, Claude Code, CodeX, or OpenClaw token usage, switching between them at will.
- Added real-time monitoring with the `--watch` option.
- Usage and install instructions revised in README for clarity.
v1.4.0
v1.4.0: universal install to ~/.local/, multi-agent friendly
v1.3.2
v1.3.2: bump SKILL.md version so token-stats.py (with --version) is actually included
v1.3.1
fix --version, improve watch output readability, default interval 5s
v1.3.0
v1.3.0: add --version arg, verify/update/uninstall docs in README
v1.2.1
docs: add update instructions for ClawHub and direct download
v1.2.0
feat: add --watch live monitor + VS Code tasks + beginner-friendly README
元数据
常见问题
Agent Usage Stats 是什么?
选择要监控的 AI 助手 → 查看 token 消耗。支持 Hermes / Claude Code / CodeX / OpenClaw,每次都让你选. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 100 次。
如何安装 Agent Usage Stats?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install agent-usage-stats」即可一键安装,无需额外配置。
Agent Usage Stats 是免费的吗?
是的,Agent Usage Stats 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
Agent Usage Stats 支持哪些平台?
Agent Usage Stats 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Agent Usage Stats?
由 zhouhaoyong(@zhouhaoyong)开发并维护,当前版本 v2.1.3。
推荐 Skills