ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified finance Safety 4/5

session-cost

Track and analyze your OpenClaw session costs. Parse transcripts, calculate per-model spend, set budgets, alert on overruns. Stop burning money blindly.

Why use this skill?

Track your OpenClaw token spend in real-time. Calculate per-model costs, set daily budgets, and get alerts to stop burning money on your AI agent sessions.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/imaflytok/agent-session-cost
Or

What This Skill Does

The session-cost skill provides OpenClaw agents with the ability to monitor, analyze, and report on token-based expenditure. By parsing session logs stored within the local filesystem, this skill transforms abstract token usage into concrete currency data. It allows users to track spending per session, calculate aggregated daily totals, perform model-specific breakdowns, and establish automated budget thresholds to prevent unexpected financial exposure. It is an essential tool for high-volume agents or users running multiple models who need to maintain strict cost discipline.

Installation

To integrate this skill into your OpenClaw environment, execute the following command in your terminal:

clawhub install openclaw/skills/skills/imaflytok/agent-session-cost

Ensure that your environment has sufficient read permissions for the ~/.openclaw/agents/ directory, as the skill needs to scan session files to generate accurate cost reports.

Use Cases

  • Budget Management: Preventing runaway costs by setting a strict daily dollar limit and receiving alerts if the threshold is approaching.
  • Model Optimization: Determining which AI models are the most cost-effective versus which ones are consuming the majority of your budget without providing proportional value.
  • Auditing: Reviewing past session performance to understand the cost-per-turn dynamics of specific tasks or prompt strategies.
  • Cost Projection: Using daily averages to estimate monthly spending on AI infrastructure.

Example Prompts

  1. "Check my total spend for today and tell me if I'm within my $15 budget."
  2. "Show me a breakdown of which models I've spent the most money on over the last 24 hours."
  3. "List the last five sessions I ran and calculate the total cost for each one individually."

Tips & Limitations

  • Precision: Costs are calculated based on data recorded in the session logs; ensure your agent is configured to log usage statistics to maintain accuracy.
  • System Resource: This skill utilizes local Python execution to process logs. While efficient, running it excessively on extremely large log files might lead to minor temporary latency.
  • Scope: The budget check relies on os.path.getmtime to estimate daily windows; ensure your system clock is correctly synchronized to avoid discrepancies.
  • Security: Since this skill performs file-read operations on your session history, review your local permissions to ensure only authorized processes can access the agent log directory.

Metadata

Author@imaflytok
Stars2287
Views0
Updated2026-03-09
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-imaflytok-agent-session-cost": {
      "enabled": true,
      "auto_update": true
    }
  }
}

Tags(AI)

#finance#monitoring#budgeting#analysis#ops
Safety Score: 4/5

Flags: file-read, code-execution