A skill is something an agent does once, when asked. A loop is something an agent keeps doing, until it's actually done. If you've already built an Agent Skill — a SKILL.md that reliably handles PR descriptions, release notes, or a recurring review checklist — you're most of the way to a loop already. This guide covers the specific, mechanical steps to get there: what a skill is missing that a loop needs, how to add it, and a worked example end to end.
TL;DR
| Question | Direct answer |
|---|---|
| What's the core difference? | Skill = loaded once per matching task, runs inside a turn. Loop = repeats in cycles until an exit condition is verifiably met |
| What does a skill already have? | A procedure — the reusable steps, usually already the hard part |
| What's a skill missing to become a loop? | An explicit Trigger, a measurable Goal (exit condition), and a Memory/state layer across cycles |
| Does the skill's SKILL.md need rewriting? | Usually no — it becomes the loop's Action or Verification step, mostly unchanged |
| Free tools to help | /generate/skill-md for the skill itself, /generate/agent-loop for the Trigger/Goal/Actions/Verification/Memory breakdown |
| How do I run it? | /loop <interval> <kickoff prompt> in Claude Code for a local, fixed-interval loop; /schedule (research preview) for a persistent cloud routine |
| Where do I publish it? | Skills: /submit or /create/skill, self-serve. Loops: the /loops directory is curated — share yours with explainx.ai to be featured |
The five things a loop has that a skill doesn't
explainx.ai's own agent loop model breaks a loop into five parts. A skill, on its own, typically only supplies one of them:
| Component | What it is | Does your skill already have this? |
|---|---|---|
| Trigger | What starts a cycle — a schedule, a file change, a queue item, a manual command | No — a skill activates when its description matches the current task, which is a semantic match inside a conversation, not a standing trigger |
| Goal | The exit condition — a specific, checkable statement of "done" | Rarely — most skills describe a procedure, not a stopping point |
| Actions | The steps the agent actually takes | Yes — this is the skill's body, largely reusable as-is |
| Verification | How the agent checks its own work before declaring success | Sometimes — well-written skills already include a checklist or test step; this is the piece worth strengthening most |
| Memory | What persists across cycles — state logs, a CLAUDE.md note, a processed-items list | No — a skill is stateless by default; a loop needs to know what it already did |
That table is the whole conversion job: keep the Actions, add the other four.
Step 1: Confirm your skill is actually a good loop candidate
Not every skill should become a loop, and forcing this conversion on the wrong candidate produces an agent that runs forever without ever being sure it's finished — or one that declares victory prematurely because there was no real way to check. Before converting anything, ask:
- Can "done" be checked by a script, a test, or a count — not a vibe? "Tests pass," "the open-PR queue is empty," "lint score above 95," "no items older than 24 hours in the backlog" are all loop-ready. "Does this read well" or "is this the right design" are not — those need a human in the loop, every time, which defeats the point.
- Does the task recur on its own, without you deciding each time it's needed? A skill you invoke deliberately once a sprint is fine as a skill. A task that should just keep happening — triaging new issues, re-running a flaky test suite, sweeping for a specific code pattern after every merge — is what loops are actually for.
- Is the blast radius of a mistake something you can tolerate happening unattended? A loop that opens draft PRs is safer to leave running than one with write access to production data. If the skill's actions are destructive or hard to reverse, keep a human approval step in the loop rather than removing it for the sake of full autonomy.
If your skill passes those three, keep going.
Step 2: Turn the skill's description into an explicit Trigger
A skill's description field in its YAML frontmatter is what an agent uses to decide whether to load it — that's a matching condition, not a schedule. A loop needs a Trigger: a concrete thing that starts a new cycle. Common patterns:
- Fixed interval — "every 30 minutes," "nightly at 2am." This is the simplest trigger and the one to start with.
- Event-based — "when a new PR opens," "when a file in
/incomingchanges." Requires wiring the trigger to something that can actually detect the event (a webhook, a file watcher, a cron job checking a queue). - Manual, but repeatable — you kick it off yourself each time, but the loop itself still runs multiple internal cycles (retries, re-checks) before returning control to you.
For most skill-to-loop conversions, start with a fixed interval. It's the lowest-effort trigger to implement, and it's exactly what Claude Code's /loop command is built for.
Step 3: Turn the skill's procedure into a measurable Goal
This is the step people skip, and it's the one that matters most. A skill's body typically ends when the procedure is complete — it doesn't ask "but is the underlying problem actually solved?" A loop needs that second question answered explicitly, as a Goal the agent can check against, not just a list of steps it finished executing.
Concretely: rewrite "run the release-notes skill" as "the release-notes skill has run, and the CHANGELOG.md diff for this version contains no [unreleased] placeholder entries." The first is a procedure description; the second is a goal a script can verify in one line.
Step 4: Add or strengthen the Verification step
If your skill already includes a checklist or a test run at the end, you're ahead — that becomes the loop's Verification step directly. If it doesn't, this is the highest-leverage addition you can make, because it's what lets the loop run unattended without you reviewing every cycle by hand. Anthropic's own loops guidance, which explainx.ai broke down in detail, makes the same point: verification is what makes a loop trustworthy, not the loop mechanism itself.
A strong verification step for a loop is usually a separate skill — a small, focused SKILL.md whose entire job is "check whether the goal is actually met," run after the action skill, not folded into the same one. Keeping verification separate from action means you can swap or strengthen the check without touching the procedure that does the work.
Step 5: Add a Memory layer
A loop that has no memory of its own past cycles will either redo finished work forever or lose track of partial progress on a multi-cycle task. The lightest-weight version of this is a state file or a running note — a CLAUDE.md section, a small JSON log, or a "processed IDs" list the loop checks before acting on an item again. You don't need a database for most skill-to-loop conversions; a plain-text log the agent reads at the start of each cycle and appends to at the end is usually enough.
Step 6: Generate the structure with explainx.ai's free tools
Once you've thought through the four additions above, explainx.ai's free agent loop generator turns a plain-English description of the workflow into the full structured breakdown — Trigger, Goal, Actions, Verification, and Memory — plus a copy-paste kickoff prompt and a Mermaid.js diagram of the resulting state machine, so you (or a teammate) can audit the loop's logic before running it unattended. If the underlying skill itself still needs writing or cleanup, the free skill.md generator handles that half separately.
Step 7: Run it
Copy the generated kickoff prompt into Claude Code. For a locally-run, fixed-interval loop:
/loop 30m Check the open-PR queue. For each PR without a description,
run the pr-description skill against it. Verify the generated description
mentions the changed files and the linked issue number. Log processed PR
numbers to .loop-memory/pr-descriptions.log and skip anything already logged.
That single kickoff prompt encodes all five components: the interval is the Trigger, "for each PR without a description" plus the verification sentence is the Goal, the skill invocation is the Actions, the "verify" sentence is the Verification, and the log file is the Memory.
/loop re-runs on that interval as long as your session stays open — close the terminal and it stops, which is the right default while you're still trusting the loop's judgment. Once you're confident in it, /schedule (research preview) moves the same pattern to a persistent, cloud-hosted routine that survives your laptop closing.
Worked example: turning a PR-description skill into a nightly loop
To make this concrete, here's the full before/after for a common skill:
Before — the skill alone (one-shot):
SKILL.md: "pr-description" — when the user asks to write a PR description, read the diff, summarize the change, list affected files, and link the related issue if one is referenced in the branch name.
After — the same skill, wrapped as a loop:
| Component | Value |
|---|---|
| Trigger | Every 20 minutes, check for open PRs with no description or a placeholder description |
| Goal | Every open PR has a description mentioning its changed files and, if applicable, a linked issue number |
| Actions | Run the existing pr-description skill against each qualifying PR |
| Verification | A separate verify-pr-description skill checks the generated text actually names at least one changed file and, if the branch name contains an issue number, that the description links it |
| Memory | .loop-memory/pr-descriptions.log — PR numbers already processed this run, so a PR isn't re-written every cycle if the author hasn't pushed new commits |
Nothing about the original pr-description skill changed. All four additions live in the loop wrapper around it.
Checklist
Skill-to-loop conversion checklist
□ Confirm the skill's "done" state can be checked by a script or test, not a vibe
□ Pick a Trigger — start with a fixed interval unless you have a real event source
□ Rewrite the skill's implicit finish line as an explicit, checkable Goal
□ Add or strengthen Verification — ideally as a separate skill from the action
□ Add a Memory layer — a log file is enough to start
□ Run the plain-English workflow through /generate/agent-loop for the structured breakdown + kickoff prompt
□ Test with /loop locally before considering /schedule
□ Set a sane interval — don't poll every minute for something that changes hourly
Honest limitations
- A verification step you can't trust is worse than no loop at all. A loop that "checks" its own work with a step as fuzzy as the original task just runs the same unreliable judgment on repeat, faster and less visible than a human would.
- Not every skill benefits from looping. Rare, judgment-heavy, or genuinely one-off tasks are fine staying skills — converting everything to a loop for its own sake adds token cost and operational surface area without a real payoff.
- Loops need sane intervals. Polling a queue every minute when it only changes hourly wastes tokens for no benefit; match the trigger cadence to how fast the underlying state actually changes.
/loopstops when your session does. If you need a loop that survives closing your laptop, you need/schedule(research preview) or your own hosted equivalent —/loopalone is a local, foreground mechanism.- The
/loopsdirectory is curated, not self-serve, as of this writing. Build and run your loop locally first; if you want it featured publicly, share it with explainx.ai directly rather than expecting an automatic submission flow the way skills have one.
Related on explainx.ai
- How to Build Your First Agent Skill (Step-by-Step)
- AI Agent Loop Architecture: Triggers, Retries, Checkpoints
- Claude Code Loops Official Guide: /goal, /loop, /schedule
- Loop Engineering for Coding Agents: Claude Code Guide
- What Is Loop Engineering for AI Agents?
- What Are Agent Skills? Complete Guide
- Top 10 AI Agent Skills Directories
Free tools referenced in this guide: explainx.ai skill.md generator · explainx.ai agent loop generator · explainx.ai loops directory · explainx.ai skills directory
Product surfaces, generator behavior, and submission flows referenced here reflect explainx.ai's site as of early August 2026 and may change as these tools evolve.
