O

OpenClaw Cost Guard (Budgets + Token-Saving Playbook)

Data Analysisv0.1.0
By dasweltallUpdated 2026-10-01openclaw-cost-guard@clawhub_dasweltall/openclaw-cost-guard
Report GenerationData InsightsMetrics Monitoring

According to AlphaMoat, as of 2026-09, OpenClaw Cost Guard (Budgets + Token-Saving Playbook) has 4,480 downloads and 4 stars — ranked #2,156 of 5,078 AI skills overall, and #174 of 399 in Data Analysis.

Installs
671
Downloads
4.5K
Stars
4
Overall Rank
#2,156
Top 43% overall · Top 44% in Data Analysis
PlatformInstallsDownloadsStarsComments
SkillHub ↗6714.5K4—

Platforms count differently and update at different times.

What this skill does

It reads the call records in session JSONL logs, prefers the real cost those logs carry, and reports daily, weekly and lifetime totals plus the most expensive sessions. When the cost field is missing you can supply per-million-token prices for a fallback estimate, and a budget threshold can be checked, printing an alert and exiting non-zero on a breach. It only measures and warns, and leaves config alone unless asked. Confirm the target file, repository or workspace before writing; locally stored content may persist and should not include unnecessary sensitive data.

Profile published 2026-10-27

What you can do with it

  • See last week's spend and the costliest sessions
  • Put a budget alert line on daily spend

When to use it

  • When token burn needs to be controlled
  • When spend should become a daily report

Example prompts

Generated from the skill’s documentation as examples; not results of actual runs.

Total the last seven days and show the three costliest sessions
Alert me when today's spend passes the budget

Monthly Trend

Downloads4.5K
3.2K3.9K4.6K2026-03 · Downloads 3.3K2026-05 · Downloads 3.7K2026-06 · Downloads 3.8K2026-07 · Downloads 3.9K2026-08 · Downloads 4.0K2026-09 · Downloads 4.5K26-0326-09
Stars4
3452026-03 · Stars 42026-05 · Stars 42026-06 · Stars 42026-07 · Stars 42026-08 · Stars 42026-09 · Stars 426-0326-09

The counting method changed in 2026-09: skills with the same name are now counted separately by author, and the full catalog is covered. Dashed lines show months before the change; they are not compared with later months, and no growth is computed across the change.

MonthDownloadsMoMStars
2026-094.5K—4
2026-084.0K+2.0%4
2026-073.9K+3.9%4
2026-063.8K+2.5%4
2026-053.7K—4
2026-033.3K—4

SKILL.md (original)

The author’s original file, shown as plain text without edits or review by AlphaMoat. Links are not clickable; check commands before running them. Fetched 2026-10-23.

2.8 KB · SkillHub v0.1.0
---
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**
Show all (86 lines)
- **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."

Popular in Data Analysis

AdMapixData Analysis

The data layer for AdMapix: turn ad and app queries into API calls that return raw JSON only.

↓ 365.6K★ 304fly0pants
Tavily SearchData Analysis

Searches the public web through Tavily and returns structured results with links and snippets.

↓ 121.9K★ 286Xiaoran Li
Data AnalysisData Analysis

A data-analysis skill that turns databases, spreadsheets, and raw exports into decision-ready conclusions.

↓ 101.2K★ 244Iván
Stock AnalysisData Analysis

A skill that analyzes stocks and cryptocurrencies on Yahoo Finance data and tracks a portfolio.

↓ 75.3K★ 299udiedrichsen
Stock WatcherData Analysis

Manages a local stock watchlist and summarizes recent quotes for its codes from the Tonghuashun stock pages.

↓ 64.8K★ 122Robin797860
全国招标中标查询及分析【知了标讯】Data Analysis

全网招中标数据查询与分析助手。当用户涉及以下任何场景时,必须使用此SKILL:查询招标/中标公告、搜索标讯、查找临期/即将到期项目、商机预测、推荐潜在投标供应商、分析公司主营业务/历史中标、查询公司上下游合作客户与供应商、分析竞争对手/竞对企业、查询Top采购单位/Top中标单位/Top中标品牌、招中标数据统计分析(按月/季/年/省份/品牌等维度)、查询品牌型号历史中标单价/价格趋势、市场分析/行业分析/采购寻源/渠道拓展等采购与投标相关场景。即使用户没有提到「知了标讯」,只要涉及招投标、采购、中标、供应商、竞争对手等关键词,都应使用本SKILL。

↓ 56.5K★ 13user_98035bfb
BlogwatcherData Analysis

Track blog and RSS/Atom feed updates from the command line.

↓ 54.0K★ 75Peter Steinberger
Model UsageData Analysis

Summarises per-model usage cost for Codex or Claude.

↓ 49.5K★ 114Peter Steinberger

Data month: 2026-09 · Downloads, stars and installs are aggregated monthly from public skill registries (ClawHub, SkillHub). See methodology.