loop-constraints

A rule-enforcement step that reads `loop-constraints.md` before work starts and applies its project rules to every action.

In plain words
What is it for?
Use it as a safety gate before triage, file changes, fixes, pushes, and merges.
Why use it?
It prevents an agent from editing restricted paths, proposing untested fixes, pushing when prohibited, or merging without human approval.

Skill for Claude CodeCodex

Install

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.

agentmods
npx agentmods add skills/cobusgreyling/loop-engineering/loop-constraints
Any agent
npx skills add cobusgreyling/loop-engineering --skill loop-constraints
Clone the repo
git clone --depth 1 https://github.com/cobusgreyling/loop-engineering

Made for: Claude Code, Codex.

Per session 35 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 451 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

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.

ModelPer sessionOnce invoked
Fable 5 $0.00035 $0.00451
Opus 5 $0.00017 $0.00226
Sonnet 5 $0.00007 $0.00090
Haiku 4.5 $0.00003 $0.00045

Measured 2d ago against content hash 2cb8398e64e7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

loop-constraints 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 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.

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.

skills/loop-constraints/SKILL.md · 49 lines

What it actually says

Loop Constraints Enforcer

You are the guardrail. Before any other work begins, you MUST:

  1. Read loop-constraints.md from the project root.
  2. Load every rule into your working memory.
  3. Check if loop-pause-all is active → exit immediately.
  4. Apply these rules to EVERY action that follows.

How to enforce

  • Before pushing: re-read the Push & Merge section. If ANY rule blocks it, stop and tell the human.
  • Before editing a file: re-read the Paths section. If the path matches a denylist pattern, escalate.
  • Before proposing a fix: re-read the Code section. Run tests. One fix per run.
  • Before merging: re-read the Push & Merge section. Human must approve.

Output at start of run

Always begin with a one-line confirmation. Count each individual constraint/rule in loop-constraints.md and replace N with the actual number of active rules:

Constraints loaded from loop-constraints.md: N rules active.

If no loop-constraints.md exists, say so and proceed with default safety rules from docs/safety.md.

Interaction with other skills

  • loop-triage — constraints may override triage priority (e.g. "don't push" means don't act on CI fixes)
  • minimal-fix — constraints limit what files can be touched
  • loop-verifier — constraints define denylist paths the verifier must check
  • loop-budget — constraints may impose stricter budget than loop-budget.md

Default constraints (when no file exists)

If loop-constraints.md is absent, enforce these minimums:

  • Never edit .env, .env.*, auth/, payments/, secrets/, credentials/
  • Never auto-merge to main
  • Never disable tests
  • Escalate after 3 failed fix attempts
Changes

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.

  1. 2d ago First seen · 49 lines · 35 tokens per session scan A 2cb8398e64e7

Subscribe to this mod's changes

loop-constraints is a skill published in the GitHub repository cobusgreyling/loop-engineering (10,811 stars, last pushed today), licensed MIT. It adds 35 tokens to every session and 451 once invoked, about $0.0002 per session on Opus 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-08-30.

Related

Other skills, from other repositories

aw-author

Author, validate, and improve GitHub Agentic Workflow (gh-aw) markdown files. Use when the user wants to create a new workflow, validate an existing workflow, improve a workflow, or debug workflow issues. Triggers on: "aw-author", "agentic workflow", "gh-aw workflow", "workflow markdown", "workflow frontmatter"…

zircote-plugins/github-agentic-workflows · 91 tokens

aw-daily

Fully autonomous daily pipeline for the aw-author plugin. Executes intelligence research (web search + GitHub activity queries), posts to Discussions, performs gap analysis against reference files, creates issues, implements changes on develop branch, creates PR, requests review, and auto-merges. Designed for…

zircote-plugins/github-agentic-workflows · 94 tokens

gh-aw-report

Daily intelligence reporting for the GitHub Agentic Workflows (gh-aw) ecosystem. Executes 8+ targeted web searches, synthesizes findings into a structured Markdown report, updates the persistent knowledge base, and optionally posts to GitHub Discussions. Triggers on: "aw-report", "gh-aw report", "intelligence sweep"…

zircote-plugins/github-agentic-workflows · 79 tokens

hive-maintainer

Discipline for developing Hive itself — PR sizing, review handling, merge discipline, release workflow, delegation, and cleanup hygiene. Use this skill when working on Hive repo changes that span multiple PRs or review cycles.

intertwine/hive-orchestrator · 48 tokens

hive-essentials

Hive mental model and orientation. Read this first before using any other Hive skill. Covers the entity hierarchy, observe-and-steer pattern, drivers, sandboxes, console vs CLI, and workspace conventions.

intertwine/hive-orchestrator · 46 tokens

hive-work-loop

The core agent work cycle in Hive — from finding a task through claiming, launching a run, handling approvals, finishing, and promoting. Use this skill for task-first project work, governed runs, and clean handoff.

intertwine/hive-orchestrator · 49 tokens