DEV Community

sun young
sun young

Posted on

Stop Prompting, Design the Loop: An Introduction to Loop Engineering

If you've been using AI coding agents (Claude Code, Codex, Cursor) for a while, you've probably hit the same wall: you're the bottleneck.

Every bug fix needs context re-explained. Every PR review needs requirements restated. Every issue triage needs rules repeated. You thought you were automating your work — but you became the agent's full-time typist.

loop-engineering (10.7k stars, MIT, TypeScript) has a blunt answer: Stop prompting. Design the loop. Get a score.

From prompting to loops

The traditional workflow looks like this:

observe → think → write a prompt → agent executes → you check → write another prompt

You're present at every step.

Loop engineering flips it: you design a loop that discovers work, hands it to an agent, verifies results, and persists state — so you step back and only design rules and sign off.

Think of it as the difference between hand-delegating tasks every day versus designing a job description, a workflow, and a review process once, then letting the system run.

A pattern library, not a magic button

The project ships 8 ready-to-use patterns for operating agents around a codebase:

  • daily-triage — check issues, CI, and deps on a schedule
  • pr-babysitter — watch PRs, nudge, and babysit them to landing
  • ci-sweeper — triage failing CI and suggest fixes
  • dependency-sweeper — scan deps and apply patches only
  • changelog-drafter — draft release notes automatically
  • post-merge-cleanup — tidy up after merges
  • issue-triage — label and suggest on issues
  • thin-loop — a minimal GitHub Actions loop

Starting one is a single command:

npx @cobusgreyling/loop init . --pattern daily-triage --tool claude
npx @cobusgreyling/loop doctor .
Enter fullscreen mode Exit fullscreen mode

--tool accepts claude, grok, codex, or opencode — no vendor lock-in.

The part I respect most: L1 → L2 → L3

The project doesn't push you to go fully autonomous. It defines a trust ladder:

  • L1 Report — the agent observes and reports only, never touches code
  • L2 Assist — it can act, but needs confirmation (patches, PRs)
  • L3 Unattended — only after a validator runs correctly for a full week

Trust isn't granted — it's earned one week at a time. For teams, this turns "AI writes code" from a gamble into a grayscale rollout.

It even ships a "Loop Ready" score that weights recent runs over stale files on disk. Anything older than 30 days doesn't count as L3.

The takeaway

Prompt engineering won't disappear — but it's becoming the "how to phrase a single interaction" skill. The skill that actually determines whether an agent reliably does work is whether you can design a loop that's verifiable, grayscale-able, and auditable.

If you're tired of hand-feeding prompts every day, give it half an hour. It won't write code for you — it'll make you rethink whether you want a more obedient assistant, or a system that runs itself.

I've localized the README and core docs to Chinese: https://github.com/yangshun2005/loop-engineering-cn

If you find this project useful, a star on the original repo supports the author's ongoing maintenance.

Top comments (0)