Repository navigation
Harden /loop with "loop engineering" operating rules (trust levels, denylist, run-log) - #9
Merged
Merged
Conversation
Integrate concepts from github.com/cobusgreyling/loop-engineering to make the recurring loop safe to run (their own caveat: unattended loops make unattended mistakes; token costs explode). Our /loop previously had no trust gating, budget, run-state, or escalation rubric. - .claude/loop.md: rewritten with TRUST LEVELS (L1 report → L2 assisted → L3 unattended), a read-state-first/append-run-log step, a denylist (auth, payments, secrets, infra, CI config, migrations), escalation triggers, red-flag stop conditions (>3 attempts, verifier==implementer, no state, notify-every-run, auto-merge w/o allowlist), and budget/limits. - .claude/loop-checklist.md: new readiness rubric (10 sections + L0–L3) to gate raising a loop's trust level. - .claude/memory/loop-run-log.md: new append-only loop state (separate from the wiki log), with the >500-line rotation rule. - CLAUDE.md: loop trust-level + maker/checker no-self-approve rule + Agent isolation:worktree note. skills-index, README tree, adoption-guide (with source citation), and memory topics/workflow.md + log entry updated. Docs/config only; no product code touched. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_014xUCrJdREvUMjoVzSX5T8G
There was a problem hiding this comment.
Pull request overview
This PR hardens the repo’s recurring /loop watchdog operating procedure by adding trust gating, durable run state, a denylist, escalation/stop rules, and a readiness checklist—aimed at making unattended/recurring loops safer to operate without touching product code.
Changes:
- Rewrites
.claude/loop.mdto introduce trust levels (L1–L3), denylist/escalation/stop rules, and a required read-state-first + append-run-log flow. - Adds new loop artifacts:
.claude/loop-checklist.md(readiness rubric) and.claude/memory/loop-run-log.md(append-only durable loop state). - Wires the new loop hardening guidance into existing docs and indexes (README, CLAUDE.md, adoption guide, skills index, memory workflow topic, memory log).
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| README.md | Updates the repo tree to include the hardened loop docs and new run-log/checklist files. |
| docs/adoption-guide.md | Documents the hardened recurring-loop operating rules for adopters. |
| CLAUDE.md | Adds trust-level guidance, run-log references, and maker/checker + worktree isolation notes. |
| .claude/skills-index.md | Updates /loop routing guidance to reference the checklist and durable run-log. |
| .claude/memory/topics/workflow.md | Records the loop hardening principles in the workflow topic page. |
| .claude/memory/loop-run-log.md | Introduces a new append-only durable state file for /loop runs/iterations. |
| .claude/memory/log.md | Logs the ingestion of the loop-hardening changes into the memory log. |
| .claude/loop.md | Replaces the prior loop prompt with hardened operating rules and run-log requirements. |
| .claude/loop-checklist.md | Adds a trust-level readiness checklist (L0–L3) to gate promotion. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…n wording) Resolve the 8 PR #9 review comments, in three groups: - Budget made concrete & auditable: .claude/loop.md now defines a per-run cap (turn budget e.g. 25 turns, or token ceiling) declared with the trust level and checked each iteration; added a `budget: <used>/<cap>` line to the run-log entry template in both .claude/loop.md and .claude/memory/loop-run-log.md. - Terminology standardized on "iteration" for log read/append granularity (CLAUDE.md, loop-checklist §5/§8/§9 + red flag, adoption-guide), keeping the intentional "per-run cap" for budget scope. - Rotation note in loop-run-log.md now says to create the archive dir/file on demand (matching memory/log.md). Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_014xUCrJdREvUMjoVzSX5T8G
Standalone guideline (docs/loop-integration-guide.md) for integrating recurring /loop automations into an existing project: what to copy (loop.md, loop-checklist, loop-run-log), the L1→L2→L3 trust model, a step-by-step (scope, cadence, denylist, budget, run-log wiring, promotion gates), loop-pattern recipes (daily-triage, pr-babysitter, ci-sweeper, ...), worktree isolation for file-mutating loops, the red-flag stop conditions, and local-vs-CI guidance. Cites loop-engineering. Linked from the README docs tree and the adoption guide's hardened-loops section. Added to PR #9 since it documents that PR's loop files. Co-Authored-By: Claude Opus 4.8 <[email protected]> Claude-Session: https://claude.ai/code/session_014xUCrJdREvUMjoVzSX5T8G
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Integrates the most valuable, Claude-Code-fitting ideas from cobusgreyling/loop-engineering to make our recurring
/loopsafe to operate — addressing that project's own caveat that "unattended loops make unattended mistakes; token costs explode." Our/looppreviously had no trust gating, budget, durable run-state, or escalation rubric.We already covered much of "loop engineering" (skills, memory wiki, MCP connectors, CI, maker/checker critics); this PR fills the genuine gaps. Docs/config only — no product code touched.
Changes
.claude/loop.md— rewritten with:.env, infra/deploy, CI config, DB migrations..claude/loop-checklist.md— new readiness rubric (10 sections + L0–L3) to gate raising a loop's trust level..claude/memory/loop-run-log.md— new append-only loop state (separate from the wiki'slog.md), with the >500-line rotation rule.CLAUDE.md— loop trust-level guidance + the maker/checker no-self-approve rule + anAgent isolation: worktreenote for file-mutating loops.skills-index.md, README tree, the adoption guide (with a "Recurring loops are hardened" section citing the source), and memory (topics/workflow.md+ log ingest entry).Deliberately skipped (not a fit)
Their
loop-init/loop-cost/loop-auditnpm CLIs and the multi-tool (Grok/Codex) primitives matrix — we're Claude-Code-only with our own scaffolding; borrowed the concepts, not the tooling.Test plan
.claude/*,CLAUDE.md,README.md,docs/adoption-guide.md.loop-checklist.md,loop-run-log.md) resolve.verifywill run on this PR (no source/test changes → expected green).🤖 Generated with Claude Code
Generated by Claude Code