{
  "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": {
    "downloadMode": "redirect",
    "downloadUrl": "/downloads/openclaw-cost-guard",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-cost-guard",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "installMethod": "Manual import",
    "extraction": "Extract archive",
    "prerequisites": [
      "OpenClaw"
    ],
    "packageFormat": "ZIP package",
    "includedAssets": [
      "SKILL.md",
      "README.md",
      "scripts/extract_cost.py"
    ],
    "primaryDoc": "SKILL.md",
    "quickSetup": [
      "Download the package from Yavira.",
      "Extract the archive and review SKILL.md first.",
      "Import or place the package into your OpenClaw setup."
    ],
    "agentAssist": {
      "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
      "steps": [
        "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."
      ],
      "prompts": [
        {
          "label": "New install",
          "body": "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."
        },
        {
          "label": "Upgrade existing",
          "body": "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."
        }
      ]
    },
    "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."
      ]
    },
    "downloadPageUrl": "https://openagent3.xyz/downloads/openclaw-cost-guard",
    "agentPageUrl": "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"
  },
  "agentAssist": {
    "summary": "Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.",
    "steps": [
      "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."
    ],
    "prompts": [
      {
        "label": "New install",
        "body": "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."
      },
      {
        "label": "Upgrade existing",
        "body": "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."
      }
    ]
  },
  "documentation": {
    "source": "clawhub",
    "primaryDoc": "SKILL.md",
    "sections": [
      {
        "title": "OpenClaw Cost Guard",
        "body": "Use this skill when you need:\n\naccurate cost reports (daily/weekly/lifetime)\ntop expensive sessions\nguardrails to reduce token burn (without changing config unless user asks)"
      },
      {
        "title": "1) Data source (important)",
        "body": "Prefer session JSONL logs (they contain per-call usage, often with real USD cost):\n\nOpenClaw: ~/.openclaw/agents/*/sessions/*.jsonl\nLegacy/compat: ~/.clawdbot/agents/*/sessions/*.jsonl\n\nDo not estimate from “current context window” style token fields."
      },
      {
        "title": "Daily costs (last 7 days)",
        "body": "python3 {baseDir}/scripts/extract_cost.py --last-days 7"
      },
      {
        "title": "Today / yesterday",
        "body": "python3 {baseDir}/scripts/extract_cost.py --today\npython3 {baseDir}/scripts/extract_cost.py --yesterday"
      },
      {
        "title": "Top expensive sessions",
        "body": "python3 {baseDir}/scripts/extract_cost.py --top-sessions 10"
      },
      {
        "title": "JSON output (for dashboards)",
        "body": "python3 {baseDir}/scripts/extract_cost.py --last-days 30 --json"
      },
      {
        "title": "3) If cost is missing (fallback estimate)",
        "body": "Some providers may omit usage.cost. You can provide per-1M-token prices:\n\nexport PRICE_INPUT=1.75\nexport PRICE_OUTPUT=14\nexport PRICE_CACHE_READ=0.175\nexport PRICE_CACHE_WRITE=0\npython3 {baseDir}/scripts/extract_cost.py --last-days 7"
      },
      {
        "title": "4) Budget alerts",
        "body": "The extractor can run as a budget check:\n\npython3 {baseDir}/scripts/extract_cost.py --today --budget-usd 5\n\nIf budget is exceeded, it prints an ALERT and exits with code 2 (default).\nFor non-failing checks:\n\npython3 {baseDir}/scripts/extract_cost.py --today --budget-usd 5 --budget-mode warn"
      },
      {
        "title": "Wiring it to a cron alert (recommended)",
        "body": "Run it daily (or hourly) and if exit code is 2, send yourself a Telegram message.\n(Implementation depends on your OpenClaw channel setup; do not embed secrets in scripts.)"
      },
      {
        "title": "5) Token-saving playbook (teach the AI)",
        "body": "When the user says “use as few tokens as possible”, apply:\n\nDefault response budget: 1–6 lines, bullets > paragraphs\nAsk 1 question max (only if truly blocking)\nProgressive disclosure: offer details only if asked\nTool calls: batch; avoid repeated status/browser calls\nNo log dumps into chat; summarize + point to file path\nHard limits: max 3 web iterations (search/fetch) per task\n\nOptional phrasing to keep yourself in check:\n\n\"Answer in <=6 lines. If more is needed, ask permission.\""
      }
    ],
    "body": "OpenClaw Cost Guard\n\nUse this skill when you need:\n\naccurate cost reports (daily/weekly/lifetime)\ntop expensive sessions\nguardrails to reduce token burn (without changing config unless user asks)\n1) Data source (important)\n\nPrefer session JSONL logs (they contain per-call usage, often with real USD cost):\n\nOpenClaw: ~/.openclaw/agents/*/sessions/*.jsonl\nLegacy/compat: ~/.clawdbot/agents/*/sessions/*.jsonl\n\nDo not estimate from “current context window” style token fields.\n\n2) Quick commands\nDaily costs (last 7 days)\npython3 {baseDir}/scripts/extract_cost.py --last-days 7\n\nToday / yesterday\npython3 {baseDir}/scripts/extract_cost.py --today\npython3 {baseDir}/scripts/extract_cost.py --yesterday\n\nTop expensive sessions\npython3 {baseDir}/scripts/extract_cost.py --top-sessions 10\n\nJSON output (for dashboards)\npython3 {baseDir}/scripts/extract_cost.py --last-days 30 --json\n\n3) If cost is missing (fallback estimate)\n\nSome providers may omit usage.cost. You can provide per-1M-token prices:\n\nexport PRICE_INPUT=1.75\nexport PRICE_OUTPUT=14\nexport PRICE_CACHE_READ=0.175\nexport PRICE_CACHE_WRITE=0\npython3 {baseDir}/scripts/extract_cost.py --last-days 7\n\n4) Budget alerts\n\nThe extractor can run as a budget check:\n\npython3 {baseDir}/scripts/extract_cost.py --today --budget-usd 5\n\nIf budget is exceeded, it prints an ALERT and exits with code 2 (default).\nFor non-failing checks:\npython3 {baseDir}/scripts/extract_cost.py --today --budget-usd 5 --budget-mode warn\n\nWiring it to a cron alert (recommended)\n\nRun 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.)\n\n5) Token-saving playbook (teach the AI)\n\nWhen the user says “use as few tokens as possible”, apply:\n\nDefault response budget: 1–6 lines, bullets > paragraphs\nAsk 1 question max (only if truly blocking)\nProgressive disclosure: offer details only if asked\nTool calls: batch; avoid repeated status/browser calls\nNo log dumps into chat; summarize + point to file path\nHard limits: max 3 web iterations (search/fetch) per task\n\nOptional phrasing to keep yourself in check:\n\n\"Answer in <=6 lines. If more is needed, ask permission.\""
  },
  "trust": {
    "sourceLabel": "tencent",
    "provenanceUrl": "https://clawhub.ai/DasWeltall/openclaw-cost-guard",
    "publisherUrl": "https://clawhub.ai/DasWeltall/openclaw-cost-guard",
    "owner": "DasWeltall",
    "version": "0.1.0",
    "license": null,
    "verificationStatus": "Indexed source record"
  },
  "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"
  }
}