Loop/loopGitmedium riskadvancedsafety C · 60Forward Futurepre-dates current gate · under review

Verify agent output before it ships

Run one agent in an isolated worktree and release its staged output only after a second agent verifies the work.

prompt
→ Claude Code
Use Loop Harness for scheduled repository work such as CI triage, issue grooming, dependency updates, or docs sync. Set [retry limit], then start an isolated git worktree. Let one Claude session stage a patch or outbox message and a second Claude session verify it against explicit criteria. Ship only after a pass; otherwise preserve the findings and retry only within the limit. Finish with the source revision, staged output, verifier result, delivery status, and next run.
claude-code · codex

Use this when

Use this when a recurring repository task should run unattended but one agent must not be allowed to generate and approve the same output.

How it runs

  1. Set the retry limit, wake the due Loop Harness task, and create an isolated worktree from the approved source revision.
  2. Have the primary Claude session stage one bounded result without publishing it.
  3. Have a second Claude session inspect the staged work against explicit acceptance criteria.
  4. Ship on a pass; otherwise preserve the findings, publish nothing, and retry only until the preset limit.

Done when

✓ Only independently verified output ships. A second-agent pass releases the configured output; a failed verification preserves evidence and produces no external change.

Why it works

Workspace isolation limits interference, and the second-agent gate separates generation from approval. The result can run repeatedly without relying on one session's confidence.

Implementation note

The source implementation uses Loop Harness, git worktrees, and separate model sessions. Start with read-only tasks, test one run first, cap runtime and retries, and grant only the tools each agent needs.

Source: Forward Future ↗graded C · 60/100 — how grades work →

More git loops

Ship a PR until green

Loop/goalcommunityA

Implement a change, open the PR with gh, then keep fixing CI failures until every check passes, all in one goal loop.

prompt
→ Claude Code
/goal a PR is open for this change and every CI check passes — implement it, test locally, push, open the PR with `gh pr create`, then keep fixing failures (re-check with `gh pr checks`) until green; stop after 10 turns

Commit message hygiene on a branch

Loop/goallooprepoA

Rewrite the commit messages on your feature branch to conventional-commit format with meaningful bodies before opening the PR, leaving the code untouched.

prompt
→ Claude Code
/goal every commit on this branch (ahead of main) has a conventional-commit subject under 72 characters and a body explaining why — use interactive rebase to reword only (no code changes, no commits dropped), verify with `git log main..HEAD`, and confirm the diff against the original branch tip is empty; stop after 5 turns