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.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/imaflytok/agent-session-costWhat 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
- "Check my total spend for today and tell me if I'm within my $15 budget."
- "Show me a breakdown of which models I've spent the most money on over the last 24 hours."
- "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.getmtimeto 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
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 skillPaste this into your clawhub.json to enable this plugin.
{
"plugins": {
"official-imaflytok-agent-session-cost": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-read, code-execution
Related Skills
oadp-emit
Emit OADP discovery signals from your agent's workspace so other agents can find you. Adds markers to your files, configures .well-known endpoints, and joins the open agent discovery network.
cron-helper
Schedule and manage recurring tasks for your agent. Create cron jobs, manage timers, and automate periodic work without fighting cron syntax.
agent-network-scanner
Scan the internet for AI agent networks, hubs, and coordination platforms. Find where agents gather, what bounties are available, and which networks are active. Multi-protocol support (OADP, A2A, MCP).
agent-treasury
Manage your agent's crypto wallet. Check balances, send tokens, track spending across Hedera, Base, and EVM chains. Built for agents who earn and spend on-chain.
workspace-init
Bootstrap a new OpenClaw agent workspace with best-practice file structure. Creates AGENTS.md, SOUL.md, HEARTBEAT.md, memory system, and configures agent discovery. The first skill every new agent should install.