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:
CODEBLOCK0
Last 7 days:
CODEBLOCK1
Since a specific date:
CODEBLOCK2
JSON output:
CODEBLOCK3
Top skills by cost:
CODEBLOCK4
Detail for a specific skill:
CODEBLOCK5
Compare two skills:
CODEBLOCK6
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 INLINECODE4
- Parses assistant messages for tool calls and token usage
- Attributes token usage to skills by matching bash command paths and tool names
- 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)
技能名称: skill-cost
详细描述:
技能成本 — 使用 Bash 工具
你必须使用 bash 或 shell 工具来运行这些命令。其他方法均无效。
命令
按技能统计成本报告:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report
最近7天:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report --days 7
自指定日期起:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report --since 2026-03-01
JSON 格式输出:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh report --format json
按成本排名技能:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh ranking
查看特定技能详情:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh detail poe-connector
比较两个技能:
bash
bash ~/.openclaw/workspace/skills/skill-cost/skill-cost.sh compare poe-connector web-search
禁止事项
- - 不要使用 sessions_spawn — 会失败
- 不要使用浏览器 — 会失败
- 不要使用除 bash 工具以外的任何方法 — 只有 bash 有效
工作原理
- 1. 扫描 ~/.openclaw/agents/*/sessions/ 路径下的 OpenClaw 会话 JSONL 文件
- 解析助手消息中的工具调用和令牌使用情况
- 通过匹配 bash 命令路径和工具名称,将令牌使用归因到对应技能
- 按技能汇总并报告成本,包含模型和每日细分
备注
- - 无需 API 密钥 — 直接从本地会话文件读取
- 无需外部 Python 依赖(仅使用标准库)
- 技能归因使用 bash 命令路径和 SKILL.md 工具映射
- 多技能消息中的令牌按比例分配到各个技能
- 无法归因到任何技能的使用量被归类为(内置)或(对话)