frugal
Cloud cost awareness for coding agents.
English | 简体中文
Agents deploy to Vercel, spin up Neon databases, run E2B sandboxes, push
commits that trigger GitHub Actions — all metered — and non-technical users
only find out on the monthly bill. frugal makes the agent spend consciously:
surface free-tier numbers and fail-open vs hard-pause on first touch, optional
usage digs, one-line notice before lasting paid resources, and tear down of
what it left running. It never blocks the command.
Works across Claude Code, Codex, GitHub Copilot, Qoder, Gemini CLI, OpenCode,
pi, Cursor, Windsurf, Cline, and Kiro — one ruleset, one source of truth.
Why a plugin, not “just tell the model to be careful”?
LLMs ship with frozen training-cut knowledge of free tiers, defaults, and
“how this cloud bills.” Cloud pricing and fail-open traps move every quarter
(Workflows per-step billing, Spend Management notify-only, free-tier cliffs).
The model still “remembers” last year’s story.
frugal keeps the numbers and tripwires in the repo — versioned, researched,
testable — and injects them into the agent loop on each session / pre-CLI hit.
Update the package (or pull the repo) and the loop gets current billing,
not whatever the weights last memorized.
How it saves you money
Two layers, both context-cheap (~1.7 KB of rules per session + at most 5
full reminders per day — after that, new services still get a numbers-only
line — never blocking), with intensity levels like a volume knob:
| Level | Session + inject | When to use |
|---|
| quiet | Free-tier / key quota numbers only | Hate noise but still want numbers |
| normal (default) | Numbers + one trap; dig optional | Most people |
| strict | + real-bill context; confirm scary actions | Non-technical / vibe-coding |
- Session rules (SessionStart): one short line on first touch, announce
lasting paid resources, kill ephemeral things, escalate only for scary spend.
- Just-in-time data (PreToolUse):
vercel → short Vercel line,
wrangler r2 → R2, git push with workflows → Actions — once per provider
per session. Horror-dollar amounts stay in strict (and the skill), not
every deploy.
This is scoped to normal usage that quietly runs up a bill — wrong
tier, a forgotten resource, a loop that hits a paid meter, a config default
nobody checked. Not credential leaks or fraud; that's a security problem,
not a billing-awareness one. Real incidents from the 272-story X corpus
this plugin internalizes — and the tripwire that now fires first:
| Real bill | What happened | frugal tripwire |
|---|
| $36,000/mo | Cloudflare queue re-enqueue loop (3.13B KV writes) | wrangler → "NO hard cap anywhere on CF — guard recursion" |
| $104,000 | Netlify viral-traffic bill (pre-reform) | netlify → credits system + hard-pause explained |
| $46,000 | viral traffic hit Vercel; Spend Management only emailed | vercel → Spend Management notifies at $200 — enable auto-pause |
| $25,672 | GCP spend blew past a $10 budget (alerts lag 24-48h) | rule: alerts are not brakes — pair with quota caps |
| ~$700/mo | agent push loop running full CI on macOS runners | git push with workflows → timeout-minutes + concurrency + macOS≈10x |
| $5,000/mo | Firestore useEffect read loop at 100 users | firebase → per-READ billing + maxInstances + recursion check |
| $1,200 | Claude CLI silently billing API instead of subscription | claude with ANTHROPIC_API_KEY set → dual-rail warning |
What it does
1. Session rules — injected at session start (mode-scaled).
2. In-the-moment reminders — PreToolUse watches shell commands. Mode
picks how loud each hit is — once per provider per session, never blocking: