agentleFS
selamy-labsselamy-labs/agent-skills/skills/adaptive-loop-budgeting/SKILL.md

adaptive-loop-budgeting

Skill0 starsChanged 4 days agoMITView on GitHub

Use when an autonomous loop needs explicit limits on attempts, time, cost, tool calls, verification depth, or risk, and a clear stop, continue, yield, or escalate decision.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 7 are distinctive, and 0 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈7

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 0

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Use this when a loop could keep consuming time, tokens, money, tool calls, or risk without a natural stopping point.

    line 8
  2. Distinctive:

    Before starting or continuing the loop, name:

    line 18
  3. Distinctive:

    If the task already has an explicit user budget, honor it.

    line 29
  4. Distinctive:

    Run the cheapest check that can reduce the current uncertainty:

    line 35
  5. Distinctive:

    Do not jump to expensive verification because it feels thorough.

    line 46
  6. Distinctive:

    no cheaper check can answer the question.

    line 83
  7. Distinctive:

    Use [[process-aware-done]] for completion claims and [[verify-real-artifact]] when the result matters outside the local checkout.

    line 96

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Adaptive Loop Budgeting

Use this when a loop could keep consuming time, tokens, money, tool calls, or risk without a natural stopping point. The goal is to spend effort where it reduces uncertainty, stop when confidence is high enough, and escalate when the next iteration would be expensive or unsafe.

This skill applies to coding loops, research loops, product feedback loops, self-improving experiments, debugging sessions, and long-running verification.

Budget Contract

Before starting or continuing the loop, name:

  • Objective: what the loop is trying to improve, prove, or decide.
  • Budget: allowed attempts, time, cost, tool calls, external requests, or verification depth.
  • Confidence target: what evidence is enough for this risk level.
  • Risk tier: low, medium, or high based on reversibility, user impact, money, data sensitivity, and production exposure.
  • Escalation trigger: the condition that requires a human decision or a different plan.

If the task already has an explicit user budget, honor it. If no budget exists, choose the smallest budget that can produce useful evidence and state it before looping.

Cheap-To-Expensive Ladder

Run the cheapest check that can reduce the current uncertainty:

UncertaintyStart withEscalate to
Is the task understood?Restate goal and acceptance criteriaAsk for a decision
Is the code shape plausible?Static read, type check, unit testIntegration or browser check
Is the user path working?Local browser/API checkTarget-environment verification
Is feedback actionable?Cluster and confidence scoreExperiment, metric, or user research
Is a fix durable?Regression test or fixtureMonitor, alert, or policy gate
Is a claim real?Direct artifact checkIndependent system-of-record check

Do not jump to expensive verification because it feels thorough. Escalate when the cheaper layer cannot prove the claim or when the risk tier requires it.

Loop Decision

At each iteration boundary, choose one:

  • Continue: the latest evidence changed the hypothesis, the budget remains healthy, and the next step is likely to reduce uncertainty.
  • Stop succeeded: the confidence target is met with evidence at the right layer.
  • Stop partial: the loop produced useful work, but remaining uncertainty is explicit and bounded.
  • Yield: progress is waiting on slow external state; checkpoint and switch work using [[yield-on-wait]].
  • Escalate: the next step crosses budget, authority, risk, or decision boundaries.

Continuing requires a changed hypothesis. Repeating the same action because the last result was inconvenient is not iteration.

Adaptive Signals

Tighten or stop the loop when:

  • the same failure repeats after distinct hypotheses;
  • each iteration changes less than the one before;
  • verification cost is rising faster than confidence;
  • the diff, plan, or artifact is growing beyond the original objective;
  • tool output is noisy enough that more calls would not clarify it; or
  • the next action has irreversible or high-impact consequences.

Expand the budget only when:

  • the loop is still reducing a named uncertainty;
  • the remaining risk justifies the extra cost;
  • the next step has a clear expected signal;
  • no cheaper check can answer the question; and
  • the user or governing policy permits the expansion.

Confidence Targets

Match confidence to risk:

  • Low risk: relevant local check, clear reasoning, and no known conflicting signal may be enough.
  • Medium risk: automated checks plus direct artifact verification.
  • High risk: independent verification, source-of-record readback, rollback plan, and human decision before irreversible action.

Use [[process-aware-done]] for completion claims and [[verify-real-artifact]] when the result matters outside the local checkout.

Output Shape

Objective: <what the loop is optimizing or proving>
Budget: <attempts/time/cost/tool calls/risk limit>
Evidence so far: <strongest signal>
Decision: <continue, succeeded, partial, yield, or escalate>
Reason: <why this is the right boundary decision>
Next step: <only if continuing or escalating>

Anti-Patterns

  • Looping because no one chose a stopping condition.
  • Spending expensive checks on low-risk uncertainty.
  • Stopping because of fatigue while claiming confidence.
  • Expanding scope instead of escalating for a product decision.
  • Ignoring repeated failures because each one looks slightly different.
  • Reporting "done" when the budget ended but the evidence did not close the claim.

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.