据 AlphaMoat 统计,截至 2026-09,OpenClaw Cost Guard (Budgets + Token-Saving Playbook) 累计下载 4,480 次、获 4 个星标,在全部 5,078 个 AI 技能中排名第 2,156 位,在「数据分析」分类(399 个)中排名第 174 位。
| 平台 | 累计安装 | 累计下载 | 星标 | 评论 |
|---|---|---|---|---|
| SkillHub ↗ | 671 | 4,480 | 4 | — |
各平台的计数口径不同,统计时间不一致。
读会话 JSONL 日志里的调用记录,优先采用日志自带的真实费用,生成每日、每周与累计报表以及最贵会话排行。缺少费用字段时可用单价做回退估算,也能按预算阈值跑检查,超支时打印告警并以非零状态退出。只做统计与提醒,未经要求不改配置。 写入前核对目标文件、仓库或工作区;本地保存内容可能长期保留,不要包含不必要的敏感信息。
资料发布于 2026-10-27
以下是根据技能文档生成的示例,不代表实际运行结果。
2026-09 起统计方法调整:同名技能按作者分别统计,并覆盖全部技能。图中虚线为调整前的月份,与之后的数据不直接比较,也不计算跨越调整的增长。
| 月份 | 累计下载 | 环比 | 星标 |
|---|---|---|---|
| 2026-09 | 4,480 | — | 4 |
| 2026-08 | 3,994 | +2.0% | 4 |
| 2026-07 | 3,917 | +3.9% | 4 |
| 2026-06 | 3,771 | +2.5% | 4 |
| 2026-05 | 3,678 | — | 4 |
| 2026-03 | 3,279 | — | 4 |
以下是作者发布的原始文件,按纯文本显示,本站未做修改或审核;其中的链接不可点击,命令请核实后再运行。抓取于 2026-10-23。
--- name: openclaw-cost-guard description: 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. --- # OpenClaw Cost Guard Use this skill when you need: - **accurate cost reports** (daily/weekly/lifetime) - **top expensive sessions**
- **guardrails to reduce token burn** (without changing config unless user asks)
## 1) Data source (important)
Prefer **session JSONL** logs (they contain per-call `usage`, often with **real USD cost**):
- OpenClaw: `~/.openclaw/agents/*/sessions/*.jsonl`
- Legacy/compat: `~/.clawdbot/agents/*/sessions/*.jsonl`
Do **not** estimate from “current context window” style token fields.
## 2) Quick commands
### Daily costs (last 7 days)
```bash
python3 {baseDir}/scripts/extract_cost.py --last-days 7
```
### Today / yesterday
```bash
python3 {baseDir}/scripts/extract_cost.py --today
python3 {baseDir}/scripts/extract_cost.py --yesterday
```
### Top expensive sessions
```bash
python3 {baseDir}/scripts/extract_cost.py --top-sessions 10
```
### JSON output (for dashboards)
```bash
python3 {baseDir}/scripts/extract_cost.py --last-days 30 --json
```
## 3) If cost is missing (fallback estimate)
Some providers may omit `usage.cost`. You can provide per-1M-token prices:
```bash
export PRICE_INPUT=1.75
export PRICE_OUTPUT=14
export PRICE_CACHE_READ=0.175
export PRICE_CACHE_WRITE=0
python3 {baseDir}/scripts/extract_cost.py --last-days 7
```
## 4) Budget alerts
The extractor can run as a **budget check**:
```bash
python3 {baseDir}/scripts/extract_cost.py --today --budget-usd 5
```
- If budget is exceeded, it prints an **ALERT** and exits with code **2** (default).
- For non-failing checks:
```bash
python3 {baseDir}/scripts/extract_cost.py --today --budget-usd 5 --budget-mode warn
```
### Wiring it to a cron alert (recommended)
Run it daily (or hourly) and if exit code is 2, send yourself a Telegram message.
(Implementation depends on your OpenClaw channel setup; do not embed secrets in scripts.)
## 5) Token-saving playbook (teach the AI)
When the user says “use as few tokens as possible”, apply:
- **Default response budget:** 1–6 lines, bullets > paragraphs
- **Ask 1 question max** (only if truly blocking)
- **Progressive disclosure:** offer details only if asked
- **Tool calls:** batch; avoid repeated `status`/browser calls
- **No log dumps** into chat; summarize + point to file path
- **Hard limits:** max 3 web iterations (search/fetch) per task
Optional phrasing to keep yourself in check:
> "Answer in <=6 lines. If more is needed, ask permission."AdMapix 的取数层:把广告与应用相关的查询转成接口调用,只回原始 JSON。
走 Tavily 检索公开网页,返回带链接与摘要的结构化结果。
把数据库、表格与导出的原始数据变成可决策结论的数据分析技能。
用 Yahoo Finance 数据做股票与加密货币分析、组合跟踪的技能。
管理本地自选股清单,并按代码汇总同花顺行情与近期表现的技能。
全网招中标数据查询与分析助手。当用户涉及以下任何场景时,必须使用此SKILL:查询招标/中标公告、搜索标讯、查找临期/即将到期项目、商机预测、推荐潜在投标供应商、分析公司主营业务/历史中标、查询公司上下游合作客户与供应商、分析竞争对手/竞对企业、查询Top采购单位/Top中标单位/Top中标品牌、招中标数据统计分析(按月/季/年/省份/品牌等维度)、查询品牌型号历史中标单价/价格趋势、市场分析/行业分析/采购寻源/渠道拓展等采购与投标相关场景。即使用户没有提到「知了标讯」,只要涉及招投标、采购、中标、供应商、竞争对手等关键词,都应使用本SKILL。
用命令行监控博客与 RSS/Atom 源的更新。
汇总 Codex 或 Claude 按模型计费的使用成本。
数据月份:2026-09 · 下载/星标/安装数聚合自公开技能注册库(ClawHub、SkillHub),按月更新。口径说明见数据方法。