Skip to content

Guide · Open source

How to use loop-engineering: setup, patterns and first loop

Updated · written with AI from the project's own documentation and checked against our catalogue data

Loop Engineering is a collection of patterns, starter files and command-line tools for setting up recurring workflows in which AI coding agents such as Claude Code, Grok, Codex or Opencode discover work on a codebase, hand it to agents, verify the results and save state. It is aimed at developers who already use coding agents and want to automate repo chores like issue triage or CI checks. After this guide you will know how to initialise a first loop, check it with the doctor command, and roll it out cautiously.

Loop Engineeringcobusgreyling/loop-engineering · ★ 11.7k · MIT

Quick start

  1. 1Check prerequisites. Install Node.js and have an AI coding agent such as Claude Code, Grok, Codex or Opencode available.
  2. 2Initialise a loop. Run the init command in your repo with --pattern daily-triage and your chosen --tool.
  3. 3Run doctor. Run the doctor command on the same directory to check the setup.
  4. 4Estimate cost. Run the cost command for the pattern and level to see expected spend.
  5. 5Stay report-only. Keep week one report-only and read what the loop produces before acting on it.
  6. 6Promote carefully. Move from L1 to L2 and then L3 only after the verifier has been reliable for a week.

What loop engineering means

The README describes loop engineering as designing the system that prompts agents, instead of typing each prompt yourself. A loop discovers work, hands it to an agent, verifies the result and persists state.

The project is a pattern library for operating agents around a codebase. It is not a button that rewrites a module for you.

Check the prerequisites

You need Node.js. The README does not state a required version. You also need an AI coding agent tool such as Claude Code, Grok, Codex or Opencode if you want agent runs.

The README assumes you already know these tools and state-file conventions such as STATE.md. If you are new to coding agents, start with the agent tool itself before building a loop.

Initialise a daily triage loop

Run the init command from the root of your repository. The --pattern flag selects the pattern and --tool selects the agent. If you omit --tool it defaults to claude. You can swap in grok, codex or opencode.

Week one is report-only, so the first run should only produce a report.

  • --pattern daily-triage selects the Daily Triage pattern
  • --tool claude selects Claude Code (also the default)
  • Replace claude with grok, codex or opencode to use another tool
npx @cobusgreyling/loop init . --pattern daily-triage --tool claude

Check the setup with doctor

After init, run the doctor command on the same directory to check the setup. The README lists doctor as part of the unified front door alongside init, status, audit and cost.

npx @cobusgreyling/loop doctor .

Estimate cost before you scale

The README warns that token costs can grow quickly. Its cost command takes a pattern and a level. Use it to estimate spend before you move past report-only.

npx @cobusgreyling/loop cost --pattern daily-triage --level L1

Roll out in stages

The README recommends a staged rollout: L1 report, then L2 assisted, then L3 unattended. Move on only after the verifier has been right for a week. Loop Ready now weights recent runs more than files on disk, so a 30-day-old STATE.md does not count as L3.

Each pattern has its own week-one level. For example, CI Sweeper starts at L2 cautious, while Issue Triage starts at L1 propose-only.

  • L1 report: observe and report only
  • L2 assisted: agents act with guidance
  • L3 unattended: loops run without supervision

What people use it for

  • Recurring issue triage on a repository using the Daily Triage pattern
  • Watching pull requests with the PR Babysitter pattern
  • A GitHub Actions loop with few files using the thin loop starter
  • Cautious dependency follow-up with the Dependency Sweeper pattern, which starts patch-only
  • Drafting changelogs on a daily schedule or at tag time with the Changelog Drafter pattern

Frequently asked questions

Is loop-engineering free to use?

The project is licensed under MIT, as stated in the README. Agent runs use AI coding agent tools, and the README warns that token costs can grow quickly, so check the cost command before scaling.

What do I need installed to use loop-engineering?

The README lists Node.js, with no version stated, and an AI coding agent tool such as Claude Code, Grok, Codex or Opencode if you want agent runs.

What does the init command do?

The init command sets up a loop in your repository for a chosen pattern and tool. The README's example uses npx @cobusgreyling/loop init . --pattern daily-triage --tool claude.

Does loop-engineering run unattended automation right away?

No. The README says week one is report-only and recommends rolling out from L1 report to L2 assisted to L3 unattended only after the verifier has been right for a week.

Is loop-engineering a single packaged application?

No. The README describes it as primarily patterns, starter files and CLI tools, not a single packaged app.

How is this different from prompting an agent directly?

Instead of typing each prompt, you design a system that discovers work, hands it to agents, verifies results and saves state. The README frames this as designing the system that prompts agents.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use loop-engineering if you already work with AI coding agents and want a cautious, report-first way to automate repo chores such as issue triage, CI checks or dependency follow-up. Pick something else if you are new to coding agents or need a packaged application that runs unattended from day one.

Install options & downloads