loop-engineering

by cobusgreylingVerified

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.

10,556
Stars
1,448
Forks
JavaScript
Language
8/23/2026
Added
View on GitHubDownload ZIP

⚠️ Third-Party Software Notice

This skill is third-party open-source software developed and hosted independently on GitHub. SkillTip is an informational directory and does not control or maintain the underlying repository. Any security checks displayed are automated and limited in scope. Review the source code before installing.

Read the Terms of Service

Installation

Add to your Claude Code skills directory:

# Add to your Claude Code skills
git clone https://github.com/cobusgreyling/loop-engineering

Getting Started

Guides for using skills like loop-engineering.

Security Report

Verified

Last scanned: —

{
  "status": "PASSED",
  "issues": []
}

README.md

Loop Engineering

Explore the Showcase

GitHub stars loop-audit dogfood loop npm loop-audit npm loop-init npm loop-cost npm loop-sync npm loop-context npm loop-mcp-server npm loop-worktree npm MIT Pages

Loop Engineering logo

Stop prompting. Design the loop. Get a score.

Loop Engineering — design the system that prompts your agents

Start in 5 minutes · Quickstart · Pattern picker · Contribute · ⭐ Star

If this repo changed how you run agents, a star helps others find the patterns. Docs & small PRs: we aim to review within 48 hours.

# One front door — init + doctor + status
npx @cobusgreyling/loop init . --pattern daily-triage --tool grok
npx @cobusgreyling/loop doctor .

loop init scaffolds skills, state, and budget files, then prints your Loop Ready score. loop doctor turns audit + sync into top-3 next actions. Swap --tool for claude, codex, or opencode. Optional: --with-foundry for a versioned harness stack. Legacy npx @cobusgreyling/loop-init . still works. See docs/cli-front-door.md.

Loop Ready score climbs from 10 to 100 in 15 seconds

Loop engineering replaces you as the person who prompts the agent — you design the system that does it instead.

New here? Quickstart (5 min) · Interactive picker · Help wanted

For developers using Grok, Claude Code, Codex, Cursor, and other AI coding agents.

→ Interactive showcase + pattern picker · Essay · Addy Osmani

Contents

Quick Links

Start hereDescription
Quickstart (5 min)loop initloop doctor → first loop — start here if you just landed
CLI front doorUnified @cobusgreyling/loop — old packages stay open
Loop Engineering essayThe concept, primitives, and Grok mapping — read for the why
Pattern PickerWhich loop to run first — start here if unsure
Primitives MatrixCross-tool loop primitive mapping — bookmark this
Loop Design ChecklistShip readiness rubric
Patterns7 production patterns + interactive picker
StartersClone-and-run kits (Grok, Claude Code, Codex, Opencode)
Opencode examplesCLI-first loops: cron/systemd + opencode run, skills, worktrees
loop (front door)Unified CLInpx @cobusgreyling/loop init | doctor | status | audit | cost · cli-front-door
loop-auditLoop Readiness Score CLI (v1.7 — constraints + governance + Harness Runtime) — npx @cobusgreyling/loop audit . --suggest · also loop-audit
loop-initScaffold starters + budget/run-log + constraints (v1.5) — npx @cobusgreyling/loop init . --pattern daily-triage --tool grok · also loop-init
harness-foundryCompanion runtime: versioned stacks, sessions, traces — npx @cobusgreyling/harness-foundry init --from loop-engineering:daily-triage
outerloopCompanion governance: evidence → verdict → answerability
loop-costToken spend estimator — npx @cobusgreyling/loop-cost
loop-syncDrift detection between STATE.md and LOOP.mdnpx @cobusgreyling/loop-sync .
loop-contextStateful memory manager + circuit breaker for long runs — npx @cobusgreyling/loop-context --check --ledger run.json
loop-mcp-serverMCP runtime lookup for patterns, skills, state — npx @cobusgreyling/loop-mcp-server
loop-worktreeManage isolated git worktrees per fix attempt — npx @cobusgreyling/loop-worktree create --run-id <id> --pattern <p>
loop-gateMechanical enforcement of the path denylist + auto-merge allowlist from gate.yamlnpx @cobusgreyling/loop-gate check --action auto-merge --paths <f1,f2,...>
loop-sandboxEphemeral git worktree isolation + patch capture — npx @cobusgreyling/loop-sandbox run -- <cmd>
loop-actionGitHub Composite Action for running loops in CI — uses: cobusgreyling/loop-engineering/tools/loop-action@main
Goal EngineeringCompanion: loops discover, goals finish — /goal + stack cookbook (npx @cobusgreyling/goal doctor .)
Memory EngineeringCompanion: stop re-explaining the repo — tiers, budget, Memory Ready score (node tools/memory-init/cli.js .)
Fleet EngineeringCompanion: govern populations of agents — registry, inbox, Fleet Ready score (npx @cobusgreyling/fleet-init .)
StoriesReal wins and honest failures

Ecosystem stack

memory-engineering → loop-engineering → harness-foundry → outerloop → fleet-engineering
   (persist)            (patterns)         (runtime)        (verdict)     (population)
LayerYou getStart
MemoryTiers, recall budget, Memory Ready scorememory-engineering
Design (this repo)Patterns, starters, Loop Ready scorenpx @cobusgreyling/loop init . then loop doctor .
RuntimeVersioned harness, traces, evolvenpx @cobusgreyling/loop init . --with-foundry or Foundry showcase
GovernEvidence, verdict, answerabilityouterloop
FleetRegistry, inbox, budgets, kill switchnpx @cobusgreyling/fleet-init . · Fleet Ready

Scale beyond one loop: when agents forget across sessions, add memory-engineering. When you have many agents/loops on a team, add fleet-engineering.

Next after Loop Ready 80+: version the loop as a harness — loop-init prints the CTA automatically; loop-audit recommends Foundry when the score is strong but .foundry/stack.yaml is missing.

Community & announcements

DiscussionSummary
Contributor quickstartHelp wanted: open good first issues — comment I'll take this to get assigned · see Help wanted
Community updateJuly 4: 5.5k stars, traffic sources, contributor merges
Community week (Jul 8)loop-worktree npm, MCP quickstart, tool appendices
npm update (Jul 16)loop-context 1.2.0 + loop-worktree 1.1.0 — daily budget, path locks
Maintenance (Jul 10)Doc sync, branch prune, loop-audit 1.6.0 follow-up
Prior release notesv1.5.0 — loop-sync, constraints, MCP server
Add your projectPinned: Loop Ready badge + adopters list

Why This Matters

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.

The Five Building Blocks + Memory

PrimitiveJob in the Loop
Automations / SchedulingDiscovery + triage on a cadence
WorktreesSafe parallel execution
SkillsPersistent project knowledge
Plugins & ConnectorsReach into your real tools (MCP)
Sub-agentsMaker / checker split
+ Memory / StateDurable spine outside any conversation

Full detail: docs/primitives.md · Cross-tool matrix: docs/primitives-matrix.md

Visual Overview

The Five Building Blocks + Memory — Loop Engineering

Anatomy of a Loop

Animated loop flow — schedule, triage, state, worktree, implement, verify, MCP, human gate

Mermaid diagram (copy-friendly)
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

Deeper diagrams — the actor-level sequence within one run, the run lifecycle's states, autonomy levels L1-L3, and how tools/ maps onto the primitives — live in docs/architecture-diagrams.md.

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.

Patterns

Seven production loop patterns with cadence and token cost

PatternCadenceStarterWeek 1Token cost
Daily Triage1d–2hminimal-loopL1 reportLow
PR Babysitter5–15mpr-babysitterL1 watchHigh
CI Sweeper5–15mci-sweeperL2 cautiousVery high
Dependency Sweeper6h–1ddependency-sweeperL2 patch-onlyMedium
Changelog Drafter1d or tagchangelog-drafterL1 draftLow
Post-Merge Cleanup1d–6hpost-merge-cleanupL1 off-peakLow
Issue Triage2h–1dissue-triageL1 propose-onlyLow

Not sure which to pick? Try the interactive picker or pattern-picker.

Machine-readable index: patterns/registry.yaml (7 patterns)

Getting Started (5 minutes)

# 1. Scaffold + Loop Ready score (printed automatically)
npx @cobusgreyling/loop init . --pattern daily-triage --tool grok

# 2. One health check (audit + sync + files → top 3 actions)
npx @cobusgreyling/loop doctor .

# 3. Optional: cost estimate / badge / day-2 dashboard
npx @cobusgreyling/loop cost --pattern daily-triage --level L1
npx @cobusgreyling/loop badge .
npx @cobusgreyling/loop status .

# 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.

Same as before: npx @cobusgreyling/loop-init and loop-audit still work — CLI front door.

All npm CLIs publish from tagged releases — see docs/RELEASE.md. No clone required.

Develop from source (monorepo contributors):

cd tools/loop && npm ci && npm test && node dist/cli.js doctor ../..
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.

Examples by Tool

Operating & Safety

Caveats

Loop engineering amplifies judgment — both good and bad.

  • Token costs can explode with sub-agents and long-running loops.
  • Verification is still on you. Unattended loops make unattended mistakes.
  • Comprehension debt grows faster unless you read what the loop ships.
  • Two people can run the same loop and get opposite results. The loop doesn't know. You do.

Addy Osmani:

“Build the loop. But build it like someone who intends to stay the engineer, not just the person who presses go.”

Help wanted

First PR? Pick an open issue below, or Add Adopter / Share a story.

Review SLA: docs, stories, adopters, and small tests — within 48 hours (same-day when possible). See CONTRIBUTORS.md and the contributor quickstart.

good first issue backlog (comment "I'll take this" for assignment). Prefer the live filter if a row below looks stale.

TimeIssueWhat you ship
~10 min#120 — Adopters listOne row in docs/adopters.md (or Add Adopter template)
~15–20 min#118 — Daily Triage story · #173 — Issue Triage story · #119 — PR Babysitter failureHonest stories/ write-up + index row
~40–45 min#388 — Hermes Issue TriageHermes Issue Triage example in examples/hermes/
AnytimeTemplatesAdd Adopter · Share a story
HubsDiscussionsShow your loop · Ask anything

Recently shipped (thanks!): @AIMindCrafter — Windows/CRLF notes (#492), Windsurf Post-Merge Cleanup (#494), Windsurf Changelog Drafter (#495). @pxmpsdev — loop-sync CRLF tests (#496), readiness skill-dedup (#497), append-run-log invalid-JSON (#498), metrics unparseable run_id (#499). @shixi-li — Hermes CI Sweeper example (#500).

Docs/examples triage: @AIMindCrafter co-owns docs/, examples/, and stories/ (see CODEOWNERS + docs/area-owners.md).

Maintainers re-seed the backlog with bash scripts/create-good-first-issues.sh (idempotent; skips existing titles). Prefer live open GFI filter over this table if a row looks stale.

Contributing

Share production patterns, tool mappings, and failure stories. See CONTRIBUTING.md (ladder + setup), Code of Conduct, adopters, and hubs: Show your loop · Ask anything.

We aim to first-respond within 48 hours on external PRs. Start here: good first issue · Help wanted.

Sources

License

MIT


Practical, tool-aware reference for loop engineering, patterns you can clone, checklists you can ship against, and stories that include what broke.

Essay · Showcase · Cobus Greyling

Star History Chart

Static chart (CI-updated daily). Live chart needs a GitHub token — stored in your browser only.

Frequently Asked Questions

What is loop-engineering?

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 10,556 GitHub stars.

Is loop-engineering safe to use?

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.

How do I install loop-engineering?

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).

What programming language is loop-engineering written in?

loop-engineering is primarily written in JavaScript. It is open-source under cobusgreyling on GitHub, so you can review or fork the full source.

Are there alternatives to loop-engineering?

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.

Comments (0)

No comments yet. Be the first to share your thoughts!

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details

claude-code

by anthropics

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.

120,03119,897Shell
AI Agents
View details

Developers Also Liked

Based on votes and bookmarks from developers who liked this skill

ECC

by affaan-m

10

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

242,21936,702JavaScript
AI Agentsai-agentsanthropicclaude-code
View details
15

An agentic skills framework & software development methodology that works.

234,96620,863Shell
AI Agentsai-agentsbrainstorming
View details

n8n

by n8n-io

12

Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

201,88160,308TypeScript
MCP Serversapisai-tools
View details

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

185,94028,768JavaScript
AI Agentsai-agentsanthropicclaude-code
View details

cc-switch

by farion1231

3

A cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Grok Build & Hermes Agent. Only official website: ccswitch.io

128,8688,826Rust
AI Agentsclaude-codeai-tools
View details