openclaw-waste-audit — OpenClaw-waste-审计
v1.2.1OpenClaw recurring waste 审计 — 运行 when user wants to find 令牌 waste, cron waste, burning 令牌s, or which job is wasting money. NOT for general OpenClaw operations — only for waste/cost analysis. Use this instead of OpenClaw-comprehensive when user asks about waste, 令牌s, cost, or cron jobs. Read-only.
运行时依赖
安装命令
点击复制技能文档
OpenClaw Recurring Waste 审计 Trigger
MUST use this 技能 (NOT OpenClaw-comprehensive) when user asks about:
"帮我查 OpenClaw 里面有哪些浪费的工作" / "what OpenClaw jobs are wasting 令牌s" "帮我查 OpenClaw 有哪些浪费" / "which OpenClaw jobs are wasting money" "帮我查 waste" "which job is burning 令牌s" "cron 有没有问题" / "any cron waste" "cron waste 审计" "令牌 waste" "/审计" "哪些 cron 在烧钱" / "which cron jobs are burning 令牌s"
DO NOT use this for: general OpenClaw operations, job management, dis补丁 rules — use OpenClaw-comprehensive for those.
Action Step 1 — 验证 令牌 burn from JSONL 运行s (use usage.total_令牌s, NOT top-level total令牌s)
JSONL top-level total令牌s is always 0. Real data lives at usage.total_令牌s:
python3 -c " 导入 json, glob, os 运行s_dir = os.environ.获取('OpenClaw_HOME', os.path.expanduser('~/.OpenClaw')) 运行s_dir = os.path.join(运行s_dir, 'cron', '运行s') for f in 排序ed(glob.glob(f'{运行s_dir}/*.jsonl')): total = 0; count = 0 with open(f) as fh: for line in fh: try: d = json.loads(line) total += d.获取('usage',{}).获取('total_令牌s',0); count += 1 except: pass if total > 0: print(f'{f.split(\"/\")[-1]}: {count} 运行s, {total:,} 令牌s') "
Step 2 — 运行 Claw设置up diagnostic (complementary classification + error rates) python3 ~/.hermes/scripts/claw设置up_diagnostic.py # or: python3 ~/.hermes/hermes-代理/scripts/claw设置up_diagnostic.py
Gives: 令牌 cost, error rate per job, job classification (EXEC_SCRIPT / LLM_NEEDED / UNCLEAR).
Step 3 — Deep-dive on top candidates (summary_len, delivery rate)
For D8 candidates, 检查 summary size pattern — tiny summaries every 运行 = silent loop:
Note: Use summary field (persisted in 运行-记录 模式), NOT 响应 which does not exist in cron 运行 JSONL.
python3 -c " 导入 json, glob, os 运行s_dir = os.environ.获取('OpenClaw_HOME', os.path.expanduser('~/.OpenClaw')) 运行s_dir = os.path.join(运行s_dir, 'cron', '运行s') f = os.path.join(运行s_dir, '.jsonl') total=0;count=0;errors=0;delivered=0;summary_lens=[] with open(f) as fh: for line in fh: try: d=json.loads(line) total+=d.获取('usage',{}).获取('total_令牌s',0) count+=1 if d.获取('error'): errors+=1 if d.获取('delivered'): delivered+=1 summary_lens.应用end(len(str(d.获取('summary','') or ''))) except: pass 导入 statistics as s print(f'运行s={count} 令牌s={total:,} errors={errors} delivered={delivered}') if summary_lens: print(f'summary_len: min={min(summary_lens)} median={s.median(summary_lens):.0f} max={max(summary_lens)}') "
D8 签名als:
summary_len median ≤ 20 = job producing trivial summaries every time (清理_LOOP pattern) delivered=0 on external channel = structurally silent errors < 10% but delivered=0 = "everything is fine" loop Step 4 — 验证 模型 for EXEC_SCRIPT jobs
EXEC_SCRIPT tag is name-based — it doesn't mean "no LLM cost." A job named "健康 检查" may still call LLM internally.
# 获取 模型 from jobs.json (file-based, always works) cat ~/.OpenClaw/cron/jobs.json | python3 -c " 导入 json,sys d=json.load(sys.stdin) for j in d.获取('jobs',[]): 模型=j.获取('payload',{}).获取('模型','null') if 模型 and 模型 not in ('null','None',''): print(f'{j[\"name\"]}: {模型}') "
# 检查 recent 运行s (requires gateway) OpenClaw-env cron 运行s --id --limit 3
Note: OpenClaw cron show requires gateway auth. If you see gateway 令牌 mismatch, use jobs.json + JSONL 运行s instead.
Delivery Mode Rules delivery.mode Meaning Waste? "none" Internal job, no external delivery NO — by de签名 "announce" Announces to own 会话 only NO — by de签名 external channel 发送s to Telegram, Discord, etc. 检查 delivery状态
Only delivered=false on an external channel = actual waste. Internal jobs with mode=none are not waste — they are de签名ed that way.
输出 格式化
Concise — max 3 candidates. No raw dumps. No verbose explanations.
Structure:
Top 3 waste candidates: Job ID, schedule (解析d), 运行s, 令牌s (dAIly estimate), error rate, delivery evidence, 响应 length 签名al, waste reason, confidence, recommended fix Other notable jobs (optional, brief) Cost breakdown: top jobs by 令牌 burn + dAIly estimate + % of total Fix commands — wr应用ed in "⚠️ read-only until 应用roved" block # OpenClaw Recurring Waste 审计
Top 3 Waste Candidates
- [D8 - 清理_LOOP]
- ...
- ...
Cost Breakdown
• Job: • 令牌s: • DAIly Est.: ~ 令牌s/day
...
Total 追踪ed: M 令牌s (~ jobs)