qclaw-token-monitor

AI Token消耗监控优化工具。读取会话日志,统计Token消耗,检测异常模式(短时激增、重复失败等),提供优化建议,生成消耗趋势报告。 中文优先,面向QClaw/OpenClaw用户。 当用户说"Token消耗"、"费用多少"、"Token统计"、"超支"、"优化建议"时触发。 Keywords: Token, 消耗, 费用, 监控, 优化, 趋势, 统计, 异常检测.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "qclaw-token-monitor" with this command: npx skills add freedompixels/qclaw-token-monitor

Token消耗监控优化

监控 AI Token 消耗,检测异常,提供优化建议。

功能

  • 📊 读取 session 日志统计 Token 消耗
  • 🚨 检测异常消耗(短时激增、重复失败等)
  • 💡 给出优化建议
  • 📈 生成消耗趋势报告

使用

检查今日消耗

python3 ~/.qclaw/skills/token-monitor/scripts/token_stats.py --today

检查指定日期

python3 ~/.qclaw/skills/token-monitor/scripts/token_stats.py --date 2026-04-14

检查异常模式

python3 ~/.qclaw/skills/token-monitor/scripts/token_stats.py --check-anomaly

生成优化报告

python3 ~/.qclaw/skills/token-monitor/scripts/token_stats.py --report

异常检测规则

规则阈值说明
单日总量>1000万严重超标
单小时>200万需要检查
重复失败>3次死循环风险
浏览器快照单次>5000字未压缩

历史数据参考

日期InputOutputTotal状态
4/113.46M117K28.8M🚨 超标
4/125.57M127K37.0M🚨 严重超标
4/131.80M22K9.5M⚠️ 偏高
4/14430K20K3.7M✅ 正常

4/12是Token浪费最严重的一天:3700万token,根因是Chrome CDP崩溃重试+ClawHub限速重试

优化建议库

  • 浏览器快照用 compact=true
  • 同一操作失败3次立即换方案
  • 限速不硬等,跳转做其他事
  • 后台进程不轮询
  • Context超过150K时触发LCM压缩

数据存储

  • 日志:~/.qclaw/agents/main/sessions/*.jsonl
  • 统计:memory/token-usage-YYYY-MM-DD.json

依赖

  • Python 3(系统自带)
  • 无第三方依赖

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

OpenClaw Cost Guard (Budgets + Token-Saving Playbook)

Track OpenClaw/Clawdbot token and cost usage from session JSONL logs (prefer real usage.cost when present), generate daily/weekly summaries and top expensive sessions, and run budget checks (exit code on breach). Use to monitor spend, enforce budgets via cron/alerts, and apply a token-saving playbook to reduce output/tool-call cost.

Registry Source
2.8K4Profile unavailable
General

OpenClaw Token Monitor

OpenClaw Token 实时监控面板。支持:(1) SQLite 持久化存储历史数据 (2) 实时监控当前 Token 消耗(增量曲线) (3) 历史视图查看任意一天的消耗 (4) 按日/时会话汇总 (5) 人民币费用估算(MiniMax 官方定价) (6) 滚轮缩放 X 轴 (7) 图表采样防卡顿。触发场...

Registry SourceRecently Updated
1030Profile unavailable
General

Token省钱管家

OpenClaw Token省钱管家 - 智能缓存、动态路由、实时监控,运行时自动优化,降低70%成本消耗。当用户询问成本优化、Token节省、缓存策略、模型路由或需要成本监控时使用。

Registry SourceRecently Updated
1190Profile unavailable
Automation

OpenClaw 集中配置管理系统

为 OpenClaw 构建集中化配置管理系统,告别硬编码和配置分散,实现"改一处,生效全局"的现代化运维体验。包含配置加载器、主配置融合、记忆同步、AGENTS.md 模板、memoryFlush、memorySearch、多 Agent 配置、ClawRouter 成本优化等核心功能。

Registry SourceRecently Updated
3571Profile unavailable