Rechercher

PythonReactSEOPDF
OpenClaw

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.

donovanpankratz-del0 installations selon la source☆ 0 Étoiles du dépôtv1.0.0

Installation

Suivez les instructions du dépôt pour votre agent. Consultez les fichiers et dépendances avant l’installation.

SkillHub CLI

skillhub install donovanpankratz-del/openclaw-cost-governor

Examinez la source et la compatibilité, puis suivez les étapes d’installation.

Donnez le lien à votre agent et demandez-lui d’examiner instructions et dépendances avant d’expliquer les étapes.

Voir la source ↗Guides

Instructions

Cost Governor - Subagent Cost Control

Pre-flight cost checks before spawning subagents. Tracks spend. Gates expensive operations. Prevents surprise $300+ bills.

Files Included

  • SKILL.md — This file (agent instructions)
  • README.md — Human-readable setup guide
  • cost-tracking-template.md — Copy this to notes/cost-tracking.md to get started
  • lib/cost-tracker.js — Core estimation and logging library
  • bin/cost-summary.js — CLI: daily/monthly spend summary

Problem Solved

You spawn a subagent for "research passive income ideas" on Opus. 30 minutes later: $12 gone. This skill estimates cost before execution, requires approval for expensive tasks (>$0.50), and tracks all spend.

When to Use

  • Before spawning any subagent — estimate cost, log it
  • Daily spend review — summarize costs vs budget
  • Post-task reconciliation — compare estimated vs actual

Core Rules

  1. Every subagent spawn >$0.50 estimated requires explicit user approval
  2. All spawns get logged to $WORKSPACE/notes/cost-tracking.md
  3. Estimates use multipliers from historical data (see Cost Model)
  4. No silent expensive operations — always surface cost before execution

Cost Model

Based on historical data from cost-tracking.md:

Task Type Base Estimate Multiplier Effective Estimate
Creative (open-ended) Token estimate 7.5x Apply to all creative tasks
Research (bounded) Token estimate 3x Web search + synthesis
Technical (structured) Token estimate 2x Code, config, structured output
Simple (template) Token estimate 1.5x Fill-in, short responses

Model cost rates (approximate per 1K tokens):

  • Claude Opus: ~$0.075 input / $0.375 output
  • Claude Sonnet: ~$0.003 input / $0.015 output
  • GPT-4: ~$0.03 input / $0.06 output
  • Grok 4.1 Fast Reasoning: ~$0.003 input / $0.015 output
  • Claude Haiku 4.5: ~$0.0008 inp...

Informations sur la source

Source
github
Repository
openclaw/skills
Path
skills/donovanpankratz-del/openclaw-cost-governor
Version
1.0.0
Commit
8c1264b3c28d91b6ab0ff1df77d088c3864ead49
Source de classification
rules
Statut
active
Visibilité
public

Ces informations proviennent de l’analyse indexée et peuvent être anciennes. Vérifiez les fichiers actuels.

README

Cost Governor - Installation & Setup

Pre-flight cost control for OpenClaw subagent spawns. Prevents surprise API bills.

Quick Install

# Via ClawHub (when published)
clawhub install cost-governor

# Or manual install
cd ~/.openclaw/workspace/skills
# Download from ClawHub or extract package

First-Time Setup

  1. Create tracking file:
mkdir -p ~/.openclaw/workspace/notes
cat > ~/.openclaw/workspace/notes/cost-tracking.md << 'EOF'
# Cost Tracking Log

## Multipliers
- Creative: 7.5x
- Research: 3x
- Technical: 2x
- Simple: 1.5x

| Date | Task | Model | Est. | Actual | Ratio | Notes |
|------|------|-------|------|--------|-------|-------|
EOF
  1. Set daily budget (optional):
echo "DAILY_BUDGET=20.00" >> ~/.openclaw/workspace/.env
  1. Test it: Ask your agent: "Estimate cost for researching passive income on Opus"

Usage

The skill activates automatically when:

  • You ask to spawn a subagent
  • You request a cost estimate
  • Daily cron runs (if configured)
Manual Cost Check
You: "How much would it cost to spawn a research agent on Opus?"
Agent: [reads SKILL.md, estimates using multipliers]
Agent: "Research task on Opus, ~3K tokens: $3.50 estimated (3x multiplier)"
Pre-Flight Gate
You: "Research the best passive income methods"
Agent: "Estimated cost: $3.50 (Opus, research, 3x multiplier). Approve?"
You: "Yes"
Agent: [spawns, logs to cost-tracking.md]

Configuration

Adjust Multipliers

Edit ~/.openclaw/workspace/notes/cost-tracking.md:

## Multipliers
- Creative: 10x    # Your creative tasks run long
- Research: 2.5x   # You scope research tightly

Agent reads this file on each cost check.

Set Budget Alert

Add to workspace .env:

DAILY_BUDGET=50.00
WEEKLY_BUDGET=300.00

Agent will warn when approaching limits.

Integration with Cron (Optional)

Daily spend summary at 6 PM:

openclaw cron add \
  --name "Daily Cost Report" \
  --sch...

Contenu extrait

SKILL.md
# Cost Governor - Subagent Cost Control

Pre-flight cost checks before spawning subagents. Tracks spend. Gates expensive operations. **Prevents surprise $300+ bills.**

## Files Included

- `SKILL.md` — This file (agent instructions)
- `README.md` — Human-readable setup guide  
- `cost-tracking-template.md` — Copy this to `notes/cost-tracking.md` to get started
- `lib/cost-tracker.js` — Core estimation and logging library
- `bin/cost-summary.js` — CLI: daily/monthly spend summary

## Problem Solved

You spawn a subagent for "research passive income ideas" on Opus. 30 minutes later: $12 gone. This skill estimates cost **before** execution, requires approval for expensive tasks (>$0.50), and tracks all spend.

## When to Use

- **Before spawning any subagent** — estimate cost, log it
- **Daily spend review** — summarize costs vs budget
- **Post-task reconciliation** — compare estimated vs actual

## Core Rules

1. **Every subagent spawn >$0.50 estimated requires explicit user approval**
2. **All spawns get logged** to `$WORKSPACE/notes/cost-tracking.md`
3. **Estimates use multipliers** from historical data (see Cost Model)
4. **No silent expensive operations** — always surface cost before execution

## Cost Model

Based on historical data from `cost-tracking.md`:

| Task Type | Base Estimate | Multiplier | Effective Estimate |
|-----------|--------------|------------|-------------------|
| Creative (open-ended) | Token estimate | **7.5x** | Apply to all creative tasks |
| Research (bounded) | Token estimate | **3x** | Web search + synthesis |
| Technical (structured) | Token estimate | **2x** | Code, config, structured output |
| Simple (template) | Token estimate | **1.5x** | Fill-in, short responses |

**Model cost rates (approximate per 1K tokens):**
- Claude Opus: ~$0.075 input / $0.375 output
- Claude Sonnet: ~$0.003 input / $0.015 output
- GPT-4: ~$0.03 input / $0.06 output
- Grok 4.1 Fast Reasoning: ~$0.003 input / $0.015 output
- Claude Haiku 4.5: ~$0.0008 inp...
README
# Cost Governor - Installation & Setup

Pre-flight cost control for OpenClaw subagent spawns. Prevents surprise API bills.

## Quick Install

```bash
# Via ClawHub (when published)
clawhub install cost-governor

# Or manual install
cd ~/.openclaw/workspace/skills
# Download from ClawHub or extract package
```

## First-Time Setup

1. **Create tracking file:**
```bash
mkdir -p ~/.openclaw/workspace/notes
cat > ~/.openclaw/workspace/notes/cost-tracking.md << 'EOF'
# Cost Tracking Log

## Multipliers
- Creative: 7.5x
- Research: 3x
- Technical: 2x
- Simple: 1.5x

| Date | Task | Model | Est. | Actual | Ratio | Notes |
|------|------|-------|------|--------|-------|-------|
EOF
```

2. **Set daily budget (optional):**
```bash
echo "DAILY_BUDGET=20.00" >> ~/.openclaw/workspace/.env
```

3. **Test it:**
Ask your agent: "Estimate cost for researching passive income on Opus"

## Usage

The skill activates automatically when:
- You ask to spawn a subagent
- You request a cost estimate
- Daily cron runs (if configured)

### Manual Cost Check

```
You: "How much would it cost to spawn a research agent on Opus?"
Agent: [reads SKILL.md, estimates using multipliers]
Agent: "Research task on Opus, ~3K tokens: $3.50 estimated (3x multiplier)"
```

### Pre-Flight Gate

```
You: "Research the best passive income methods"
Agent: "Estimated cost: $3.50 (Opus, research, 3x multiplier). Approve?"
You: "Yes"
Agent: [spawns, logs to cost-tracking.md]
```

## Configuration

### Adjust Multipliers

Edit `~/.openclaw/workspace/notes/cost-tracking.md`:

```markdown
## Multipliers
- Creative: 10x    # Your creative tasks run long
- Research: 2.5x   # You scope research tightly
```

Agent reads this file on each cost check.

### Set Budget Alert

Add to workspace `.env`:
```bash
DAILY_BUDGET=50.00
WEEKLY_BUDGET=300.00
```

Agent will warn when approaching limits.

## Integration with Cron (Optional)

Daily spend summary at 6 PM:

```bash
openclaw cron add \
  --name "Daily Cost Report" \
  --sch...

Skills associés

OpenClaw

xint

0xnyk

X Intelligence CLI — search, monitor, analyze, and engage on X/Twitter. TypeScript + Bun. AI agent skill.

OpenClaw

bambu-studio-ai

heyixuan2

Bambu Lab 3D printer control and automation. Activate when user mentions: printer status, 3D printing, slice, analyze model, generate 3D, AMS filament, print monitor, Bambu Lab, or any 3D printing task. Full pi...

OpenClaw

flightclaw

jackculpan

Track flight prices from Google Flights with this OpenClaw skill. Search routes, monitor prices, and get alerts when prices drop.

OpenClaw

openclaw-trading-assistant

openclaw-trade

openclaw trading assistant| openclaw trading skill | nof1.ai & openclaw [moltbot] collaboration | We get the best practices from alpha arena trading seasons and bring it to clawdbot All top AI agents, realtime...