What it is
Loop Engineering is a pattern library for operating AI agents around a codebase, with starters and a unified CLI (npx @cobusgreyling/loop) offering init, doctor, status, audit and cost. You design a system that discovers work, hands it to agents, verifies results and persists state, instead of typing each prompt yourself. It is not a "rewrite the module" button.
Who it's for
- Developers who want to run AI coding agents on a recurring schedule to keep a repo healthy (issues, CI, deps)
- Teams who want to manage PRs, changelogs or cleanup with agent loops
- Users of Claude Code, Grok, Codex, OpenClaw, Opencode or GitHub Actions
Requirements
Requirements
- Node/npx to run
@cobusgreyling/loop(implied by the npx commands) - One of the supported tools: claude (default), grok, codex or opencode
Setup
Initialize a daily-triage loop and run doctor
Scaffold the daily-triage pattern for the Claude tool, then check the setup.
--tooldefaults toclaude; swap forgrok,codex, oropencode. Week one is report-only.bashnpx @cobusgreyling/loop init . --pattern daily-triage --tool claude npx @cobusgreyling/loop doctor .Estimate loop cost
Check the cost of a pattern at a given level before running it.
bashnpx @cobusgreyling/loop cost --pattern daily-triage --level L1
Examples
Scaffold a daily triage loop
bashnpx @cobusgreyling/loop init . --pattern daily-triage --tool claudeWhat it does: Initializes the daily-triage pattern in the current directory for Claude. Other tools can be substituted via --tool.
Validate the setup
bashnpx @cobusgreyling/loop doctor .What it does: Runs the doctor command on the project after init.
Check pattern cost at L1
bashnpx @cobusgreyling/loop cost --pattern daily-triage --level L1What it does: Shows the cost estimate for the daily-triage pattern at the L1 report-only level.
Pros & cons
Pros
- Pro:Eight documented patterns with cadence, week-one level and cost ratings (e.g. Daily Triage, PR Babysitter, CI Sweeper)
- Pro:Staged rollout from L1 report to L2 assisted to L3 unattended, with week one report-only
- Pro:Unified CLI covers init, doctor, status, audit and cost
- Pro:Examples for multiple tools and docs on failure modes, anti-patterns and safety
Cons
- Con:Token costs can explode; some patterns are rated High or Very high cost (PR Babysitter, CI Sweeper)
- Con:Unattended loops make unattended mistakes, so output needs to be reviewed
- Con:Not a one-click refactor tool; it is a pattern library for operating agents
Images
