npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yuanbopang/frugal

v0.4.0

Published

Cloud cost awareness plugin for coding agents (Claude Code, Codex, Copilot, Qoder, Gemini CLI, OpenCode, pi, Cursor, Windsurf, Cline, Kiro)

Downloads

87

Readme


Agent 部署 Vercel、开 Neon 数据库、跑 E2B 沙箱、一次 push 触发 GitHub Actions——全都按量计费,而不懂技术的用户往往月底看账单才傻眼。frugal 让 agent 花钱前先睁眼:查用量、一句话报备付费动作、用完拆干净。

支持 Claude Code、Codex、GitHub Copilot、Qoder、Gemini CLI、OpenCode、pi、Cursor、Windsurf、Cline、Kiro——一套规则,一个真相来源。

它如何帮你省钱

两层机制,上下文成本都很低(每会话约 1.5KB 规则 + 每天最多 5 条完整提醒,超出后新服务仍有一行纯数字提示,绝不挡路),并带吵闹度档位:

| 档位 | 注入内容 | 适用 | |---|---|---| | quiet | 只说计费形态 | 懂行、嫌吵 | | normal(默认) | 形态 + 一个 trap;查用量可选 | 大多数人 | | strict | + 真实账单金额;危险动作要确认 | 非技术 / vibe coding |

  • 会话规则(SessionStart):首次碰服务一句话说明计费形态、持久付费资源先报备、临时资源必须死、只在可怕消耗时升级提醒用户。
  • 按需数据(PreToolUse):vercel / wrangler r2 / 带 workflows 的 git push 等触发短提醒;事故金额只在 strict(以及 skill 全文)出现,普通 deploy 不吓人。

这个 skill 的范围是正常使用但没留意计费方式导致账单起飞——用错档位、忘了拆的资源、循环打到了付费额度、没人注意到的配置默认值。不处理密钥泄漏或欺诈,那是安全问题,不是成本意识问题。frugal 内化的 272 条 X 真实事故里几个代表案例,以及现在会先拦住它们的检测点:

| 真实账单 | 发生了什么 | frugal 的拦截 | |---|---|---| | $36,000/月 | Cloudflare 队列自循环(3.13B 次 KV 写入) | wrangler → "CF 全线无硬顶——警惕递归" | | $104,000 | Netlify 爆红流量账单(改革前) | netlify → 讲清 credit 制度与硬暂停 | | $46,000 | 爆红流量打到 Vercel,Spend Management 只发了邮件 | vercel → Spend Management 默认只通知——要开 auto-pause | | $25,672 | GCP 花费冲破 $10 预算(告警滞后 24-48h) | 规则:告警不是刹车——要配额硬顶配合 | | 约 $700/月 | agent push 循环在 macOS runner 上跑全量 CI | 带 workflows 的 git push → timeout-minutes + concurrency + macOS 约 10 倍价 | | $5,000/月 | 100 用户规模下 Firestore useEffect 读循环 | firebase → 按读计费 + maxInstances + 递归检查 | | $1,200 | Claude CLI 悄悄切到按 token 计费而非订阅 | 环境有 ANTHROPIC_API_KEY 时跑 claude → 双轨计费警告 |

它做什么

  • 会话规则(SessionStart,按档位裁剪):计费形态一句话;持久付费资源报备;临时资源当场杀;可怕消耗才打断用户。
  • 命令级即时提醒(PreToolUse):碰到计费 CLI 注入短提醒——每服务每会话一次,每天最多 5 条完整提醒(超出降为纯数字一行)。normal = 形态 + 一个 trap;quiet 只有数字;strict 才带 $ 故事。查用量命令 normal 起可选。
  • 档位/frugal quiet|normal|strict|off/frugal default <level>,或 FRUGAL_MODE / ~/.config/frugal/config.json
  • 真实数据:22 组服务配额表仍在 skill 里按需读;272 条 X 事故作研究底座,不再默认塞进每次 deploy。完整表格见 skills/frugal/references/

安装

npm 包:@yuanbopang/frugal

Claude Code

/plugin marketplace add yuanboP/frugal
/plugin install frugal

Codexcodex plugin marketplace add yuanboP/frugal && codex plugin add frugal@frugal

Copilot CLIcopilot plugin marketplace add yuanboP/frugal && copilot plugin install frugal@frugal

grokgrok plugin install https://github.com/yuanboP/frugal.git --trust

Gemini CLIgemini extensions install https://github.com/yuanboP/frugal

OpenCodeopencode.json 里加 { "plugin": ["@yuanbopang/frugal"] }

pipi install git:github.com/yuanboP/frugal

Cursor / Windsurf / Cline / Kiro:静态规则副本随仓库自动生效;Cursor 用户级安装:把 .cursor/rules/frugal.mdc 拷到 ~/.cursor/rules/

Qoder / CodeWhale / Swival:自动读仓库根的 AGENTS.md,零配置。

测试

npm test

MIT