# Send OpenClaw Cost Guard (Budgets + Token-Saving Playbook) to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
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

```text
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.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-cost-guard",
    "name": "OpenClaw Cost Guard (Budgets + Token-Saving Playbook)",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/DasWeltall/openclaw-cost-guard",
    "canonicalUrl": "https://clawhub.ai/DasWeltall/openclaw-cost-guard",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/openclaw-cost-guard",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-cost-guard",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "README.md",
      "scripts/extract_cost.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-23T16:43:11.935Z",
      "expiresAt": "2026-04-30T16:43:11.935Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=4claw-imageboard",
        "contentDisposition": "attachment; filename=\"4claw-imageboard-1.0.1.zip\"",
        "redirectLocation": null,
        "bodySnippet": null
      },
      "scope": "source",
      "summary": "Source download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this source.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-cost-guard"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/openclaw-cost-guard",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-cost-guard",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-cost-guard/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-cost-guard/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-cost-guard/agent.md"
  }
}
```
## Documentation

### 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."
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: DasWeltall
- Version: 0.1.0
## Source health
- Status: healthy
- Source download looks usable.
- Yavira can redirect you to the upstream package for this source.
- Health scope: source
- Reason: direct_download_ok
- Checked at: 2026-04-23T16:43:11.935Z
- Expires at: 2026-04-30T16:43:11.935Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/openclaw-cost-guard)
- [Send to Agent page](https://openagent3.xyz/skills/openclaw-cost-guard/agent)
- [JSON manifest](https://openagent3.xyz/skills/openclaw-cost-guard/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/openclaw-cost-guard/agent.md)
- [Download page](https://openagent3.xyz/downloads/openclaw-cost-guard)