loop-worker

Dispatches periodic background workers using Claude Code native loop scheduling.

70.1k|8.4k|Updated Jun 2, 2025
One-click install
npx skills add https://github.com/ruvnet/claude-flow --skill loop-worker
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: loop-worker
Source: https://github.com/ruvnet/claude-flow/tree/main/plugins/ruflo-loop-workers/skills/loop-worker
Command: npx skills add https://github.com/ruvnet/claude-flow --skill loop-worker

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Running recurring maintenance tasks like security audits, performance optimization, and memory consolidation manually is repetitive and easy to forget. This Skill automates periodic background workers inside a Claude Code session using native /loop scheduling with cache-aware delays.

Core Features & Use Cases

  • Periodic Worker Dispatch: Trigger named workers (audit, optimize, consolidate, predict, map, testgaps, document, benchmark) via the Ruflo MCP worker-dispatch tool.
  • Cache-Aware Scheduling: Computes delays with the formula min(270, cache_ttl * 0.9) to keep the prompt cache warm between iterations.
  • Self-Continuing Loops: Uses ScheduleWakeup to queue the next iteration automatically, following [LOOP_SUGGESTION] and [CRON_SUGGESTION] hints in MCP responses.
  • Use Case: Start the audit worker to run a security analysis every 270 seconds during a long coding session, with each iteration rescheduling itself until the session ends.

Quick Start

Ask the AI to run the audit background worker on a loop so it performs security analysis every 270 seconds during this session.

Frequently Asked Questions about loop-worker

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run periodic background workers in Claude Code?

Use the /loop skill with a worker name to dispatch recurring tasks via the Ruflo MCP worker-dispatch tool. The skill then calls ScheduleWakeup with a delay to queue the next iteration automatically.

What background workers are available in Ruflo loop scheduling?

Eight workers are available: audit, optimize, predict, and testgaps run every 270 seconds, while consolidate, map, document, and benchmark run every 600 seconds. Each handles a specific maintenance task like security analysis or memory consolidation.

How does cache-aware delay scheduling work in Claude Code loops?

The delay is computed as min(270, cache_ttl * 0.9) seconds, defaulting to 270. This keeps the prompt cache warm between iterations so subsequent worker runs reuse cached context instead of reprocessing.

Can I schedule recurring tasks outside an active Claude Code session?

The /loop scheduling works only within an active session using ScheduleWakeup. For persistent scheduling, follow the [CRON_SUGGESTION] hints included in MCP tool responses to set up cron-based execution instead.

Why is my loop worker not continuing to the next iteration?

The loop continues only if ScheduleWakeup is called after each worker dispatch with the correct delaySeconds and reason. Check that the MCP response hints ([LOOP_SUGGESTION]) are being followed after each run.