loop-budget
Skill57 starsChanged 14 days agoMITView on GitHub
Check token budget and run-log spend before and after a loop run. Enforces early exit when over budget or when there is no actionable work.
3 other projects use a version of this, 3 of them edited.
Adopted by
Most recently taken up by
- ayeshakhalid13/LoopEngineering-CrashCourseedited, first seen Oct 15, 2026
- cobusgreyling/loop-engineeringedited, first seen Aug 13, 2026
- ayeshakhalid192007-dev/LoopEngineering-CrashCourseedited, first seen Jul 16, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 3
- cobusgreyling/loop-engineering★ 12k87% same
- ayeshakhalid13/LoopEngineering-CrashCourse★ 1684% same
- ayeshakhalid192007-dev/LoopEngineering-CrashCourse★ 1584% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- .github/copilot-instructions.mdCopilot instructions
- .cursor/rules/ibex-harness.mdcCursor rule
- loop-constraintsSkill
- loop-triageSkill
- loop-verifierSkill
The file
We split this skill into the rules it gives an agent
7 rules. 3 are common, 0 are distinctive, and 4 are very specific to this project.
3
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Common: line 9
Run at the start and end of every loop iteration.
- Very specific: line 13
Read loop-budget.md for daily caps and kill-switch flags.
- Very specific: line 14
Read recent entries in loop-run-log.md (last 24h).
- Common: line 16
If spend ≥ 80% of the pattern's daily cap → report-only mode (no sub-agents, no auto-fix).
- Very specific: line 17
If spend ≥ 100% or loop-pause-all is set → exit immediately with a one-line note in STATE.md.
- Common: line 18
If watchlist/state has no actionable items → exit in <5k tokens (do not spawn sub-agents).
- Very specific: line 39
Never exceed max sub-agent spawns/run from loop-budget.md.
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Loop Budget Guard
Run at the start and end of every loop iteration.
Start of run
- Read
loop-budget.mdfor daily caps and kill-switch flags. - Read recent entries in
loop-run-log.md(last 24h). - Sum
tokens_estimatefor the active pattern today. - If spend ≥ 80% of the pattern's daily cap → report-only mode (no sub-agents, no auto-fix).
- If spend ≥ 100% or
loop-pause-allis set → exit immediately with a one-line note in STATE.md. - If watchlist/state has no actionable items → exit in <5k tokens (do not spawn sub-agents).
End of run
Append one JSON object to loop-run-log.md:
{
"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"
}Rules
- Never exceed
max sub-agent spawns/runfromloop-budget.md. - High-cadence patterns (CI Sweeper, PR Babysitter) must early-exit when nothing is actionable.
- On self-throttle, append a line to
loop-budget.mdunder Alerts This Period.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

