← Back to Skills Marketplace
Token Tracker Pro
by
longziruo-max
· GitHub ↗
· v2.2.0
· MIT-0
172
Downloads
0
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install token-tracker-pro
Description
记录和追踪 OpenClaw 会话的 token 消耗,提供每日、每周和累计统计,并提出节省 token 的建议
Usage Guidance
要不要安装:如果你只是想本地统计 token,这个包在功能上匹配;但它会修改你的主目录配置(~/.bashrc、~/.config/autostart、Windows APPDATA 下的 AutoHotkey 脚本)并尝试把自己加入 PATH 和设置快捷键——这些改动没有在元数据里声明。建议在安装前:
- 手动审查 shortcut.ts、token-tracker-hook.ts 和 token-tracker-cli.ts(确认要写入/修改的路径和行为)。
- 备份你的 shell 配置(~/.bashrc、~/.zshrc)和任何被改动的目录。不要接受自动 shortcut 安装,改为手动配置快捷键。
- 如果可能,先在隔离环境或临时账号中运行并观察(例如 Docker 或临时用户),确认没有意外行为。
- 注意示例脚本里有硬编码路径(/home/seelong/...),运行前替换为你的路径或删除示例中对绝对路径的引用。
- 如果你不需要全局快捷键,避免运行 npm run token:shortcuts / npx 指令,或者在源码中注释掉 shortcut.ts 的自动写入部分。
如果你希望我,我可以:
- 列出 shortcut.ts 将写入的具体文件与修改行,或
- 帮你审查 token-tracker-hook.ts(如果提供其完整内容)以确认它如何读取会话上下文和估算 token。
Capability Analysis
Type: OpenClaw Skill
Name: token-tracker-pro
Version: 2.2.0
The skill bundle contains high-risk system modification logic in `shortcut.ts`, which appends to `~/.bashrc` and creates persistence entries in autostart directories across Linux (`~/.config/autostart`), macOS (`~/Library/Services`), and Windows (AutoHotkey). While documented as a 'shortcut' feature, these actions are invasive and non-standard for a token tracking utility. Additionally, `dashboard.ts` launches a local Express server on port 3000 that exposes token history data via an API, and `cli.js` utilizes `execSync` to run shell commands, increasing the potential attack surface.
Capability Assessment
Purpose & Capability
Skill 名称与主要代码(CLI、dashboard、hook、数据文件)一致:它记录会话 token、提供统计、在本地保存数据并提供可视化与推荐。可疑点:示例脚本与若干实现使用硬编码路径(/home/seelong/...)和向 PATH/.bashrc 写入的行为,超出了最小必要范围但与“全局 CLI / 快捷键”目标有一定合理性。
Instruction Scope
SKILL.md 与 INTEGRATION.md 建议通过在主程序中调用 hook 自动记录,且提到手动/交互式用法。实际代码(shortcut.ts)会自动写入 ~/.bashrc、创建 ~/.config/autostart/.desktop 文件、在 Windows 下写 AutoHotkey 脚本,并在 macOS 写 workflow 文件——这些文件/路径并未在元数据说明中列出,也没有明确要求用户确认。dashboard 在本地开服务(http://localhost:3000)并从本地 data 文件读取,未向外部服务器发送数据。总体上指令有“超出最小权限”的文件写入/系统配置更改。
Install Mechanism
Skill 为 instruction + 本地 Node.js/TypeScript 项目;没有声明自动下载任意可疑二进制或从外部私服提取代码。依赖通过 package.json(express、tsx 等),页面使用 Chart.js CDN(jsdelivr)。没有高风险的远程 extract/install 步骤在 install spec 中。
Credentials
元数据声明无需环境变量或凭据,但代码读取 process.env.HOME 和 process.env.APPDATA 并直接修改用户配置文件(~/.bashrc、~/.config/autostart、AutoHotkey 目录等)。虽然这些访问可以解释为实现全局快捷键与 CLI 的需要,但没有在 requires.env/required config paths 中声明,且修改用户 shell 配置和启动脚本属于高影响操作,应由用户显式批准并备份。
Persistence & Privilege
Skill 会创建持久化文件(data/token-history.json)并可安装自动启动/快捷键(.desktop、AutoHotkey 脚本、修改 .bashrc PATH),从而获得长期存在于用户环境中的能力。always:false(没有强制安装)减轻了风险,但写入用户启动配置与 PATH 修改是显著的持久性/权限更改,需谨慎。
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install token-tracker-pro - After installation, invoke the skill by name or use
/token-tracker-pro - Provide required inputs per the skill's parameter spec and get structured output
Version History
v2.2.0
- 新增“Pro”版,升级名称为 token-tracker-pro
- 更新文档结构,详细列出主要功能、使用方法、快捷键支持和数据存储说明
- 引入智能模型配置推荐与优化建议,增强节省 token 的指导
- 增加更多命令行和 npm script 操作(如导出、清理、重置等)
- 详细描述 Web 仪表板和技术栈信息
- 明确贡献及许可方式
v2.1.0
Added smart model recommender, token optimization, dashboard, improved UI/UX, better error handling
v2.0.0
新增全局命令、快捷别名、交互式菜单
Metadata
Frequently Asked Questions
What is Token Tracker Pro?
记录和追踪 OpenClaw 会话的 token 消耗,提供每日、每周和累计统计,并提出节省 token 的建议. It is an AI Agent Skill for Claude Code / OpenClaw, with 172 downloads so far.
How do I install Token Tracker Pro?
Run "/install token-tracker-pro" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Token Tracker Pro free?
Yes, Token Tracker Pro is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Token Tracker Pro support?
Token Tracker Pro is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Token Tracker Pro?
It is built and maintained by longziruo-max (@longziruo-max); the current version is v2.2.0.
More Skills