agentlytics
Comprehensive analytics dashboard for AI coding agents — Cursor, Windsurf, Claude Code, VS Code Copilot, Zed, Antigravi…
Practical patterns, starters & CLI tools for loop engineering with AI coding agents. Design systems that prompt and orc…
git clone https://github.com/cobusgreyling/loop-engineering.gitcobusgreyling/loop-engineeringStop prompting. Design the loop. Get a score.
# Front door (recommended) — one binary for init + doctor + status npx @cobusgreyling/loop init . --pattern daily-triage --tool grok npx @cobusgreyling/loop doctor . # Same as before (still fully supported — forks need not change) npx @cobusgreyling/loop-init . # Optional: also scaffold a versioned harness (harness-foundry) npx @cobusgreyling/loop init . --with-foundry
loop init (or loop-init) scaffolds skills, state, and budget files, then prints your Loop Ready score and first loop command. loop doctor combines audit + sync + file checks into top-3 next actions. Swap --tool for claude, codex, or opencode. Use --with-foundry when you want the loop as a composable runtime stack. See docs/cli-front-door.md.
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
For developers using Grok, Claude Code, Codex, Cursor, and other AI coding agents.
→ Interactive showcase + pattern picker · Essay · Addy Osmani
| Start here | Description |
|---|---|
| Quickstart (5 min) | loop init → loop doctor → first loop — start here if you just landed |
| CLI front door | Unified @cobusgreyling/loop — old packages stay open |
| Loop Engineering essay | The concept, primitives, and Grok mapping — read for the why |
| Pattern Picker | Which loop to run first — start here if unsure |
| Primitives Matrix | Cross-tool loop primitive mapping — bookmark this |
| Loop Design Checklist | Ship readiness rubric |
| Patterns | 7 production patterns + interactive picker |
| Starters | Clone-and-run kits (Grok, Claude Code, Codex, Opencode) |
| Opencode examples | CLI-first loops: cron/systemd + opencode run, skills, worktrees |
| loop (front door) | Unified CLI — npx @cobusgreyling/loop init | doctor | status | audit | cost · cli-front-door |
| loop-audit | Loop Readiness Score CLI (v1.7 — constraints + governance + Harness Runtime) — npx @cobusgreyling/loop audit . --suggest · also loop-audit |
| loop-init | Scaffold starters + budget/run-log + constraints (v1.5) — npx @cobusgreyling/loop init . --pattern daily-triage --tool grok · also loop-init |
| harness-foundry | Companion runtime: versioned stacks, sessions, traces — npx @cobusgreyling/harness-foundry init --from loop-engineering:daily-triage |
| outerloop | Companion governance: evidence → verdict → answerability |
| loop-cost | Token spend estimator — npx @cobusgreyling/loop-cost |
| loop-sync | Drift detection between STATE.md and LOOP.md — npx @cobusgreyling/loop-sync . |
| loop-context | Stateful memory manager + circuit breaker for long runs — npx @cobusgreyling/loop-context --check --ledger run.json |
| loop-mcp-server | MCP runtime lookup for patterns, skills, state — npx @cobusgreyling/loop-mcp-server |
| loop-worktree | Manage isolated git worktrees per fix attempt — npx @cobusgreyling/loop-worktree create --run-id <id> --pattern <p> |
| loop-gate | Mechanical enforcement of the path denylist + auto-merge allowlist from gate.yaml — npx @cobusgreyling/loop-gate check --action auto-merge --paths <f1,f2,...> |
| loop-sandbox | Ephemeral git worktree isolation + patch capture — npx @cobusgreyling/loop-sandbox run -- <cmd> |
| loop-action | GitHub Composite Action for running loops in CI — uses: cobusgreyling/loop-engineering/tools/loop-action@main |
| Goal Engineering | Companion: loops discover, goals finish — /goal + stack cookbook (npx @cobusgreyling/goal doctor .) |
| Memory Engineering | Companion: stop re-explaining the repo — tiers, budget, Memory Ready score (node tools/memory-init/cli.js .) |
| Fleet Engineering | Companion: govern populations of agents — registry, inbox, Fleet Ready score (npx @cobusgreyling/fleet-init .) |
| Stories | Real wins and honest failures |
memory-engineering → loop-engineering → harness-foundry → outerloop → fleet-engineering
(persist) (patterns) (runtime) (verdict) (population)
| Layer | You get | Start |
|---|---|---|
| Memory | Tiers, recall budget, Memory Ready score | memory-engineering |
| Design (this repo) | Patterns, starters, Loop Ready score | npx @cobusgreyling/loop init . then loop doctor . |
| Runtime | Versioned harness, traces, evolve | npx @cobusgreyling/loop init . --with-foundry or Foundry showcase |
| Govern | Evidence, verdict, answerability | outerloop |
| Fleet | Registry, inbox, budgets, kill switch | npx @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.
| Discussion | Summary |
|---|---|
| Contributor quickstart | Help wanted: open good first issues — comment I'll take this to get assigned · see Help wanted |
| Community update | July 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 notes | v1.5.0 — loop-sync, constraints, MCP server |
| Add your project | Pinned: Loop Ready badge + adopters list |
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
Loading
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.
| 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 | issue-triage | 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 + 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.
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.”
First PR? Pick one open issue below. Stories and adopters get same-day review when possible. See CONTRIBUTORS.md and the contributor quickstart.
11 open good first issues (refreshed 2026-07-29). Comment "I'll take this" for assignment.
| Time | Issue | What you ship |
|---|---|---|
| ~10 min | #120 — Adopters list | One row in docs/adopters.md (or Add Adopter template) |
| ~15–20 min | #118 — Daily Triage story · #173 — Issue Triage story · #119 — PR Babysitter failure · #427 — loop-sandbox story | Honest stories/ write-up + index row |
| ~20–25 min | #425 — MiniMax foundry flags · #426 — worktree lock import | Additive QUICKSTART notes for MiniMax + public loop-worktree/lock |
| ~25–30 min | #424 — loop-swarm QUICKSTART · #428 — budget-negotiator docs | Discoverability for swarm consensus + L3 budget negotiation |
| ~40–45 min | #387 — Hermes CI Sweeper · #388 — Hermes Issue Triage | Fill pattern-coverage gaps in examples/hermes/ |
| Anytime | Templates | Add Adopter · Share a story |
| Hubs | Discussions | Show your loop · Ask anything |
Recently shipped (thanks!): Windsurf examples (#384–#386), loop-action/sandbox/gate QUICKSTART (#389–#391), CI Sweeper story (#392), loop-action hardening (#393/#395).
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.
Share production patterns, tool mappings, and failure stories. See CONTRIBUTING.md (contribution ladder + good first issue backlog), Code of Conduct, adopters, and hubs: Show your loop · Ask anything.
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
Static chart (CI-updated daily). Live chart needs a GitHub token — stored in your browser only.
more like this
Comprehensive analytics dashboard for AI coding agents — Cursor, Windsurf, Claude Code, VS Code Copilot, Zed, Antigravi…
Skill Claude Code de veille tech francophone. Agrège les flux RSS (Journal du Hacker, Human Coders News…) et produit un…
A to-do list that runs your Claude Code agents — capture anywhere, dispatch in parallel, review from your phone.
Arduino library and MATLAB/Simulink API for the AutomationShield Arduino expansion boards for control engineering educa…
search projects, people, and tags