loop-budget

loop-budget is a skill for Claude Code, Codex from tzz123-hub/DevWhale. It costs 33 tokens per session (398 once invoked), scanned A, original, MIT.

A skill that checks token usage and run logs before and after each automated work cycle. Tokens are the units used to measure an AI model’s input and output.

In plain words
What is it for?
Use it to enforce budgets, record each cycle’s cost and outcome, and exit early when further automated work is unnecessary.
Why use it?
It stops or limits work when spending approaches a daily budget, when a pause switch is set, or when there is nothing actionable to do.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/tzz123-hub/devwhale/loop-budget
Any agent
npx skills add tzz123-hub/DevWhale --skill loop-budget
Clone the repo
git clone --depth 1 https://github.com/tzz123-hub/DevWhale

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for loop-budget

README.md
[![agentmods](https://agentmods.dev/badge/skills/tzz123-hub/devwhale/loop-budget.svg)](https://agentmods.dev/skills/tzz123-hub/devwhale/loop-budget)
Your own site
<a href="https://agentmods.dev/skills/tzz123-hub/devwhale/loop-budget"><img src="https://agentmods.dev/badge/skills/tzz123-hub/devwhale/loop-budget.svg" alt="Measured on agentmods" height="20"></a>
Per session 33 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 398 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00033 $0.00398
Opus 5 $0.00016 $0.00199
Sonnet 5 $0.00007 $0.00080
Haiku 4.5 $0.00003 $0.00040

Measured 5d ago against content hash 9afa1314c99f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loop-budget scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.codewhale/skills/loop-budget/SKILL.md · 41 lines

What it actually says

Loop Budget Guard(循环预算守卫)

每次循环迭代的开始结束时运行。

运行开始

  1. 读取 loop-budget.md 获取每日上限和 kill-switch 标志。
  2. 读取 loop-run-log.md 最近 24 小时的条目。
  3. 汇总当日该模式的 tokens_estimate
  4. 如果花费 ≥ 模式每日上限的 80% → 仅报告模式(禁止子代理、禁止自动修复)。
  5. 如果花费 ≥ 100% 或 loop-pause-all 已设置 → 立即退出,在 STATE.md 中写一行说明。
  6. 如果观察列表/状态中无可操作项 → 在 <5k token 内退出(不创建子代理)。

运行结束

loop-run-log.md 追加一条 JSON 对象:

{
  "run_id": "<ISO8601>",
  "pattern": "<pattern-id>",
  "duration_s": <number>,
  "items_found": <number>,
  "actions_taken": <number>,
  "escalations": <number>,
  "tokens_estimate": <number>,
  "outcome": "no-op | report-only | fix-proposed | escalated"
}

规则

  • 绝不超出 loop-budget.mdmax sub-agent spawns/run 的限制。
  • 高频模式(CI Sweeper、PR Babysitter)必须在无待办时提前退出。
  • 自我节流时,在 loop-budget.mdAlerts This Period 下追加一行。
Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 41 lines · 33 tokens per session scan A 9afa1314c99f

Subscribe to this mod's changes

loop-budget is a skill published in the GitHub repository tzz123-hub/DevWhale (10 stars, last pushed 2mo ago), licensed MIT. It adds 33 tokens to every session and 398 once invoked, about $0.0002 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

deepseek-harness-eac-dev

面向 Deepseek Harness EAC 源码仓库的全栈开发与维护技能。处理 Tauri/Rust 桌面壳、Node sidecar、Web bridge、DSH 插件与 preset、profile 治理、更新打包、可靠性修复、测试验收和发布准备时使用;不用于客户端功能使用说明,也不负责专项 JS 到 TS 迁移。.

zouyuxuan122/DSH-Desktop-EAC · 94 tokens

eac-desktop-tips

Deepseek Harness EAC 桌面客户端功能速查 —— 退出后台运行、对话回退、插件市场、桌面宠物、Skills 与 MCP 管理等特性的使用方法与排障入口。当用户询问本客户端某个功能怎么用、去哪找设置或某个内置行为不符预期时使用。.

zouyuxuan122/DSH-Desktop-EAC · 80 tokens

ensemblr

How Ensemblr works from inside it — the workspace/git-worktree model, the ensemblr control tools and what their answers mean, the committed .ensemblr/settings.toml (setup and run scripts, [git], [prompts], [infisical], environment variables), /.config/ensemblr/config.json, the Changes panel and diff comments, the…

ensemblr-hq/ensemblr · 130 tokens

lino-veusz-sci-plot

用 Veusz 自动化画全部类型科学图(折线/散点/柱状/箱线/直方图/等高线/热图/矢量场/极坐标/三元图/3D/多面板),脚本批量出 PNG/PDF.

LINoone516/lino-agent-skills · 71 tokens

lino-local-vision

调用本机 LM Studio 的 Qwen3.5-9B 视觉模型本地看图/OCR,纯本地免费无需 API key(lms server start 启动,localhost:1234 OpenAI 兼容接口).

LINoone516/lino-agent-skills · 57 tokens

hronaut

Use the Hronaut desktop Browser MCP for visible, persistent web workflows in isolated agent workspaces. Use for authenticated browser QA with human handoff, localhost or responsive testing, accessibility and performance diagnosis, or tasks that should survive one agent session while the user watches or takes over.

hronaut/hronaut · 59 tokens