← Back to Skills Marketplace
showmethemoney2023

claw-token-cost-analyzer

by ShowMeTheMoney2023 · GitHub ↗ · v1.0.2 · MIT-0
cross-platform ✓ Security Clean
228
Downloads
1
Stars
0
Active Installs
3
Versions
Install in OpenClaw
/install claw-token-cost-analyzer
Description
Analyzes Claw AI workflows to estimate token usage, cost, detect runaway loops, and suggest optimizations to prevent unexpected API expenses.
README (SKILL.md)

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)

Usage Guidance
This skill is instruction-only and coherent with its stated purpose — it asks you to paste workflows/prompts and returns an analysis. It does not request credentials or install anything. Before relying on its output, test with known examples and compare its estimates to your actual billing data (estimations can be imprecise). Additionally, because it is just an instruction template (no code), ensure the agent runtime you use executes the analysis as you expect and does not add any external calls; review results before taking automated remediation steps. The license is MIT-0 (no attribution).
Capability Analysis
Type: OpenClaw Skill Name: claw-token-cost-analyzer Version: 1.0.2 The skill bundle contains only documentation and instructions (SKILL.md) for an AI agent to perform token cost analysis and risk assessment. There is no executable code, no network activity, and no evidence of malicious intent or prompt injection. The content is entirely consistent with its stated purpose of helping users estimate and optimize AI agent costs.
Capability Assessment
Purpose & Capability
Name and description match the content of SKILL.md: it analyzes Claw workflows for token usage, runaway loops, and suggests optimizations. No unrelated capabilities, binaries, or credentials are requested.
Instruction Scope
SKILL.md limits itself to asking the user to paste a workflow/prompt and describing checks and expected output format. It does not instruct the agent to read files, access environment variables, call external endpoints, or perform system-level actions.
Install Mechanism
No install spec and no code files — instruction-only. This is the lowest-risk install posture and nothing is written to disk or downloaded.
Credentials
No environment variables, credentials, or config paths are required. The SKILL.md does not reference any secrets or external service keys.
Persistence & Privilege
always is false and the skill is user-invocable. It does not request persistent system presence or modifications to other skills/configuration.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install claw-token-cost-analyzer
  3. After installation, invoke the skill by name or use /claw-token-cost-analyzer
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.2
Claw Token Cost Analyzer 1.0.2 Improve prompt structure Add example input and output template
v1.0.1
Fix formatting issue
v1.0.0
Initial release of Claw Token Cost Analyzer skill. - Detects runaway token loops and estimates AI agent cost in Claw workflows. - Analyzes workflows or prompts for token usage, cost per run, loop risk, and provides optimization suggestions. - Checks for common risk patterns like infinite loops, tool retries, recursive calls, large context growth, and expensive models. - Delivers a clear risk summary and actionable recommendations to help prevent unexpected API costs before deployment. - Example use cases and outputs included for quick onboarding.
Metadata
Slug claw-token-cost-analyzer
Version 1.0.2
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 3
Frequently Asked Questions

What is claw-token-cost-analyzer?

Analyzes Claw AI workflows to estimate token usage, cost, detect runaway loops, and suggest optimizations to prevent unexpected API expenses. It is an AI Agent Skill for Claude Code / OpenClaw, with 228 downloads so far.

How do I install claw-token-cost-analyzer?

Run "/install claw-token-cost-analyzer" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is claw-token-cost-analyzer free?

Yes, claw-token-cost-analyzer is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does claw-token-cost-analyzer support?

claw-token-cost-analyzer is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created claw-token-cost-analyzer?

It is built and maintained by ShowMeTheMoney2023 (@showmethemoney2023); the current version is v1.0.2.

💬 Comments