For months I used my coding agent the same way most people do: write a prompt, read the reply, write the next prompt. I was the loop. I was the thing deciding what came next and noticing when it drifted off course.
Loop engineering is the fix, and I turned it into a Claude Code skill you can run in one command.
Repo: github.com/sxivansx/loop-engineering
Loop engineering is designing the system that prompts the agent for you, instead of prompting it yourself, turn by turn. You define a goal and a stop condition once. The loop then finds the work, does it, verifies it with a separate agent, writes down what happened, and runs again until the goal is met.
It is built from six parts: a trigger, a state file, a discovery step, a maker, a checker, and a stop condition. That is the whole vocabulary. The skill assembles them for you so you are not wiring it together by hand every time.
Install it, then run it with the goal of your loop:
/loop-engineering keep the main branch's CI green
From there it walks the setup and scaffolds a working loop in your repo:
LOOP.md
state file with three living sections, Open
, Done
, and Blocked
. This is the loop's memory between runs, because the model forgets and the file does not..claude/agents/
: a loop-maker
that does one item at a time, and a loop-checker
that independently verifies the work. The checker is the only one allowed to mark something done./loop
for on-demand runs, a scheduled task for unattended ones, or a GitHub Action for CI-side loops.What you end up with:
your-project/
βββ LOOP.md
βββ .claude/
β βββ agents/
β βββ loop-maker.md
β βββ loop-checker.md
βββ (trigger: /loop, a scheduled task, or a GitHub Action)
Nothing with side effects, like a scheduled job, a push, or a deploy, happens without your confirmation.
git clone https://github.com/sxivansx/loop-engineering ~/.claude/skills/loop-engineering
That makes /loop-engineering
available in every project. If you would rather commit it to a single repo, clone it into that repo's .claude/skills/
instead. The folder name becomes the command, so keep it loop-engineering
.
An autonomous loop is also an autonomous way to ship mistakes. So the skill refuses to set one up without these:
Here is the line I kept coming back to while building it. Two people can set up the exact same loop and get opposite results. One uses it to move faster on work they understand. The other uses it to avoid understanding the work at all. The loop does not know the difference. You do.
I wanted to stop being the bottleneck for every step without handing over the judgment that makes the code mine. A loop does that when it is built right. It runs the boring cycles, and I stay the engineer who reads what it shipped and owns it.
If you have been hand-prompting your agent through the same task over and over, this is the thing I wish I had a month ago. Clone it, point it at one annoying recurring job, and keep the guardrails on.
Get it: github.com/sxivansx/loop-engineering
By Shivansh Pandey. The idea of loop engineering was articulated by Peter Steinberger and Boris Cherny, and synthesized by Addy Osmani.