Skip to content
Agentmart
Submit a tool

bounded-loops

Use before starting any loop that can retry, poll, iterate, or call an external API — agent loops, repair loops, schedulers, watchers.

Skill by Tcuzzo

IndexedMIT★ 2
Write a review

Chalk Labs

Need help deploying bounded-loops?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/tcuzzo-bounded-loops

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Use before starting any loop that can retry, poll, iterate, or call an external API — agent loops, repair loops, schedulers, watchers. Declares budget ceilings, checkpoints on exhaustion, and makes hammering structurally impossible. Trigger words: bounded loop, budget, ceiling, retry, backoff, rate limit, throttle, kill-switch, checkpoint, runaway, infinite loop, spin, budget exhaustion.

Use cases: backend, finance, agent-building

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/bounded-loops

What's inside

Skill name
bounded-loops
Description
Use before starting any loop that can retry, poll, iterate, or call an external API — agent loops, repair loops, schedulers, watchers. Declares budget ceilings, checkpoints on exhaustion, and makes hammering structurally impossible. Trigger words: bounded loop, budget, ceiling, retry, backoff, rate limit, throttle, kill-switch, checkpoint, runaway, infinite loop, spin, budget exhaustion.
License
MIT
Instructions
59 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

# Bounded Loops
**Effort:** free — ceilings and checkpoints declared before the loop starts; cuts cost outright. Removes: runaway loop spend — burned quota, 429-blocked routes, and progress a crash erases.

An unbounded loop is the most expensive bug an agent can ship. It burns budget, hammers
providers until they block you, and hides its own failure inside the spin. Every loop
gets a ceiling, a checkpoint, and a loud way to die — before it starts.

## When to run

Before starting any loop: a repair loop, a retry wrapper, a poller, a scheduler, a
multi-step autonomous run, anything that can re-issue a call or re-attempt a step.

## The steps

1. **Declare the budget first.** Tokens, cost, wall time, and max attempts — written
   down before the first iteration. A loop with no declared budget is unbounded by
   definition and does not start.
2. **Cap the inner rounds.** One inner episode (one LLM/tool cycle on one problem) gets
   a small fixed round ceiling (about 4). The ceiling bounds the episode, not the
   mission — unfinished work moves up, it does not grind.
3. **Checkpoint every iteration.** Durable state on disk — run manifest, evidence log,
   current step — never chat memory. Anyone (including a fresh session) can resume from
   the last checkpoint.
4. **On exhaustion: checkpoint, then escalate.** Hand the checkpoint to the outer loop
   or to your human with what was done, what is left, and the blocker. Never silently
   continue past a budget. Never silently stop, either — exhaustion is loud.
5. **Respect every external API.** Before the first call, learn the provider's rate
   limit and quota; when unknown, treat it as strict (one call, wide spacing) until
   measured. Throttle every call, cache and reuse responses, and hold a hard
   per-window ceiling.
6. **Back off exponentially on pushback.** A 429 or 503 means wait, then wait longer.
   Zero instant same-endpoint retries. A tight retry against one endpoint is how a
   working route dies: it burns quota and can get your whole egress address blocked.
7. **Carry a loud, bounded kill-switch.** Any loop that can re-issue a call has a max
   attempt count; when it hits, the loop stops LOUD with the evidence — never an
   infinite or silent spin.
8. **Stop and queue at safe points only.** Stop means checkpoint-then-cancel. New work
   queues for the next safe point (a state boundary between steps) — never injected
   mid-step. One loop instance, one writer, atomic state writes.

## Hard rules (what fails this skill)

- A loop that starts with no declared token / cost / time / attempt budget.
- Continuing past an exhausted budget, silently or otherwise, without escalating.
- An instant retry against the same endpoint, or any retry path without backoff.
- A retry loop with no attempt cap, or a cap that fails quietly when hit.
- Progress state kept only in conversation memory — a crash erases the run.
- Two loop instances writing the same state, or non-atomic state writes.
- Escaping the loop by weakening its own exit checks — a green produced by lowering
  the bar, deleting data, or swallowing errors is a fake green, not an exit.

## Works well with

- [optimus](../optimus/SKILL.md) — load the floor before any loop starts.
- [repair-loop](../repair-loop/SKILL.md) — the main consumer of these ceilings.
- [fleet-ladder](../fleet-ladder/SKILL.md) — bounded fallback across models, not hammering one.
- [session-handoff](../session-handoff/SKILL.md) — what a checkpoint escalates into.

From Tcuzzo/HydraAgent_public, MIT.

More from Tcuzzo/HydraAgent_public

Signals

Stars
2
Forks
0
Open issues
0
Last commit (this folder)
Oct 6, 2026 (25 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from Tcuzzo

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get bounded-loops running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying bounded-loops?

CallGet help
Cite this page

bounded-loops skill. Agent Mart. https://agentmart.dev/skills/tcuzzo-bounded-loops (last updated 2026-10-24)