Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Lemnos Cost Guard

BSecurity

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.

14 stars
0 votes
0 copies
1 views
Added 9/7/2026
businesspythonbashrailsapi

Works with

api

Security Analysis

B88/100
criticalAccesses sensitive system or user directories

Pro scans all 6 files and shows the line behind each finding

Scanned 9/7/2026

$npx -y skills add modbender/skill-library-mcp --skill lemnos-cost-guard --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Lemnos Cost Guard?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Lemnos Cost Guard
[![Security: B — Skills Directory](https://www.skillsdirectory.com/api/skills/modbender-lemnos-cost-guard/badge)](https://www.skillsdirectory.com/skills/modbender-lemnos-cost-guard)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: lemnos-cost-guard
description: "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."
---

# 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. Quick rules:
- Simple tasks (format, classify, status check) → Haiku ($0.80/M input)
- Default → Sonnet ($3/M input)  
- Opus → never, unless explicitly requested

## Cost Log Format

Each entry in `logs/cost-YYYY-MM-DD.jsonl`:
```json
{
  "ts": "2026-02-24T18:00:00Z",
  "task": "email batch send",
  "model": "claude-sonnet-4-6",
  "input_tokens": 45000,
  "output_tokens": 1200,
  "ratio": 37.5,
  "cost_usd": 0.153,
  "notes": "batch 1 + batch 2"
}
```

## ClawHub Distribution

Free tier: daily cost tracking + budget alerts
Premium ($40-60/mo): full dashboards, model routing automation, context optimization reports, weekly/monthly rollups

Skill file: `lemnos-cost-guard.skill`

Attribution

modbendermodbender
View sourceSee grades on GitHubMore from modbender →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Solution Architect

Designs system architecture, component specifications, and technical integration strategy. Use when: designing solutions, system architecture, technology stack, or integration approaches.

192 votes

Akorchak:Venture Assessment

Generate a comprehensive VC investment assessment report for a company

72 votes

Telegram Compose

Compose rich, readable Telegram messages using HTML formatting via direct Telegram API. Use when: (1) Sending any Telegram message beyond a simple one-line reply, (2) Creating structured messages with sections, lists, or status updates, (3) Need formatting unavailable via Clawdbot's Markdown conversion (underline, spoilers, expandable blockquotes, user mentions by ID), (4) Sending alerts, reports, summaries, or notifications to Telegram, (5) Want professional, scannable message formatting wit...

6511 votes

Just Fucking Cancel

Find and cancel unwanted subscriptions by analyzing bank transactions. Detects recurring charges, calculates annual waste, and helps you cancel with direct URLs and browser automation. Use when: 'cancel subscriptions', 'audit subscriptions', 'find recurring charges', 'what am I paying for', 'save money', 'subscription cleanup', 'stop wasting money'. Supports CSV import (Apple Card, Chase, Amex, Citi, Bank of America, Capital One, Mint, Copilot) OR Plaid API for automatic transaction pull. Out...

6511 votes

Stock Analysis

Analyze stocks and cryptocurrencies using Yahoo Finance data. Supports portfolio management (create, add, remove assets), crypto analysis (Top 20 by market cap), and periodic performance reports (daily/weekly/monthly/quarterly/yearly). 8 analysis dimensions for stocks, 3 for crypto. Use for stock analysis, portfolio tracking, earnings reactions, or crypto monitoring.

6511 votes
View all in business →