loop-from-task
Skill1 starsChanged 6 months agoMITView on GitHub
Wrap a TaskList task as a /loop. Creates a cron-driven loop whose prompt directs the agent to work on the specified task, and whose stop condition is the task's completion. Use when the user says "loop on task #N", "keep working on this task every X minutes until it's done", or "schedule task #N as a recurring focus".
In this repository16 other files it gives its agents.
- audit-unused-depSkill
- checkpointSkill
- double-checkSkill
- file-adrSkill
- fleetSkill
- fmt-sweepSkill
- forge-mirror-scaffoldSkill
- forgeSkill
- gemini-pullSkill
- loop-healthSkill
- loop-onSkill
- loopSkill
- loopsSkill
- regression-guardSkill
- restoreSkill
- workspace-testsSkill
The file
We split this skill into the rules it gives an agent
9 rules. About 0 are common, 0 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 33
If either positional arg is missing: show TaskList, ask which to loop on and at what cadence.
- Very specific: line 38
Verify the task exists: Call TaskList. If <task-id> isn't present, error out with the current list.
- Very specific: line 41
Verify the task isn't already completed: If status == completed, tell user "task #N is already done — nothing to loop on" and stop.
- Very specific: line 44
Verify no existing loop already wraps this task: Check CronList + ~/.claude/.paused-loops.json for any prompt containing loop-from-task: …
- Very specific: line 89
Simpler alternative: don't try to embed the loop's own ID.
- Very specific: line 118
Don't auto-mark the task in_progress at create time.
- Very specific: line 120
Don't refuse if the task is pending — that's the common case.
- Very specific: line 121
Don't try to be smart about multi-task loops.
- Very specific: line 124
Don't ignore the notes: field — it's how the user injects per-task constraints the generic prompt can't know.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
/loop-from-task — turn a TaskList item into a self-terminating loop
Why this exists
Composing the existing primitives:
TaskListis the durable cross-fire state per CLAUDE.md/loopschedules cron-driven fires- The natural pattern "keep working on task X until it's done" needs glue between them — that's this skill
A loop created via /loop-from-task carries a self-terminating prompt:
each fire checks the task's status, continues work if in_progress
or pending, and /loop-stops itself once completed.
Argument parsing
/loop-from-task <task-id> <interval>
/loop-from-task <task-id> <interval> notes: "<additional context>"<task-id>— TaskList ID (e.g.3). Required.<interval>— same syntax as /loop (5m,1h,30s,2d).notes:— optional additional context appended to the generated prompt (e.g. "stop at 5pm", "PR is blocked on review").
If either positional arg is missing: show TaskList, ask which to
loop on and at what cadence.
Steps
- Verify the task exists. Call
TaskList. If<task-id>isn't present, error out with the current list. - Verify the task isn't already completed. If
status == completed, tell user "task #N is already done — nothing to loop on" and stop. - Verify no existing loop already wraps this task. Check
CronList+~/.claude/.paused-loops.jsonfor any prompt containingloop-from-task: task-<id>(we tag the generated prompt). If found, tell user, don't duplicate. Convert interval to cron (same table as /loop):
Pattern Cron expression Nm(≤59)*/N * * * *Nm(≥60)0 */H * * *(H = N/60)Nh0 */N * * *Nd0 0 */N * *Nsround up to 1m Generate the loop prompt. Template:
/loop-from-task: task-<id> SELF-CHECK FIRST: call TaskList. Find task #<id> ("<subject>"). If task status == completed: → /loop-stop this loop (cron id <self-id-or-placeholder>). Then post a one-line "task #<id> done; loop terminated" and exit. If task status == in_progress: → Continue working on it. Don't restart. Don't fragment progress. If task status == pending: → TaskUpdate status=in_progress, then work on it. If task is blocked (other tasks blockedBy points to it): → Note the blockers in this fire's output; do NOT mark in_progress; wait. <NOTES BLOCK IF PROVIDED> Canary: if you canceled or stopped this loop, you should NOT be seeing this message.The cron-self-id will be substituted in step 6 after CronCreate returns the actual ID (use
<self>as placeholder, then patch the prompt with the real ID via CronDelete + CronCreate cycle — OR accept that the placeholder remains and the agent uses/loopsto find its own ID at fire time).Simpler alternative: don't try to embed the loop's own ID; the agent at fire time uses
/loopsorCronListto discover the cron carrying the matching/loop-from-task: task-<id>tag and stops THAT specific cron. This is what the skill recommends.- CronCreate with the cron expression + prompt + recurring=true.
- Append history event:
{"event":"created","at":"...Z","id":"<new-cron-id>","cron":"...","tag":"loop-from-task","task_id":"<task-id>","label":"task-<id>: <subject first 40 chars>"} - TaskUpdate the task: add metadata
loop_cron_id: <new-cron-id>so future TaskList views show "this task is being looped on by cron X." - Don't execute the prompt now. The first cron fire (in ≤N minutes) is when work begins. This differs from raw /loop which fires immediately — for task-driven loops, we want one clean work-cycle window, not double-firing.
- Confirm to user:
Loop started: cron
<id>fires every<interval>, working on task #<task-id>"<subject>" until completed. Use /loop-stop<id>to cancel manually, /loops to monitor, or just mark the task completed and the loop self-terminates on next fire.
Don't
- Don't auto-mark the task
in_progressat create time. Let the first cron fire decide based on task state. - Don't refuse if the task is
pending— that's the common case. - Don't try to be smart about multi-task loops. One task per loop;
user creates multiple
/loop-from-taskinvocations if they want parallel work. - Don't ignore the
notes:field — it's how the user injects per-task constraints the generic prompt can't know.
See also
/loop— the lower-level cron primitive/loop-stop— manual cancellation (loop-from-task loops also self-terminate, but manual stop still works)/loops— find the cron ID currently looping on task #N
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

