← All skills
Tencent SkillHub Β· Productivity

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.

skill openclawclawhub Free
0 Downloads
0 Stars
0 Installs
0 Score
High Signal

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.

⬇ 0 downloads β˜… 0 stars Unverified but indexed

Install for OpenClaw

Quick setup
  1. Download the package from Yavira.
  2. Extract the archive and review SKILL.md first.
  3. Import or place the package into your OpenClaw setup.

Requirements

Target platform
OpenClaw
Install method
Manual import
Extraction
Extract archive
Prerequisites
OpenClaw
Primary doc
SKILL.md

Package facts

Download mode
Yavira redirect
Package format
ZIP package
Source platform
Tencent SkillHub
What's included
SKILL.md, README.md, scripts/extract_cost.py

Validation

  • Use the Yavira download entry.
  • Review SKILL.md after the package is downloaded.
  • Confirm the extracted package contains the expected setup assets.

Install with your agent

Agent handoff

Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.

  1. Download the package from Yavira.
  2. Extract it into a folder your agent can access.
  3. Paste one of the prompts below and point your agent at the extracted folder.
New install

I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Then review README.md for any prerequisites, environment setup, or post-install checks. Tell me what you changed and call out any manual steps you could not complete.

Upgrade existing

I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Then review README.md for any prerequisites, environment setup, or post-install checks. Summarize what changed and any follow-up checks I should run.

Trust & source

Release facts

Source
Tencent SkillHub
Verification
Indexed source record
Version
0.1.0

Documentation

ClawHub primary doc Primary doc: SKILL.md 10 sections Open source page

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.

Daily costs (last 7 days)

python3 {baseDir}/scripts/extract_cost.py --last-days 7

Today / yesterday

python3 {baseDir}/scripts/extract_cost.py --today python3 {baseDir}/scripts/extract_cost.py --yesterday

Top expensive sessions

python3 {baseDir}/scripts/extract_cost.py --top-sessions 10

JSON output (for dashboards)

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: 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: 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: 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."

Category context

Workflow acceleration for inboxes, docs, calendars, planning, and execution loops.

Source: Tencent SkillHub

Largest current source with strong distribution and engagement signals.

Package contents

Included in package
2 Docs1 Scripts
  • SKILL.md Primary doc
  • README.md Docs
  • scripts/extract_cost.py Scripts