Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost.
# Add to your Claude Code skills
git clone https://github.com/cobusgreyling/loop-engineeringGuides for using ai agents skills like loop-engineering.
Last scanned: 6/15/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-06-15T10:24:04.404Z",
"npmAuditRan": true,
"pipAuditRan": true,
"promptInjectionRan": true
}loop-engineering is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by cobusgreyling. Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orchestrate agents (inspired by Addy Osmani and Boris Cherny). Includes loop-audit, loop-init, loop-cost. It has 218 GitHub stars.
Yes. loop-engineering passed SkillsLLM's automated security scan — a dependency vulnerability audit plus prompt-injection heuristics — with no high-severity issues. You can read the full report in the Security Report section on this page.
Clone the repository with "git clone https://github.com/cobusgreyling/loop-engineering" and add it to your Claude Code skills directory (see the Installation section above).
loop-engineering is primarily written in JavaScript. It is open-source under cobusgreyling on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh loop-engineering against similar tools.
No comments yet. Be the first to share your thoughts!
Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead.
For developers using Grok, Claude Code, Codex, Cursor, and other AI coding agents.
A loop is a recursive goal: you define a purpose and the AI iterates (often with sub-agents, verification, and external state) until the goal is complete or the loop decides to hand off to you.
| Start here | Description |
|---|---|
| Loop Engineering essay | The concept, primitives, and Grok mapping — read this first |
| Pattern Picker | Which loop to run first — start here if unsure |
| Primitives Matrix | Grok vs Claude Code vs Codex — bookmark this |
| Loop Design Checklist | Ship readiness rubric |
| Patterns | 7 production patterns + interactive picker |
| Starters | Clone-and-run kits (Grok, Claude Code, Codex) |
| loop-audit | Loop Readiness Score CLI (v1.4 + activity detection) — npx @cobusgreyling/loop-audit . --suggest |
| loop-init | Scaffold starters + budget/run-log (v1.2) — npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok |
| loop-cost | Token spend estimator — npx @cobusgreyling/loop-cost |
| Stories | Real wins and honest failures |
Peter Steinberger:
“You shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.”
Boris Cherny (Head of Claude Code at Anthropic):
“I don’t prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do. My job is to write loops.”
The leverage point has moved from crafting individual prompts to designing the control systems that orchestrate agents over time.
| Primitive | Job in the Loop |
|---|---|
| Automations / Scheduling | Discovery + triage on a cadence |
| Worktrees | Safe parallel execution |
| Skills | Persistent project knowledge |
| Plugins & Connectors | Reach into your real tools (MCP) |
| Sub-agents | Maker / checker split |
| + Memory / State | Durable spine outside any conversation |
Full detail: docs/primitives.md · Cross-tool matrix: docs/primitives-matrix.md
flowchart LR
A[Schedule / Automation] --> B[Triage Skill]
B --> C[Read + Write STATE / Memory]
C --> D[Isolated Worktree]
D --> E[Implementer Sub-agent]
E --> F[Verifier Sub-agent<br/>tests + gates]
F --> G[MCP / Git / Tickets]
G --> H{Human Gate?}
H -->|safe / allowlisted| I[Commit / PR / Action]
H -->|risky / ambiguous| J[Escalate to human<br/>with full context]
I --> A
J --> A
This reference repo now runs its own validate-patterns + audit workflows on every push/PR (see .github/workflows/). We also added LOOP.md describing the loops that will maintain it.
| Pattern | Cadence | Starter | Week 1 | Token cost |
|---|---|---|---|---|
| Daily Triage | 1d–2h | minimal-loop | L1 report | Low |
| PR Babysitter | 5–15m | pr-babysitter | L1 watch | High |
| CI Sweeper | 5–15m | ci-sweeper | L2 cautious | Very high |
| Dependency Sweeper | 6h–1d | dependency-sweeper | L2 patch-only | Medium |
| Changelog Drafter | 1d or tag | changelog-drafter | L1 draft | Low |
| Post-Merge Cleanup | 1d–6h | post-merge-cleanup | L1 off-peak | Low |
| Issue Triage | 2h–1d | minimal-loop | L1 propose-only | Low |
Not sure which to pick? Try the interactive picker or pattern-picker.
Machine-readable index: patterns/registry.yaml (7 patterns)
# 1. Scaffold a starter (or copy manually — see starters/)
npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok
# 2. Estimate token spend for your cadence
npx @cobusgreyling/loop-cost --pattern daily-triage --level L1
# 3. Audit readiness (budget + run-log now scored)
npx @cobusgreyling/loop-audit . --suggest
# 4. See scores climb: empty → L1 → L2
bash scripts/before-after-demo.sh
# 5. Start report-only (Grok example)
/loop 1d Run loop-triage. Update STATE.md. No auto-fix in week one.
All three CLIs publish to npm from tagged releases — see docs/RELEASE.md. No clone required.
Develop from source (monorepo contributors):
cd tools/loop-init && npm ci && npm test && node dist/cli.js /path/to/project --pattern daily-triage --tool grok
cd tools/loop-audit && npm ci && npm test && node dist/cli.js /path/to/project --suggest
cd tools/loop-cost && npm ci && npm test && node dist/cli.js --pattern ci-sweeper --cadence 15m
Phased rollout: L1 report → L2 assisted fixes → L3 unattended — see loop-design-checklist.
Loop engineering amplifies judgment — both good and bad.
Addy Osmani:
“Build the loop. But build it like someone who intends to stay the engineer, not just the person who presses go.”
Share production patterns, tool mappings, and failure stories. See CONTRIBUTING.md, adopters, and [GitHub Di