A dedicated cost analysis and optimization utility for OpenClaw that identifies high token consumption and provides actionable strategies to reduce AI expenses.
The fastest way to install a skill directly from the registry.
npx clawhub@latest install oc-cost-analyzer
Copy the skill folder to one of these locations
~/.openclaw/skills/ <project>/skills/ Priority: Workspace > Local > Bundled
Copy this prompt to OpenClaw to install it automatically.
Help me install oc-cost-analyzer using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).
Get the raw skill files in a ZIP archive.
The OpenClaw Cost Optimizer is a technical utility designed to give developers full visibility into their AI agent's operational expenses. As a key component of the Openclaw Skills ecosystem, it parses local session logs to pinpoint exactly where tokens are being spent, whether through oversized contexts, long-running conversations, or frequent automation triggers. By analyzing usage patterns across different LLM providers, it offers a data-driven approach to maintaining high-performance agents without the burden of runaway costs.
This tool is built with a privacy-first approach, operating as a pure Node.js script with zero external dependencies. It processes all data locally on your machine, ensuring that sensitive session logs never leave your environment. It is particularly effective for power users who leverage complex workflows and need to balance model intelligence with economic sustainability.
To start using this skill within your Openclaw Skills workflow, navigate to the skill directory and use the Node.js runtime to execute the analyzer.
# Generate a full analysis report for the last 7 days
node scripts/cost_analyzer.js analyze
# Perform a quick check of today's costs
node scripts/cost_analyzer.js quick
# Analyze costs for the last 30 days
node scripts/cost_analyzer.js analyze 30
The optimizer interacts with specific file paths and produces structured reports as follows:
| Component | Path / Format | Description |
|---|---|---|
| Source Data | ~/.openclaw/agents/main/agent/sessions/*.jsonl |
Local session history files containing token counts. |
| Output Report | ~/.openclaw/workspace/memory/cost-analysis-report.md |
A detailed Markdown summary of costs and suggestions. |
| Pricing Config | scripts/cost_analyzer.js |
Internal object mapping model IDs to input/output rates per million tokens. |
| Reporting | Markdown Tables | Used within the generated report to categorize model usage and top 5 most expensive sessions. |
Loading
A professional-grade financial tracking skill for developers and creators to monitor revenue, expenses, and ROI across diverse platforms.

A specialized CLI tool that automates the discovery of bug bounty and open-source rewards across 50+ platforms.

A lightweight, dependency-free semantic search utility for indexing and querying local Openclaw memory files.

A lightweight watchdog daemon that monitors OpenClaw gateway health and performs automatic restarts to ensure continuous operation.

A technical cost analysis tool for OpenClaw that optimizes token consumption and LLM spending through detailed usage reports.

A beautiful terminal-based dashboard for real-time tracking of hardware resources, Openclaw gateways, and AI model quotas.








































