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.
npx skills add catpilotai/catpilot-ai-guardrails --skill loop-disciplinegit clone --depth 1 https://github.com/catpilotai/catpilot-ai-guardrailsWrote 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.
[](https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/loop-discipline)<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/loop-discipline"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/loop-discipline/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/catpilotai/catpilot-ai-guardrails/loop-discipline"><img src="https://agentmods.dev/badge/skills/catpilotai/catpilot-ai-guardrails/loop-discipline.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00045 | $0.01199 |
| Opus 5.5 | $0.00018 | $0.00480 |
| Sonnet 5.5 | $0.00009 | $0.00240 |
| Haiku 4.5 | $0.00005 | $0.00120 |
Grade A, and why
loop-discipline 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 10d 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.
How it starts
The opening of the file, as written. The whole thing — 127 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Baseline
Applies when: Building, debugging, or evaluating agent tool-calling loops, retry wrappers, state/context managers, tool-health circuit breakers, or agent benchmark suites.
Always:
- Cap per-tool retries (
max_attempts = 3) and require an external-state verifier (checking file diff hash, schema version, ticket state, or DOM snapshot—never the model's self-report) to prove the world changed before granting another retry. - Enforce a shared, workflow-scoped retry budget across nested sub-agents, crons, and step wrappers, plus jittered exponential backoff (
max_calls,max_cost_usd,max_duration_sec). - Invalidate cached context and force a fresh state re-read after every state-changing tool call (
file_write,git_commit,package_install,db_migrate,browser_click). - Probe failing tools with capped exponential backoff (
min(2 ** failures, 3600)) and reset failure counts on recovery rather than permanently blacklisting a tool for the life of the process. - Evaluate and report agent loop quality using
pass@1alongside verifier evidence traces; reservepass@k(k > 1) strictly for research diagnostics.
Never:
- Retry a tool call up to an arbitrary loop limit based solely on the model claiming
"trying again"without verifying external state progress. - Continue executing subsequent steps of a plan against a pre-mutation context snapshot after a mutating tool call has run.
- Permanently cache a
"tool is broken"verdict with no re-probe mechanism, or headlinepass@100as evidence of production reliability.
Open the full component before acting: it has the examples, the remediation steps, and the detection patterns.
Why
Uncapped retries launder one bug into seven partial writes and orphaned resources. Meanwhile, nested retry layers (cron retry × sub-agent retry × tool retry) multiply into retry storms unless governed by a single workflow-wide budget. Finally, acting on stale context after a file write or migration is the single most common cause of cascading edits in long-horizon coding and ops loops.
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.
- 10d ago First seen · 127 lines · 45 tokens per session scan A 9825d361ffa6
loop-discipline is a skill published in the GitHub repository catpilotai/catpilot-ai-guardrails (2 stars, last pushed 8d ago), licensed MIT. It adds 45 tokens to every session and 1,199 once invoked, about $0.0002 per session on Opus 5.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-10-29.
loop-discipline compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| loop-disciplinecatpilotai/catpilot-ai-guardrails | Skill | 2 | 8d ago | MIT | A | 45 | Claude Code |
| dcf-modelNousResearch/hermes-agent | Skill | 262k | today | MIT | A | 14 | Claude Code, Codex |
| baoyu-article-illustratorNousResearch/hermes-agent | Skill | 262k | today | MIT | A | 18 | Claude Code, Codex |
| flash-attentionNousResearch/hermes-agent | Skill | 262k | today | MIT | A | 14 | Claude Code, Codex |
| subagent-driven-developmentNousResearch/hermes-agent | Skill | 262k | today | MIT | A | 17 | Claude Code, Codex |
| mcporterNousResearch/hermes-agent | Skill | 262k | today | MIT | A | 16 | Claude Code, Codex |
| mem0-vercel-ai-sdkmem0ai/mem0 | Skill | 69k | yesterday | Apache-2.0 | A | 146 | Claude Code, Codex |