Start, monitor, and cancel durable multi-agent coding loops via Inngest. Use when the user wants to run autonomous coding workloads, execute a PRD with multiple stories, kick off an AFK coding session, have agents implement features from a plan, or manage running loops. Triggers on "start a coding loop", "run this PRD", "implement these stories", "go AFK and code this", "check loop status", "cancel the loop", "joelclaw loop", or any request for autonomous multi-story code execution.
71
88%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
Passed
No findings from the security scan
Run durable PLANNER→IMPLEMENTOR→REVIEWER→JUDGE coding loops via Inngest. Each story in a PRD gets independently implemented, tested, and judged. Survives crashes. Every step is a traceable Inngest run.
Hard gate: verification comes before loop throughput. If agents cannot prove the work is correct without Joel manually babysitting, do not start an autonomous loop yet. First add the missing reproducible check, browser/control tool, quality rubric, or reusable skill that lets future agents verify their own output.
Source receipt: lauren / @poteto's X article "Loops You Can Trust" (2026-06-24) frames verification as the limiting step: loops without trusted verification compound slop, while reusable skills/tools turn human experience into agent leverage.
After starting a loop, use the loop-nanny skill for monitoring, triage, post-loop cleanup, and knowing when to intervene.
Before joelclaw loop start, confirm every story has:
If this preflight fails, the next task is not "run the loop". The next task is "teach agents to verify this class of work".
# Start a loop
joelclaw loop start --project /path/to/project --prd prd.json --max-retries 2
# Check status
joelclaw loop status [LOOP_ID]
# Cancel
joelclaw loop cancel LOOP_IDThe joelclaw CLI is the primary interface. Run with bun run packages/cli/src/cli.ts loop start ... from the monorepo root.
Create a prd.json in the project root:
{
"title": "Feature Name",
"description": "What we're building",
"stories": [
{
"id": "S1",
"title": "Short title",
"description": "What to implement. Be specific about files, patterns, behavior.",
"acceptance_criteria": [
"Criterion 1 — must be verifiable by automated test",
"Criterion 2 — must be checkable by typecheck/lint"
],
"priority": 1,
"passes": false
}
]
}Story writing tips:
passes flips to true when JUDGE approves; skipped: true added on max retry exhaustionacceptance, acceptanceCriteria) to acceptance_criteria, but malformed stories still fail fast with explicit schema errors — keep PRDs canonical.joelclaw loop start → agent/loop.start event
→ PLANNER reads prd.json, finds next unpassed story
→ IMPLEMENTOR spawns codex/claude/pi, commits changes
→ REVIEWER writes tests from acceptance criteria (independently — does NOT read implementation)
→ JUDGE: all green? → mark passed, next story
failing? → retry with feedback (up to maxRetries)
exhausted? → skip, flag for human review, next story
→ All done → agent/loop.completeCreate a progress.txt in the project root with a ## Codebase Patterns section at the top. This is read by the implementor for project context and appended by the judge after each story. Defends against context loss across fresh agent instances.
## Codebase Patterns
- Runtime: Bun, not Node
- Tests: bun test
- Key files: src/index.ts, src/lib/...
## Progress
(stories will be appended here)~/Code/joelhooks/joelclaw/packages/system-bus/ (monorepo)agent-loop-plan, agent-loop-implement, agent-loop-review, agent-loop-judge, agent-loop-complete, agent-loop-retro~/Code/joelhooks/joelclaw/k8s/publish-system-bus-worker.shjoelclaw functionsjoelclaw runs -cjoelclaw run RUN_IDThe monorepo is the source of truth for loop function code. After loop-related function changes merge, deploy the worker from the monorepo:
~/Code/joelhooks/joelclaw/k8s/publish-system-bus-worker.shkubectl -n joelclaw rollout status deployment/system-bus-worker --timeout=180sjoelclaw refreshAll events carry loopId for tracing. Key events:
| Event | Purpose |
|---|---|
agent/loop.start | Kick off loop (loopId, project, prdPath, maxRetries, maxIterations) |
agent/loop.plan | Planner re-entry (find next story) |
agent/loop.implement | Dispatch to implementor (storyId, tool, attempt, feedback?) |
agent/loop.review | Dispatch to reviewer (storyId, commitSha, attempt) |
agent/loop.judge | Dispatch to judge (testResults, feedback, attempt) |
agent/loop.complete | Loop finished (summary, counts) |
agent/loop.cancel | Stop the loop |
agent/loop.story.pass | Story passed |
agent/loop.story.fail | Story skipped after max retries |
Default: codex for implementation, claude for review. Override per-story via toolAssignments in the start event:
{
"toolAssignments": {
"S1": { "implementor": "claude", "reviewer": "claude" },
"S2": { "implementor": "codex", "reviewer": "pi" }
}
}event.data.project), not {{ }} templatesloop is reserved in CEL — don't use in concurrency key stringscodex exec --help for current invocation flags. Use the configured sandbox and approval policy; do not weaken them as part of task dispatch.k8s/publish-system-bus-worker.sh)open -a OrbStack)/tmp/agent-loop/{loopId}/)Story attempts must be visible through loop status, Inngest runs/events, and canonical OTel. Query with:
joelclaw loop status <loop-id> -v
joelclaw otel search "story-pass|story-retry|story-skip|build-complete" --hours 24The former slog write path is retired. Capture only durable loop decisions or behavior changes in Brain .svx; do not recreate an append-only journal.
| File | Purpose |
|---|---|
~/Code/joelhooks/joelclaw/packages/system-bus/src/inngest/client.ts | Event type definitions |
~/Code/joelhooks/joelclaw/packages/system-bus/src/inngest/functions/agent-loop/utils.ts | PRD parsing, git, cancellation, claim-check |
~/Code/joelhooks/joelclaw/packages/system-bus/src/inngest/functions/agent-loop/plan.ts | PLANNER |
~/Code/joelhooks/joelclaw/packages/system-bus/src/inngest/functions/agent-loop/implement.ts | IMPLEMENTOR |
~/Code/joelhooks/joelclaw/packages/system-bus/src/inngest/functions/agent-loop/review.ts | REVIEWER |
~/Code/joelhooks/joelclaw/packages/system-bus/src/inngest/functions/agent-loop/judge.ts | JUDGE |
~/Code/joelhooks/joelclaw/packages/system-bus/src/serve.ts | Worker registration |
~/Code/joelhooks/joelclaw/packages/cli/src/cli.ts | joelclaw CLI (loop subcommands) |
7094ced
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.