Three months ago I closed a talk with that line.
Tonight: what /loop actually is,
how it differs from Codex /goal,
and how to design one that doesn’t just spin.
/loop — four modes, one file that matters
/loop vs Codex /goal
25 years of consulting for enterprise to Fortune 500. On-prem, cloud, AI, security, and development — paid projects in 30+ languages before AI came around.
Sole IT Engineer next to the CEO. Re-developed the platform from 2014–2019 serving 30M+ monthly users, then exited to eBay.
Tasked to fix a critical performance bottleneck. Found a $2M+ accounting error while rewriting the system. Cut monthly job runtime from 2+ hours to 5 minutes.
Rebuilt flash-sale push notification infra for the largest fashion retailer in the US. 10M+ concurrent pushes, delivery cut from 2 days to under 10 minutes.
If you recognize my last name, it’s probably because my grandfather invented the BobbyCar and was the founder of BIG Spielwaren.
Jan–Mar 2026 only. I picked vulnerability research as a hard, noisy, adversarial domain — if the loop pattern held there, it would hold anywhere.
Loop with validation gates beat ad-hoc prompting on the hardest domain I could find.
Separate personas, hard gates, feedback. The CVEs were artifacts of that, not the goal.
Same architecture, different domains: SaaS development, SEO, paid ads, infra automation.
Not security. The mechanism underneath — /loop as a Claude Code primitive.
I didn’t know this would become a thing.
/loop has
four modes
--resume. Also invokable as /proactive per the docs.
/loop 5m check the deploy — cron-scheduled, your prompt fires on every tick.
/loop check whether CI passed — Claude picks the next interval each iteration. 1 min to 1 hour.
/loop alone — runs the built-in maintenance prompt, or .claude/loop.md if you have one.
/loop 30m /review-pr 1234 — re-run a saved skill on a schedule.
/loop 5m check if the deploy at port 3000 returns 200
Tell me when state changes. Stop reading the GitLab UI every two minutes.
/loop 30m /review-pr 1234
A skill that knows how to review the PR. The loop just supplies the cadence. Skills compose; intervals don’t.
/loop check whether CI passed and address review comments
No interval. Claude decides: tight while CI is running, long when the PR goes quiet. Can also exit on its own when the work is “provably complete.”
Esc stops a waiting loop. The 7‑day expiry kills forgotten ones.
.claude/loop.md
is where it gets interesting.
/loop looks for .claude/loop.md (project) then ~/.claude/loop.md (user). First match wins.
loop.md,
iteration N+1 reads the new version. That is the only honest
“self-improvement” mechanism in the primitive.
; .claude/loop.md
Check the `release/next` PR.
If CI is red, pull the failing job log,
diagnose, and push a minimal fix.
If new review comments arrived,
address each one and resolve the thread.
If everything is green and quiet,
say so in one line.
/loop vs Codex
/goal
/loop — Claude Code
Start: /loop [interval] [prompt]. Both args optional.
Rhythm: a clock tick, a dynamic self-paced delay, or whatever your nested skill needs.
Stops: Esc while waiting, or Claude self-ends in dynamic mode.
You design: the interval, the prompt, the exit condition, and what each iteration leaves behind.
Anything where others would reach for OpenClaw, Hermes Agent, or OpenFang. I design it, refine loop.md, and tune it until it’s an autonomous process most of the time.
/goal — Codex CLI
Start: /goal <objective> (up to 4,000 chars).
Rhythm: Codex keeps working toward the objective across the thread.
Manage: /goal to view, /goal pause / resume / clear to control.
You design: one sentence that names the destination.
One-off problems with a clear finish line. “/goal build me a Rust version of Age of Empires 2, called OpenRAge.”
A goal is easy to declare.
A loop is hard to design.
A good loop pays you back forever.
Memory entry, code change, edited loop.md, log line. If iteration N changes nothing, iteration N+1 runs against the same world.
Write to CLAUDE.md, MEMORY.md, the repo, or loop.md itself — not chat scrollback.
The loop fires; the gate (test, lint, HTTP probe, sub-agent review) decides whether the artifact survives. No gate = drift.
Monitor over short intervals
If you can react to an event (a file change, a build log line), do that. Monitor streams output; you avoid polling tokens entirely.
Interval too short for the work. The next iteration starts before the last artifact is ready. You burn tokens on context that hasn’t changed.
No exit criteria. The loop keeps running after the task is done; you trust it to notice. It does not. The 7-day expiry is your safety net, not your design.
Each iteration looks useful in the transcript but writes nothing durable. The loop is busy. The world is the same as it was an hour ago.
/loop is session-scoped.
Know when to reach past it.
--resume. Unexpired tasks come back when you continue the session.
CLAUDE_CODE_DISABLE_CRON=1.
Dynamic /loop watches CI on active branches. If a job goes red, it reads the log, classifies the failure, and either fixes (lint/format) or pings me (real bug). Tight cadence while CI runs, hour-long sleeps when the queue is empty.
/seo-run — the SEO operating loopPulls Search Console + DataForSEO + Grok trends, writes a backlog to .codex/seo-run/, implements one round of evidence-backed changes, commits, pushes, verifies CI/deploy. Each iteration leaves a snapshot artifact the next iteration reads.
/ads-run — cross-channel ads watchdogChecks Meta + Google + X Ads delivery, spend, approvals, conversions. Writes a run report; never silently spends money. Drafts optimizations; I approve the irreversible step.
Spend the design cost once.
Collect the maintenance value
forever.
The prompt is the constant. The world is the variable. Pick the artifact each iteration leaves behind — and you have a loop, not a polling script.