Search

PythonReactSEOPDF
OpenClaw

lemnos-cost-guard

Real-time API cost tracking, context bloat detection, and budget enforcement for OpenClaw agents. Use when setting up cost guardrails, checking daily spend, logging token usage after a task, analyzing context bloat, generating cost reports (daily/weekly/monthly), getting model routing recommendations, or when a user asks about API costs, budget status, or why costs are high.

getlemnos320 source installs☆ 0 Repository stars

Installation

Follow the repository instructions for this skill and your agent. Review the files and dependencies before adding it to your workflow.

SkillHub CLI

skillhub install getlemnos32/lemnos-cost-guard

Inspect the source and compatibility requirements, then follow its installation steps.

Give your agent the source link and ask it to inspect instructions and dependencies before explaining the installation steps.

View source ↗Guides

Skill instructions

Lemnos Cost Guard

Track token usage, enforce budgets, detect context bloat, and route to cheaper models.

Quick Reference

Script Purpose
scripts/track_cost.py Log a cost entry after a task
scripts/cost_report.py Generate cost summary
scripts/context_analyzer.py Scan workspace for bloat

Pricing and model routing rules: references/model_pricing.md

Workflow

After Every Significant Task

Log cost immediately using session delta (session_status before vs after):

python3 skills/lemnos-cost-guard/scripts/track_cost.py \
  --task "email batch" \
  --input 45000 \
  --output 1200 \
  --model claude-sonnet-4-6

Logs to: logs/cost-YYYY-MM-DD.jsonl

Daily Briefing — Cost Summary Block

Run before sending the morning briefing:

python3 skills/lemnos-cost-guard/scripts/cost_report.py --days 1 --budget 5.00 --format brief

Include output verbatim in briefing. Flag anything over 80% of budget.

Budget Alerts
  • ≥80% of $5/day → warn Nick, pause non-revenue tasks
  • ≥100% of $5/day → hard stop, notify Nick immediately
  • Single call >500K input tokens → immediate alert
  • I/O ratio >50:1 → context bloat warning, recommend compaction
Context Bloat Check (run weekly or when costs spike)
python3 skills/lemnos-cost-guard/scripts/context_analyzer.py \
  --workspace /root/.openclaw/workspace

Context Loading Rules (enforce on every session)

Load ONLY what the current task requires:

Task Load
Morning briefing SOUL.md, USER.md, MEMORY.md, HEARTBEAT.md, today's memory
Email outreach MEMORY.md (Lemnos rules only), sent-log.md
LinkedIn research sent-log.md only
Crypto/market MEMORY.md (crypto section only)
Heartbeat (nothing to do) HEARTBEAT.md only

Do NOT load full MEMORY.md + all skills + all reference files unless the task requires it.

Model Routing

See references/model_pricing.md for full table....

Source information

Source
github
Repository
openclaw/skills
Path
skills/getlemnos32/lemnos-cost-guard
Version
—
Commit
4547d4aac054bb6709cbfa336b8bfe9bcc779854
Classification source
rules
Status
active
Visibility
public

These signals come from indexed source analysis and may lag behind changes. Check the current source files.

Extracted content

SKILL.md
# Lemnos Cost Guard

Track token usage, enforce budgets, detect context bloat, and route to cheaper models.

## Quick Reference

| Script | Purpose |
|--------|---------|
| `scripts/track_cost.py` | Log a cost entry after a task |
| `scripts/cost_report.py` | Generate cost summary |
| `scripts/context_analyzer.py` | Scan workspace for bloat |

Pricing and model routing rules: `references/model_pricing.md`

## Workflow

### After Every Significant Task
Log cost immediately using session delta (session_status before vs after):

```bash
python3 skills/lemnos-cost-guard/scripts/track_cost.py \
  --task "email batch" \
  --input 45000 \
  --output 1200 \
  --model claude-sonnet-4-6
```

Logs to: `logs/cost-YYYY-MM-DD.jsonl`

### Daily Briefing — Cost Summary Block
Run before sending the morning briefing:

```bash
python3 skills/lemnos-cost-guard/scripts/cost_report.py --days 1 --budget 5.00 --format brief
```

Include output verbatim in briefing. Flag anything over 80% of budget.

### Budget Alerts
- **≥80% of $5/day** → warn Nick, pause non-revenue tasks
- **≥100% of $5/day** → hard stop, notify Nick immediately
- **Single call >500K input tokens** → immediate alert
- **I/O ratio >50:1** → context bloat warning, recommend compaction

### Context Bloat Check (run weekly or when costs spike)

```bash
python3 skills/lemnos-cost-guard/scripts/context_analyzer.py \
  --workspace /root/.openclaw/workspace
```

## Context Loading Rules (enforce on every session)

Load ONLY what the current task requires:

| Task | Load |
|------|------|
| Morning briefing | SOUL.md, USER.md, MEMORY.md, HEARTBEAT.md, today's memory |
| Email outreach | MEMORY.md (Lemnos rules only), sent-log.md |
| LinkedIn research | sent-log.md only |
| Crypto/market | MEMORY.md (crypto section only) |
| Heartbeat (nothing to do) | HEARTBEAT.md only |

Do NOT load full MEMORY.md + all skills + all reference files unless the task requires it.

## Model Routing

See `references/model_pricing.md` for full table....

Related skills

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...