clawculator
Cost forensics for OpenClaw. Finds billing issues in your config, sessions, and workspace. Pure deterministic logic — no AI, no network calls, no external dependencies.
Source code is fully bundled in this skill folder. Nothing is fetched at runtime. You can audit every file before running.
Files this skill reads:
- -
~/.openclaw/openclaw.json — your OpenClaw config - INLINECODE1 — session token usage
- INLINECODE2 — workspace root file count only (no file contents read)
- INLINECODE3 — log directory (read only, if present)
Files this skill may write (only when --md is used):
- -
./clawculator-report.md — markdown report - Custom path via INLINECODE6
No network requests are made. No shell commands are spawned.
Session keys are truncated in all output (first 8 chars + ellipsis) to avoid exposing sensitive identifiers.
Usage
When the user types clawculator, check my costs, analyze spend, or cost report, run:
CODEBLOCK0
Return the full markdown report to the user inline.
When the user types snapshot, share my grade, cost grade, clawculator snapshot, or what's my grade, run:
CODEBLOCK1
Return the terminal card output to the user. This shows their grade (A+ to D), cost range, setup complexity, and findings — designed to be screenshot and shared.
Flags
- -
--snapshot — shareable grade card (terminal output, screenshot-ready) - INLINECODE17 — write markdown report and print to stdout
- INLINECODE18 — machine-readable JSON to stdout
- INLINECODE19 — custom output path for INLINECODE20
- INLINECODE21 — full usage
What it catches
- - 💓 Heartbeat running on paid model instead of Ollama
- 🔧 Skill polling loops on paid model
- 📱 WhatsApp groups auto-joined on primary model
- 🪝 Hooks (boot-md, command-logger, session-memory) on Sonnet
- 💬 Orphaned sessions still holding tokens
- 🤖 maxConcurrent too high — burst cost multiplier
- 📁 Workspace root bloat inflating context
- ⚙️ Primary model cost awareness
All findings include exact fix commands.
clawculator
OpenClaw 的成本审计工具。用于发现配置、会话和工作区中的计费问题。纯确定性逻辑——无 AI、无网络调用、无外部依赖。
源代码完全打包在此技能文件夹中。 运行时不会获取任何内容。你可以在运行前审计每个文件。
此技能读取的文件:
- - ~/.openclaw/openclaw.json — 你的 OpenClaw 配置
- ~/.openclaw/agents/main/sessions/sessions.json — 会话令牌使用量
- ~/clawd/ — 仅工作区根目录文件计数(不读取文件内容)
- /tmp/openclaw — 日志目录(仅读取,如果存在)
此技能可能写入的文件(仅当使用 --md 时):
- - ./clawculator-report.md — Markdown 报告
- 通过 --out=PATH 自定义路径
不发起任何网络请求。不生成任何 shell 命令。
所有输出中的会话密钥均被截断(前 8 个字符 + 省略号),以避免暴露敏感标识符。
用法
当用户输入 clawculator、check my costs、analyze spend 或 cost report 时,运行:
bash
node {baseDir}/run.js --md
将完整的 Markdown 报告以内联方式返回给用户。
当用户输入 snapshot、share my grade、cost grade、clawculator snapshot 或 whats my grade 时,运行:
bash
node {baseDir}/run.js --snapshot
将终端卡片输出返回给用户。该输出显示用户的等级(A+ 到 D)、成本范围、设置复杂度和发现结果——设计为可截图分享。
标志
- - --snapshot — 可分享的等级卡片(终端输出,适合截图)
- --md — 写入 Markdown 报告并输出到标准输出
- --json — 机器可读的 JSON 输出到标准输出
- --out=PATH — --md 的自定义输出路径
- node {baseDir}/run.js --help — 完整用法
它能发现的问题
- - 💓 心跳在付费模型上运行而非 Ollama
- 🔧 技能轮询循环在付费模型上运行
- 📱 WhatsApp 群组在主模型上自动加入
- 🪝 钩子(boot-md、command-logger、session-memory)在 Sonnet 上运行
- 💬 孤立会话仍持有令牌
- 🤖 maxConcurrent 过高——突发成本倍增
- 📁 工作区根目录膨胀导致上下文增大
- ⚙️ 主模型成本意识
所有发现结果均包含精确的修复命令。