Save products you love by clicking the heart icon.
Comprehensive guide to testing Stripe payment integrations — test cards, webhook simulation, checkout flows, edge cases, and CI/CD strategies for bulletproof payment systems.
Production patterns for managing secrets in GitOps workflows: Sealed Secrets, External Secrets Operator, SOPS, and HashiCorp Vault integration with ArgoCD.
Peter Steinberger (PSPDFKit) put it bluntly: "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents." Boris Cherny, who leads Claude Code at Anthropic, operates the same way: "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."
This is loop engineering — replacing yourself as the person who prompts the agent with a small system that finds the work, hands it out, checks it, writes down what is done, and decides the next thing. You define a purpose; the AI iterates until it is complete. The leverage point has moved: from crafting individual prompts to designing the control systems that orchestrate agents over time.
The surprising part is that this is no longer a tooling exercise. A year ago a loop meant a pile of custom bash you maintained forever. Today the building blocks ship inside the products — Codex and Claude Code both have them, in nearly the same shape. Once you notice the shape is the same, you stop arguing about which tool and just design a loop that works no matter which one you happen to be in.
A loop needs five building blocks and one place to remember things. Each one has a job:
| Building block | Job in the loop |
|---|---|
| Automations | Discovery + triage on a cadence |
| Worktrees | Safe parallel execution |
| Skills | Persistent project knowledge |
| Connectors | Reach into real tools (MCP) |
| Sub-agents | Maker / checker split |
| State (6th) | Durable spine outside any conversation |
Automations are what make a loop an actual loop and not a one-off run. A scheduled task, a CI job that keeps running after you close the laptop, a hook that fires at a point in the agent lifecycle — any of them qualifies.
In the Codex app, you create an automation in the Automations tab: pick the project, the prompt it runs, how often, and whether it runs on your local checkout or a background worktree. Runs that find something land in a Triage inbox; runs that find nothing archive themselves. OpenAI uses these internally for daily issue triage, summarizing CI failures, writing commit briefings, and hunting bugs introduced last week.
Claude Code gets to the same place through scheduling and hooks:
/loop 5m /babysit — re-run a prompt on an interval/loop 30m /slack-feedback — poll a channel and react/loop 1h /pr-pruner — clean up stale PRsCherny's own running loops read like a chore list: /loop 5m /babysit, /loop 30m /slack-feedback, /loop /post-merge-sweeper, /loop 1h /pr-pruner. His canonical babysit loop, in longhand: "babysit all my PRs. Auto-fix build issues, and when comments come in, use a worktree agent to fix them."
The second you run more than one agent, files start colliding. Two agents writing the same file is the exact same headache as two engineers committing to the same lines without talking first.
A Git worktree fixes it: a separate working directory on its own branch, sharing the same repository history. One agent's edits literally cannot touch another's checkout.
git worktree, a --worktree flag to open a session in its own checkout, and isolation: worktree on a subagent so each helper gets a fresh checkout that cleans itself upThe mechanical collision goes away, but you are still the ceiling: your review bandwidth decides how many parallel agents you can actually run, not the tool.
A skill is how you stop re-explaining the same project context every session. Both major tools use the same format: a folder with a SKILL.md inside holding instructions and metadata, plus optional scripts, references, and assets.
Two properties make skills work in loops:
$name or /skills, or by itself when a task matches the skill description — which is why a tight, boring description beats a clever oneCherny checks slash commands into .claude/commands/ for every inner-loop workflow he runs many times a day, so both his team and Claude can reuse them.
A loop that can only see the filesystem is a tiny loop. Connectors, built on MCP (Model Context Protocol), let the agent read your issue tracker, query a database, hit a staging API, or drop a message in Slack.
Both Codex and Claude Code speak MCP, so a connector you write for one usually works in the other. Plugins bundle connectors and skills together, so a teammate installs your whole setup in one go instead of rebuilding it from memory.
The usual split in both tools: one agent explores, one implements, one verifies against the spec. Codex defines agents as TOML files in .codex/agents/; Claude Code uses .claude/agents/ and agent teams that pass work between them.
Verification is the single highest-leverage addition to any loop. Cherny: "Give Claude a way to verify its work. If Claude has that feedback loop, it will 2-3x the quality of the final result." The loop runs while you are not watching, so a verifier you actually trust is the only reason you can walk away.
The same principle applies to the stop condition: /goal keeps going until a condition you wrote is actually true — after each turn a fresh, small model checks whether the condition holds. That is the maker/checker split applied to "done" itself: the agent that did the work no longer decides when the work is complete.
Cost note: sub-agents burn more tokens — each one does its own model and tool work. Spend them where a second opinion is worth paying for.
A markdown file, a Linear board, anything that lives outside the single conversation and holds what is done and what is next. It sounds too dumb to matter — and it is the same trick every long-running agent depends on. The model forgets everything between runs, so the memory has to be on disk, not in context. The agent forgets; the repo doesn't.
In a loop, the state file is the spine: it remembers what got tried, what passed, and what is still open, so tomorrow morning's run picks up where today stopped.
Cherny's rule for long-running work: "Every single time Claude makes a mistake, I don't tell it to do it differently. I tell it to write it to the CLAUDE.md, or make a skill, or something. If you can do this, then Claude can just run forever." Note the distinction: CLAUDE.md is context, not enforcement — to hard-block an action you need a PreToolUse hook.
This is where loop engineering meets classic DevOps. The platform — GitOps in particular — becomes the loop's runtime:
Teams at scale already run variations of this today. This is the difference between an agent that says "here is the fix" and a loop that ships the fix, verifies it, and communicates the result.
Osmani is explicit about the risk: token usage patterns can vary wildly depending on whether you are token-rich or token-poor, and loops run while you sleep. Set the guardrails before the loop's first run:
This is the same loop in Codex, Claude Code, or opencode, because the pieces are the same pieces. A morning automation calls a triage skill that reads yesterday's CI failures, the open issues, and recent commits, and writes findings into a markdown file. For each finding worth doing, a thread opens an isolated worktree and sends a subagent to draft the fix; a second subagent reviews the draft against the project skills and existing tests. Connectors open the PR and update the ticket. Anything unhandled lands in the triage inbox. The state file remembers everything, so the next run resumes.
You designed this once. You do not prompt any of those steps.
Cherny reports landing 259 PRs in 30 days — every line written by Claude Code — after uninstalling his IDE in late November 2025. The number is directional: his dramatic scale claims (hundreds of agents, his share of GitHub commits) are worth treating with skepticism, and the often-cited "~4% of public GitHub commits" figure is a third-party SemiAnalysis estimate with no published methodology. But the implementable core is real and available today: /goal, /loop, /schedule, worktrees, agent view, hooks, skills, and CLAUDE.md, wrapped in loops you write and verify.
The practical pattern that survives contact with reality: a small morning loop that summarizes CI failures and drafts fixes saves the day's first hour. The PR review still happens by a human — just over coffee instead of before it.