
agent-loop
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.
- Installs
- 41
- Last 24h
- —
- Trending rank
- —
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/joelhooks/joelclaw --skill agent-loop- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads agent-loop automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
Agent Loop
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.
Verification Preflight
Before joelclaw loop start, confirm every story has:
- Proof path: exact command, test, browser flow, API readback, screenshot/video, log query, or source inspection the agent can run.
- Quality bar: what "good" means, what failures look like, and which shortcuts are unacceptable.
- Before/after evidence: how the agent captures the broken/old state and proves the fixed/new state.
- Isolation plan: worktree, ports, browser state, app instance, database, or fixture isolation when parallel agents could collide.
- Reusable verifier: if the proof currently lives in a human's head, author a skill/tool first so future agents inherit it.
If this preflight fails, the next task is not "run the loop". The next task is "teach agents to verify this class of work".
Quick Start
# 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_ID
The joelclaw CLI is the primary interface. Run with bun run packages/cli/src/cli.ts loop start ... from the monorepo root.
PRD Format
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:
- Acceptance criteria must be machine-verifiable (tests, typecheck, lint)
- Include the verification method or artifact in the criterion, not just the desired behavior
- If a criterion needs manual taste, first turn that taste into a reusable review checklist, skill, fixture, or tool
- Lower priority number = runs first
- Keep stories small and atomic — one concern per story
- Include file paths in descriptions when possible
passesflips totruewhen JUDGE approves;skipped: trueadded on max retry exhaustion- Runtime preflight normalizes legacy aliases (
acceptance,acceptanceCriteria) toacceptance_criteria, but malformed stories still fail fast with explicit schema errors — keep PRDs canonical.
Pipeline Flow
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.complete
progress.txt
Create 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)
Infrastructure
- Canonical source:
~/Code/joelhooks/joelclaw/packages/system-bus/(monorepo) - Inngest functions:
agent-loop-plan,agent-loop-implement,agent-loop-review,agent-loop-judge,agent-loop-complete,agent-loop-retro - Inngest server: k8s StatefulSet at localhost:8288
- Loop --project target: Use the absolute target project named by the request. The system-bus package owns loop runtime code; it is not every workload’s target.
- Apply worker changes:
~/Code/joelhooks/joelclaw/k8s/publish-system-bus-worker.sh - Verify functions:
joelclaw functions - View runs:
joelclaw runs -c - Inspect a run:
joelclaw run RUN_ID
Single-source deployment flow
The monorepo is the source of truth for loop function code. After loop-related function changes merge, deploy the worker from the monorepo:
- Run
~/Code/joelhooks/joelclaw/k8s/publish-system-bus-worker.sh - Wait for rollout:
kubectl -n joelclaw rollout status deployment/system-bus-worker --timeout=180s - Refresh registration:
joelclaw refresh
Event Schema
All 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 |
Tool Assignment
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" }
}
}
Known Gotchas
- Concurrency keys use CEL expressions (
event.data.project), not{{ }}templates loopis reserved in CEL — don't use in concurrency key strings- Read
codex exec --helpfor current invocation flags. Use the configured sandbox and approval policy; do not weaken them as part of task dispatch. - Worker changes require a k8s deploy (
k8s/publish-system-bus-worker.sh) - Docker must be running for Inngest server (
open -a OrbStack) - Large tool output uses claim-check pattern (written to
/tmp/agent-loop/{loopId}/)
Telemetry and receipts
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 24
The former slog write path is retired. Capture only durable loop decisions or behavior changes in Brain .svx; do not recreate an append-only journal.
Source Files
| 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) |
FAQ
What does the agent-loop skill do?
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.
How do I install agent-loop?
Run npx skills add https://github.com/joelhooks/joelclaw --skill agent-loop in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/agent-loop/ (personal) or .claude/skills/agent-loop/ (project).
Which AI agents can use agent-loop?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is agent-loop safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains agent-loop?
It is published by joelhooks in joelhooks/joelclaw. It has 41 recorded installs.
More from joelhooks/joelclaw
contacts
joelhooks/joelclaw
Add, enrich, and manage contacts in Joel's Vault. Fire the Inngest enrichment pipeline for full multi-source dossiers, or create quick contacts manually. Use when: 'add a contact', 'enrich this person', 'who is X', 'VIP contact', 'update contact', or any task involving the Vault/Contacts directory.
docker-sandbox
joelhooks/joelclaw
Open the skill to read its SKILL.md instructions.
granola
joelhooks/joelclaw
Access and process Granola meeting notes and transcripts via the granola CLI (MCP-backed). Use when pulling meeting data, analyzing transcripts, backfilling meetings, or any task involving Granola meeting content.
k8s
joelhooks/joelclaw
Operate the joelclaw Kubernetes cluster — Talos Linux on Colima (Mac Mini). Deploy services, check health, debug pods, recover from restarts, add ports, manage Helm releases, inspect logs, fix networking. Triggers on: 'kubectl', 'pods', 'deploy to k8s', 'cluster health', 'restart pod', 'helm install', 'talosctl', 'colima', 'nodeport', 'flannel', 'port mapping', 'k8s down', 'cluster not working', 'add a port', 'PVC', 'storage', any k8s/Talos/Colima infrastructure task. Also triggers on service-specific deploy: 'deploy redis', 'redeploy inngest', 'livekit helm', 'pds not responding'.
joel-writing-style
joelhooks/joelclaw
Joel's writing voice and style guide for joelclaw.com content. Use when writing, editing, or reviewing any blog post, essay, book chapter, or prose content for joelclaw.com. Also use when asked to 'write like Joel,' 'match Joel's voice,' 'draft a post,' 'write content for the blog,' or 'review this for voice.' This skill captures Joel's specific writing patterns derived from 90,000 words of published content spanning 2012–2026. Cross-reference with copy-editing and copywriting skills for marketing-specific copy.
Popular ai & agents skills
google-agents-cli-publish
google/agents-cli
This skill should be used when the user wants to "publish an agent", "publish my ADK agent", "register an agent with Gemini", "publish to Gemini" (formerly Gemini Enterprise), or needs guidance on the agents-cli publish gemini command. Also use when the user wants to "manage agents in Agent Registry", "list/update/delete registered agents", or "register an MCP server". Covers ADK vs A2A registration modes, programmatic and interactive usage, flag reference, auto-detection from deployment metadata, Agent Registry fleet management, and troubleshooting. Part of the agents-cli skills suite. Do NOT use for deployment (use google-agents-cli-deploy).
google-agents-cli-eval
google/agents-cli
This skill should be used when the user wants to "run an evaluation", "evaluate my agent", "evaluate my ADK agent", "write an eval dataset", "analyze eval failures", "compare eval results", "optimize agent", or needs guidance on the Gemini platform eval methodology and the Quality Flywheel. Covers eval metrics, dataset schema, LLM-as-judge scoring, and common failure causes. Applies to any agents-cli project, whatever framework the agent is written in. Do NOT use for agent API code patterns (ADK: use google-agents-cli-adk-code), deployment (use google-agents-cli-deploy), or project scaffolding (use google-agents-cli-scaffold).
skill-creator
anthropics/skills
Create new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.
codex-pet
prime-skills/runcomfy-agent-skills
Codex Pet generator on RunComfy. Build a Codex-compatible Codex Pet spritesheet.webp + pet.json from a single reference image, drop it into ${CODEXHOME:-$HOME/.codex}/pets/ / and Codex picks it up as a custom Codex Pet next to the 8 built-ins. This skill produces the exact Codex Pet atlas Codex expects (1536x1872 PNG/WebP, 8 cols x 9 rows, 192x208 cells, 9 animation states — idle, running-right, running-left, waving, jumping, failed, waiting, running, review). Calls OpenAI GPT Image 2 edit ONCE via the local RunComfy CLI as runcomfy run openai/gpt-image-2/edit to produce a canonical Codex Pet pose, then assembles all 9 animation rows programmatically with ImageMagick micro-transforms — no Codex Pro, no $imagegen, no OPENAIAPIKEY required, only RUNCOMFYTOKEN. Triggers on "codex pet", "create codex pet", "make codex pet", "hatch codex pet", "/hatch image", "desktop pet codex", "codex pets", "spritesheet.webp", or any explicit ask to build a custom pet for OpenAI Codex.
full-output-enforcement
leonxlnx/taste-skill
Overrides default LLM truncation behavior. Enforces complete code generation, bans placeholder patterns, and handles token-limit splits cleanly. Apply to any task requiring exhaustive, unabridged output.
executing-plans
obra/superpowers
Use when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available