TopRank Skills

Home / Claw Skills / Git / GitHub / skill-cost
Official OpenClaw rules 54%

skill-cost

Track per-skill token usage and costs from OpenClaw session logs. Use when user asks about skill-level spending, which skill costs the most, or wants a per-skill cost breakdown. IMPORTANT: This is a bash-tool skill. You MUST use the bash/shell tool to execute commands.

Stars

0

Installs

0

Status

ACTIVE

Visibility

PUBLIC

安装方式

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

请先检查是否已安装 SkillHub 商店,若未安装,请根据 https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/skillhub.md 安装 SkillHub 商店,然后安装 skill-cost 技能。 若已安装,则直接安装 skill-cost 技能。

Overview

Skill Key
dzwalker/skill-cost
Author
dzwalker
Source Repo
openclaw/skills
Version
0.1.0
Source Path
skills/dzwalker/skill-cost
Latest Commit SHA
5bcd0b97444eb0cea9245f4ebcd8c4b8b558d8a7

Extracted Content

SKILL.md excerpt

# Skill Cost — USE BASH TOOL

**You MUST use the `bash` or `shell` tool to run these commands. No other method works.**

## Commands

Per-skill cost report:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report
```

Last 7 days:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report --days 7
```

Since a specific date:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report --since 2026-03-01
```

JSON output:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report --format json
```

Top skills by cost:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh ranking
```

Detail for a specific skill:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh detail poe-connector
```

Compare two skills:
```bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh compare poe-connector web-search
```

## DO NOT

- Do NOT use `sessions_spawn` — it will fail
- Do NOT use browser — it will fail
- Do NOT use any approach other than `bash` tool — only bash works

## How It Works

1. Scans OpenClaw session JSONL files at `~/.openclaw/agents/*/sessions/`
2. Parses assistant messages for tool calls and token usage
3. Attributes token usage to skills by matching bash command paths and tool names
4. Aggregates and reports per-skill costs with model and daily breakdowns

## Notes

- No API keys required — reads directly from local session files
- No external Python dependencies (stdlib only)
- Skill attribution uses bash command paths and SKILL.md tool mappings
- Tokens for multi-skill messages are proportionally split across skills
- Usage not attributable to any skill is categorized as (built-in) or (conversation)

README excerpt

# skill-cost

**Which of my OpenClaw skills is burning the most money?**

I've been running OpenClaw with a growing collection of skills — chat connectors, code generators, grid monitors, you name it. The monthly bill kept climbing and I had no idea which skill was the culprit. The existing cost trackers on ClawHub (session-cost, openclaw-cost-tracker, tokenmeter) all break down spending by *model*, but none of them answer the question I actually care about:

> *"Is it my poe-connector or my web-search that's eating all my tokens?"*

So I built **skill-cost** — a dead-simple, zero-dependency tool that reads your local OpenClaw session logs and tells you exactly how much each skill is costing you.

## What It Does

```
────────────────────────────────────────────────────────────
Skill                      Calls     Tokens       Cost     %
────────────────────────────────────────────────────────────
(conversation)               420       6.2M     $14.20   45%
web-search                   180       2.8M      $5.60   18%
poe-connector                95       1.5M      $4.20   13%
github-tools                 72       1.1M      $3.30   10%
(built-in)                    48     780.0K      $2.10    7%
code-runner                  32     520.0K      $1.56    5%
file-utils                   18     290.0K      $0.87    3%
────────────────────────────────────────────────────────────
Total                        857      13.2M     $31.83  100%
```

Now I know: web-search and poe-connector are my money pits. Time to optimize (or at least stop blaming the small ones).

## Install

```bash
# If you're using ClawHub:
clawhub install dzwalker/skill-cost

# Or manually:
git clone https://github.com/dzwalker/skill-cost.git ~/.openclaw/workspace/skills/skill-cost
```

No pip install needed — pure Python stdlib, zero external dependencies.

## Usage

All commands go through the wrapper script:

```bash
# Full per-skill cost report
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost....

Related Claw Skills