claw-token-cost-analyzer
/install claw-token-cost-analyzer
Claw Token Cost Analyzer
Detect runaway token loops and estimate AI agent cost in Claw workflows.
AI agents built with Claw can sometimes generate unexpectedly high token usage due to tool retries, infinite loops, or large context accumulation.
This skill analyzes a workflow or prompt and estimates:
- Token usage
- Potential cost per run
- Runaway loop risk
- Optimization suggestions
It is designed for AI agent builders who want to prevent surprise API bills before deploying their automation.
Example input
Agent researches competitor pricing and retries web search until confident.
How to use
Paste your Claw workflow, task description, or prompt.
Example:
Agent researches competitors and repeatedly calls a web search tool until pricing data is found.
What the analyzer checks
The analyzer looks for common patterns that lead to high token usage:
- Infinite loops
- Tool retry chains
- Recursive agent calls
- Large context growth
- Expensive model usage
Output format
Output must follow this format:
AI Agent Cost Analysis
Risk level: (Low / Medium / High)
Estimated tokens per run:
Estimated cost per run:
Issues detected:
Optimization suggestions:
Example Output
AI Agent Cost Analysis
Risk level: Medium
Estimated token usage: 5k – 20k tokens per run
Estimated cost: $0.10 – $0.60 per run
Potential issues detected:
- Possible tool retry loop
- Large context accumulation
Optimization suggestions:
- Limit tool retries
- Use smaller models for research tasks
- Add step limits to prevent runaway loops
Why this matters
AI agents can accidentally generate runaway token usage when tools retry repeatedly or workflows contain recursive steps.
Even a small mistake can multiply costs quickly.
Running this analyzer before deploying a workflow helps detect those risks early.
Tip
If you run AI agents in production, consider using a gateway that can enforce budget limits and block abnormal calls automatically.
Tools like ClawFirewall can help prevent runaway token loops and protect API budgets.
License
MIT-0 (No Attribution)
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install claw-token-cost-analyzer - 安装完成后,直接呼叫该 Skill 的名称或使用
/claw-token-cost-analyzer触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
claw-token-cost-analyzer 是什么?
Analyzes Claw AI workflows to estimate token usage, cost, detect runaway loops, and suggest optimizations to prevent unexpected API expenses. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 228 次。
如何安装 claw-token-cost-analyzer?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install claw-token-cost-analyzer」即可一键安装,无需额外配置。
claw-token-cost-analyzer 是免费的吗?
是的,claw-token-cost-analyzer 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。
claw-token-cost-analyzer 支持哪些平台?
claw-token-cost-analyzer 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 claw-token-cost-analyzer?
由 ShowMeTheMoney2023(@showmethemoney2023)开发并维护,当前版本 v1.0.2。