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 agentmods add skills/hdkhosravian/loop-contract-skill/loop-contractnpx skills add hdkhosravian/loop-contract-skill --skill loop-contractgit clone --depth 1 https://github.com/hdkhosravian/loop-contract-skillWhat 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 | $0.00280 | $0.08998 |
| Opus 5 | $0.00140 | $0.04499 |
| Sonnet 5 | $0.00056 | $0.01800 |
| Haiku 4.5 | $0.00028 | $0.00900 |
Grade C, and why
loop-contract scanned grade C with 2 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 2d 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.
Subtle steeringmediumPrompt injection
Instructions that bias recommendations or shape behaviour without the user noticing.
**Never tell the user a job is complete without showing the gate's exit line.** Everything above is a Reads agent configuration directoriesmediumAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
cat .claude/loops/INDEX.md 2>/dev/null || ls -d .claude/loops/*/ 2>/dev/null How it starts
The opening of the file, as written. The whole thing — 523 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Loop Contract
What this skill produces
Given a raw need, this skill has two responses, one front-door. It first triages (step 0): when an
existing skill/plugin/agent already fits, it routes — names that capability and offers to run it.
Only when nothing fits does it design, and for a long autonomous job the design is a contract —
which, for a DONE job, it then executes rather than handing back as a document.
Routing lives in references/triage-routing.md; the rest of this document is the contract — the harder,
higher-stakes response.
A contract is the spine of a run — the mission, oracle, phases and budget, written down before the work so the run is disciplined instead of improvised.
In both modes you write it and then execute it yourself (§5) — the document guides the work, it does not replace it. The one exception is an explicit request for a contract to run elsewhere. Either way it must be precise enough that an agent with no memory of this conversation can execute it correctly and stop at the right moment.
When the response is a KNOWN contract, never start doing the described job. If the request is "audit PR #128", you do not audit PR #128 while writing the contract — you write the contract that makes auditing it reliable. If you catch yourself opening the repo to "check something first", stop; you are doing the job instead of designing it.
The prohibition is temporal, not modal. It means: do not start the job while the contract is still unwritten. Once the file exists, execute it — in either mode (§5). Forgetting this is the other failure, and the more common one in practice:
- routing may invoke a fitting capability, after the user confirms;
- contract execution, KNOWN or DONE — you write the contract and then carry it out, until the named DELIVERABLE exists. Refusing to act there is not discipline, it is the "handed back a document" bug.
This rule binds the designer's hands, not the contract's voice. You abstain from the work; the contract you hand off must compel the executor to do it. For a DONE job (implement, fix, migrate, produce an artifact) the contract commands the executor to change the world and defines completion as that change existing and passing its oracle — never as a report describing it. What comes back from that session is the job's deliverable, not a description of it: working code for an implementation job, every issue fixed and verified for a remediation job, the finished artifact for a plan or design, a verdict + evidence only for an audit. The contract is the run's spec; it is never the run's output.
What ships with it
12 files beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
- references/agent-comms.md 8.7 KB
- references/contract-template.md 30 KB
- references/execution-protocol.md 3.4 KB
- references/oracle-catalog.md 18 KB
- references/outer-loops.md 5.0 KB
- references/recurring-jobs.md 5.6 KB
- references/subagent-contracts.md 9.7 KB
- references/token-policy.md 8.6 KB
- references/triage-routing.md 12 KB
- references/worked-example.md 4.6 KB
- scripts/extract_requirements.py 7.8 KB runs code
- scripts/fold_ledger.py 45 KB runs code
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.
- 2d ago First seen · 523 lines · 280 tokens per session scan C 5ea424d095e3
loop-contract is a skill published in the GitHub repository hdkhosravian/loop-contract-skill (3 stars, last pushed 20d ago), licensed MIT. It adds 280 tokens to every session and 8,998 once invoked, about $0.0014 per session on Opus 5. A static security scan graded it C with 2 findings (subtle steering, reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
Other skills, from other repositories
karpathy-guidelines
Behavioral guardrails for LLM-assisted coding. Use when writing, reviewing, or refactoring code in any project to avoid overcomplication, keep changes surgical, surface assumptions early, and execute against verifiable success criteria.
claude-md-dependency-rescan
Re-detect this project's tech stack from package.json / requirements.txt / pyproject.toml / go.mod / Cargo.toml and diff it against the Tech Stack section of every CLAUDE.md. Read-only — returns added / removed / renamed dependencies, never edits.
claude-md-drift-audit
Audit every CLAUDE.md in this project for drift against the last week of git history. Flags sections that reference deleted files, renamed paths, or removed dependencies. Read-only — returns a punch list, never edits.
claude-md-link-check
Verify every @path chain import and every markdown link inside every CLAUDE.md in this project resolves to an existing file. Read-only — returns broken links with file:line refs, never edits.
premortem
Лёгкий советник «раздвигающий шторки» — premortem-сессия которая находит дыры в плане с разных углов, предлагает варианты решений по каждой и помогает юзеру быстро принять осознанные решения. История запусков сохраняется в ./docs/premortem/. Use when user types «премортем», «premortem», «найди дыры в плане», «посмотри…
ai-engineering-workflow
Use this skill for complex coding, coursework, data analysis, notebook, research, or multi-file projects that need structured issue creation, context analysis, task breakdown, atomic execution, verification, status tracking, and final closure.