cost-governor
Pre-flight cost estimation for subagent spawns and approval gates. Prevents API overspend and surprise billing. Budget control for sessions_spawn calls. Daily spend tracking. Essential for multi-agent OpenClaw deployments.
Why use this skill?
Stop surprise AI bills with the OpenClaw cost-governor. Get pre-flight cost estimates, budget tracking, and mandatory approval gates for all your subagent tasks.
Install via CLI (Recommended)
clawhub install openclaw/skills/skills/donovanpankratz-del/openclaw-cost-governorWhat This Skill Does
The cost-governor skill is a critical safeguard for OpenClaw agents operating in environments where API costs can quickly escalate. It acts as an intelligent budget intermediary between your agent and the AI models, providing a pre-flight cost estimation layer that triggers an approval gate for any subagent task projected to exceed $0.50. By leveraging a structured cost model, the tool applies task-specific multipliers—such as 7.5x for creative writing and 3x for research—to raw token estimates, ensuring that historical context informs every projection. It maintains an automated, transparent ledger of all expenditure in a dedicated Markdown file, allowing for daily and monthly budget reconciliation and preventing 'surprise' bills.
Installation
To integrate cost-governor, run the installation command provided in the skill registry. After installation, you must initialize the local tracking infrastructure. First, create the storage directory and tracking file by executing mkdir -p ~/.openclaw/workspace/notes && touch ~/.openclaw/workspace/notes/cost-tracking.md. Next, populate the file with the standard header containing columns for Date, Task, Model, Estimate, Actual, and Ratio. Finally, define your operational risk tolerance by appending DAILY_BUDGET=20.00 (or your preferred limit) to the .env file located in ~/.openclaw/workspace/.
Use Cases
This skill is indispensable for long-running agent workflows involving complex research, recursive subagent spawning, or generative content creation. Use it to enforce fiscal discipline during exploratory AI sessions. It is particularly effective for 'multi-agent orchestration' where one master agent might attempt to spawn multiple subagents concurrently; without this governor, such branching logic could trigger significant API consumption across expensive models like Claude Opus or GPT-4.
Example Prompts
- "Perform a deep-dive market analysis on sustainable energy startups. (Note: Please run the cost-governor check before spawning the research subagent)."
- "I need to draft a series of creative blog posts about AI ethics. Estimate the budget for this using the creative task multiplier before starting."
- "Summarize my total expenditure for today and let me know how much room I have left in my $20 daily budget."
Tips & Limitations
Always review the cost-tracking.md file periodically to recalibrate your multipliers; if your agent consistently underestimates, adjust the multipliers in the configuration to better match your actual usage patterns. Note that this skill provides an estimate, not a real-time API billing read; it cannot stop an API call once the request has been dispatched to the provider. Ensure your system clocks are synchronized to maintain accurate logs in the tracking file.
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-donovanpankratz-del-openclaw-cost-governor": {
"enabled": true,
"auto_update": true
}
}
}Tags(AI)
Flags: file-write, file-read
Related Skills
skill-vetter
Security vetting protocol before installing any AI agent skill. Red flag detection for credential theft, obfuscated code, exfiltration. Risk classification LOW/MEDIUM/HIGH/EXTREME. Produces structured vetting reports. Never install untrusted skills without running this first.
Agent Stability Framework
Skill by donovanpankratz-del
subagent-architecture
Advanced patterns for specialized subagent orchestration with production-ready reference implementations. Security isolation, phased implementation, peer collaboration, and cost-aware spawning.
Intent Engineering
Skill by donovanpankratz-del
correction-memory
Makes agent corrections persistent and reusable. When you override, reject, or correct an agent's output, this skill logs the correction and automatically injects it into future spawns of the same agent type. Solves "agent keeps making the same mistake across sessions." Installs correction-tracker lib + injection hook into agent-context-loader. Works standalone or alongside intent-engineering skill.