Skip to content
Multilo Docs

Repeat a prompt with /loop

Run a prompt again and again in a chat with /loop: check every 10 minutes, or let the agent decide when to look again until the work is done.

/loop runs a prompt repeatedly in the chat you type it in. Use it to keep checking something until it changes, such as a long export, a file another program writes, or a pull request waiting for review. For tasks that run on a calendar in their own chat, see Scheduled tasks.

How /loop works

Type /loop in the chat box, followed by an optional interval and a prompt. /proactive does the same thing. What you give it decides how the loop runs.

What you typeExampleWhat happens
Interval and prompt/loop 10m check whether export.log says DONEThe prompt runs now, then every 10 minutes.
Prompt only/loop check whether export.log says DONEThe prompt runs now. After each run, the agent picks when to look again.
Nothing, or an interval only/loopThe agent runs your loop file, or a built-in check that keeps your work moving.

The prompt can be a skill, for example /loop 20m /review. Each run sends the text to the agent, and the agent runs the skill if it’s allowed to use it on its own.

Run a prompt on a fixed interval

Put the interval first as one word (5m, 2h, 1d), or at the end as a clause (“every 20 minutes”, “every 2 hours”). The units are s for seconds, m for minutes, h for hours and d for days.

/loop 15m check the build log and tell me if any step failed
/loop summarise new comments in draft.docx every 2 hours
  • What you see: the agent confirms the schedule and its ID, then runs the prompt once straight away.
  • Rounding: schedules work in whole minutes, so seconds round up to a minute. An interval that doesn’t divide evenly, such as 7m or 90m, is rounded to the nearest one that does, and the agent tells you which.
  • “Every” needs a time. In “check every PR”, “every” isn’t an interval, so the loop is self-paced.

Let the agent choose when to check

Leave out the interval, and the agent paces itself. After each run, it decides whether another check is needed and when: from 1 to 60 minutes later, rounded up to the next minute. It checks more often while something is changing and less often when nothing is.

/loop check whether the PDF export in exports/ has finished, then tell me how many pages it has

When the next check depends on an event, such as a command finishing or a line appearing in a log, the agent can watch for it in the background. The event wakes the loop at once, and the timed check becomes a fallback, usually 20 to 30 minutes away. A background command or subagent that finishes wakes the loop the same way.

When the task is done, or can’t make progress, the agent stops the loop itself.

Run a loop with no prompt

/loop on its own runs the first of these files that exists:

  1. .multilo/loop.md in the project
  2. .claude/loop.md in the project
  3. ~/.claude/loop.md in your home folder

Write the file as plain Markdown, as if you were typing the prompt. The agent re-reads it on every run, so an edit takes effect on the next check. It reads up to the first 25,000 bytes.

With no loop file, the agent runs a built-in check instead. It continues unfinished work from the conversation, then looks after the current branch’s pull request: review comments, failed checks and merge conflicts. If nothing needs doing, it says so in one sentence. Every action still goes through the chat’s permission rules.

Add an interval, for example /loop 30m, to run the file or the check on a fixed schedule.

Loops of an hour or more

If the interval is 60 minutes or longer, or you use daily words such as “every morning” or “each night”, the agent first asks: “This loop skips runs while Multilo is closed and ends after 30 days. Set it up as a scheduled task instead so it keeps running?”

ChoiceWhat happens
Scheduled task (recommended)The agent creates a task on the Scheduled page. It has no end date, runs a missed run when Multilo opens, and starts each run in a new chat.
This chat onlyThe loop runs in this chat while Multilo is open, for up to 30 days.

If you chose This chat only with daily words and no interval, nothing is scheduled, because a self-paced loop checks at most an hour apart. Run /loop again with an interval, such as /loop 1d ….

How runs behave

  • Between replies only. If the chat is busy when a check is due, the check waits until the current reply finishes.
  • While Multilo is open. Nothing runs while the app is closed.
  • Spread-out timing. On a fixed interval, each run starts a little after its time, by up to half the interval and at most 30 minutes, so loops made at the same moment don’t all start together. A 5m loop runs every 4 minutes 45 seconds. A one-time task set for :00 or :30 can run up to 90 seconds early. Self-paced checks run on the minute the agent chose.
  • Waiting strip. While a self-paced loop waits, the strip above the message box reads “/loop waiting · next check at …” with the agent’s reason. Click it to see the chat’s background work.
  • Quiet checks fold. When a check finds nothing new, the next check replaces it in the chat. Its line then counts the quiet checks, for example “Resuming /loop wakeup (4:37 PM) · 1 no-op tick since 4:35 PM”. The chat shows the latest check, not a long list of “still waiting” replies.
  • Permissions. Each run uses the chat’s permission mode. In Autopilot, the reviewer checks each new check-in the agent schedules.

Stop a loop

How you stop a loop depends on its kind.

To stopDo this
A self-paced loop that’s waitingIn the empty message box, press Esc. Multilo shows “Pending wakeup cancelled”.
A self-paced loop that’s runningClick Stop. The run stops, and so does the next check.
Any loopAsk the agent, for example “stop the loop” or “cancel task ID”. To see every loop and task in the chat, ask “what’s scheduled?”.

Loops also end on their own:

  • After 30 days. A fixed-interval loop expires 30 days after you create it. A self-paced loop ends 30 days after it started. Run /loop again to keep going.
  • When you quit Multilo. A fixed-interval loop comes back when you open Multilo again and skips the runs it missed. A self-paced loop doesn’t come back; type /loop again.

Settings

These settings are environment variables. Set them in your environment before you open Multilo. The keepalive can also go in the env of your settings file.

SettingDefaultWhat it does
MULTILO_DISABLE_CRON=1OffTurns off scheduling from chat: /loop and the agent’s scheduling tools are hidden.
MULTILO_LOOP_KEEPALIVE=1OffIf a self-paced check ends without scheduling the next one, Multilo schedules one more check 20 minutes later with the same prompt. CLAUDE_CODE_LOOP_KEEPALIVE=1 works too.

The keepalive gives one extra check in a row, not more. If a check ends because of an error from the model provider, Multilo schedules that extra check even with the setting off.

Hooks and loops

UserPromptSubmit hooks run for loop checks and scheduled prompts as well as for messages you type. The hook input has a source field, so a hook can treat them differently:

sourceThe prompt came from
userA message you typed
loop_wakeupA check a self-paced loop scheduled
schedule_wakeupA scheduled task in the chat, including a fixed-interval loop

A hook that blocks the prompt stops that run. Context the hook adds goes to the agent with the prompt.

Before you rely on it

A loop works while you’re away, so check what it did when you come back. The agent can misread a log or a status, and stop too early or keep checking after the work is done. Keep the prompt specific: say what to check, where, and what counts as done. Give a loop only work you’d approve in that chat, since every run acts with the chat’s permissions.

Troubleshoot

ProblemWhat to do
A check didn’t run on timeCheck that Multilo was open and the chat wasn’t busy. Fixed-interval runs can start up to half the interval late, at most 30 minutes.
The loop stopped after a restartSelf-paced loops don’t survive a restart. Type /loop again.
“Wakeup not scheduled. The loop reached its maximum duration”The loop ran for 30 days. Run /loop again.
/loop doesn’t appear in the slash menuScheduling is turned off with MULTILO_DISABLE_CRON=1. Remove the variable and restart Multilo.
Esc didn’t stop a loopEsc and Stop stop self-paced loops. For a fixed-interval loop, ask the agent to cancel it.
A daily loop wasn’t scheduledYou chose This chat only without an interval. Choose Scheduled task, or add an interval such as 1d.
Was this page helpful?