# Send OpenClaw Cost Tracker 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. 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. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "openclaw-cost-tracker",
    "name": "OpenClaw Cost Tracker",
    "source": "tencent",
    "type": "skill",
    "category": "开发工具",
    "sourceUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
    "canonicalUrl": "https://clawhub.ai/pfrederiksen/openclaw-cost-tracker",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/openclaw-cost-tracker",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-cost-tracker",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "SKILL.md",
      "scripts/cost_tracker.py"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "openclaw-cost-tracker",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-05-06T11:07:26.947Z",
      "expiresAt": "2026-05-13T11:07:26.947Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-cost-tracker",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=openclaw-cost-tracker",
        "contentDisposition": "attachment; filename=\"openclaw-cost-tracker-1.1.3.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "openclaw-cost-tracker"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/openclaw-cost-tracker"
    },
    "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-tracker",
    "downloadUrl": "https://openagent3.xyz/downloads/openclaw-cost-tracker",
    "agentUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent",
    "manifestUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/openclaw-cost-tracker/agent.md"
  }
}
```
## Documentation

### OpenClaw Cost Tracker

Parse OpenClaw session files to compute per-model token usage, costs, and daily spend trends. Works with any OpenClaw installation — no API keys or external services needed.

### Usage

# All-time cost report
python3 scripts/cost_tracker.py

# Last 7 days
python3 scripts/cost_tracker.py --days 7

# Today only
python3 scripts/cost_tracker.py --days 1

# Since a specific date
python3 scripts/cost_tracker.py --since 2026-02-01

# JSON output for dashboards/integrations
python3 scripts/cost_tracker.py --days 30 --format json

# Custom agents directory
python3 scripts/cost_tracker.py --agents-dir /path/to/agents

### What It Reports

Per-model breakdown:

Total cost, tokens, and request count
Input/output/cache token split
Visual percentage bar

Daily spend: Bar chart of cost per day (text) or structured array (JSON).

Grand totals: Combined cost, tokens, and requests across all models.

### How It Works

Auto-discovers the OpenClaw agents directory (~/.openclaw/agents)
Scans all agent session JSONL files (filtered by mtime for speed)
Extracts message.usage and message.model from each entry
Aggregates by model and by day
Outputs formatted report or JSON

### JSON Output Schema

{
  "models": [
    {
      "model": "claude-opus-4-6",
      "totalTokens": 220800000,
      "inputTokens": 3200,
      "outputTokens": 390800,
      "cacheReadTokens": 149400000,
      "cacheWriteTokens": 1200000,
      "totalCost": 528.55,
      "requestCount": 2088
    }
  ],
  "daily": [
    { "date": "2026-02-20", "cost": 37.14, "byModel": { "opus-4-6": 35.0, "sonnet-4": 2.14 } }
  ],
  "grandTotal": { "totalCost": 580.11, "totalTokens": 269800000, "totalRequests": 3122 },
  "meta": { "agentsDir": "...", "filesScanned": 65, "entriesParsed": 3122, "range": "7d" }
}

### Integration

Feed JSON output into dashboards, alerting, or budgeting tools. The daily array is ready for charting. Set up a cron to track spend over time:

# Daily cost snapshot to file
0 0 * * * python3 /path/to/cost_tracker.py --days 1 --format json >> ~/cost-log.jsonl

### Requirements

Python 3.8+
OpenClaw installed with session data in ~/.openclaw/agents/
No external dependencies (stdlib only)
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: pfrederiksen
- Version: 1.0.0
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-05-06T11:07:26.947Z
- Expires at: 2026-05-13T11:07:26.947Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/openclaw-cost-tracker)
- [Send to Agent page](https://openagent3.xyz/skills/openclaw-cost-tracker/agent)
- [JSON manifest](https://openagent3.xyz/skills/openclaw-cost-tracker/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/openclaw-cost-tracker/agent.md)
- [Download page](https://openagent3.xyz/downloads/openclaw-cost-tracker)