Library/Advanced OperatorยทSession 1 of 5

Set it on repeat: loops and routines

30 minSaves $10/mo
Transcript

Hands-Free Operator taught you to start a job and walk away. This session goes further: the job starts itself, on a schedule, and keeps starting itself until you say otherwise. One command, and knowing when not to use it.

Give loop an interval and a prompt and it runs on a fixed schedule. Drop the interval and Claude picks its own delay, between one minute and one hour, printing the reason each pass. Escape clears the pending wakeup.

Four shapes, one command. An interval with a prompt gives you a cron schedule. A prompt alone lets Claude pace itself. A slash command as the prompt re-runs a whole skill. Bare loop runs your own loop file.

Write the loop down in a loop file inside your project. It is plain markdown with no required structure, and edits apply on the next pass. Put the stop condition in the file. A loop with no stopping rule is one you will forget.

You do not need the syntax. Remind me at three, check in forty five minutes, what scheduled tasks do I have, cancel the deploy check job. Fifty tasks per session, your local timezone, recurring ones expire after seven days.

Loop runs on your machine inside an open session. Close the laptop and it stops. If it has to happen while you are asleep, that is a cloud Routine or a desktop scheduled task, never a loop.

Codex has no loop or cron in the command line at all: its scheduled tasks live on the web and cannot touch a folder on your computer. Grok Build ships its own loop, local and session scoped, just like this one.

Before you leave a loop running: the stop condition is written down, the pass only reads, checks and drafts, you have run one pass by hand, and you know which off switch you would reach for.

That is session one. Something is running right now that you are not watching, and you can name exactly what will stop it. Next, one key that reaches every model, without a new account for each provider.

Hands-Free Operator taught you to start a job and walk away. This course starts where that stopped: the job starts itself, on a schedule, and keeps starting itself until you say otherwise. That is one command in Claude Code, and knowing when it is the wrong command matters as much as knowing the syntax.

This is session 1 of Advanced Operator, and it is free. It assumes you already have an agent installed and a permission allowlist you trust.

What you will use

  • Claude Code, where /loop and the built-in scheduler live today
  • A project folder with something actually worth watching: an open pull request, a deploy in flight, a test suite that goes red on its own
  • Notes on Codex and Grok Build in step 7, so you know which of this transfers

Step 1: Run one prompt on a fixed interval

/loop [interval] [prompt] re-runs a prompt while the session stays open. Both parts are optional. Give it both and you get a fixed schedule:

/loop 5m check if the deployment finished and tell me what happened

Claude converts the interval into a cron expression for you. Units are s, m, h, and d. Odd intervals like 7m or 90m round to the nearest clean cron step, so do not expect 7m to mean exactly seven minutes forever. Fixed-interval loops run until you cancel them or they hit their expiry. (Source: https://code.claude.com/docs/en/scheduled-tasks)

Step 2: Let the loop pace itself

Drop the interval and Claude picks the delay:

/loop check whether CI passed and address any review comments

After each pass it chooses a wait between one minute and one hour based on what it just saw, shorter while a build is moving, longer once things go quiet, and it prints the delay and its reason each time. Press Esc to clear the pending wakeup and stop a self-paced loop.

Step 3: Loop a skill, not just a sentence

The prompt can be one of your own slash commands, the ones you saved back in the agent course:

/loop 20m /review-pr 1234

That re-runs the whole skill every twenty minutes. Anything you were going to re-type all afternoon belongs here instead.

Step 4: Write the loop down in loop.md

Run /loop with no interval and no prompt and it runs a maintenance pass: finish unfinished work, tend the branch's pull request, run cleanup. You can replace that with your own file. Claude reads .claude/loop.md in the project, or ~/.claude/loop.md for you personally, and the project file wins when both exist.

/loop

The file is plain markdown with no required structure. It is truncated past 25,000 bytes, and edits take effect on the next iteration, so you can rewrite the instructions while the loop is still running.

A starter, saved as .claude/loop.md:

# Loop instructions

Each pass, in order:

1. Check whether CI on the current branch has finished. If it failed, read the log and fix the cause.
2. Read any new review comments on the open PR and address them in a commit.
3. If the PR is green and every comment is resolved, say so and stop looping.

Stop condition: the PR is green with no unresolved comments, or three passes in a row change nothing.

Write the stop condition into the file. A loop with no stopping rule is a loop you will forget about.

Step 5: Talk to the scheduler in plain English

You do not have to remember any of this as syntax. These all work as ordinary sentences:

remind me at 3pm to push the release branch
in 45 minutes, check whether the integration tests passed
what scheduled tasks do I have?
cancel the deploy check job

Underneath, CronCreate, CronList, and CronDelete do the work. A session can hold up to 50 tasks, times are read in your local timezone, and a deterministic jitter of up to 30 minutes spreads recurring tasks out so they do not all fire at once. Recurring tasks expire seven days after they were created, which is a real safety net: a loop you forget still ends on its own.

If you would rather write the schedule yourself, it is a standard five-field cron expression, minute hour day-of-month month day-of-week:

*/5 * * * *   Every 5 minutes
0 * * * *     Every hour on the hour
0 9 * * *     Every day at 9am local
0 9 * * 1-5   Weekdays at 9am local
30 14 15 3 *  March 15 at 2:30pm local

Step 6: Know when a loop is the wrong tool

/loop runs on your machine, inside an open session. Close the laptop and it stops. Claude Code documents three different tools for recurring work, and picking the wrong one is the usual reason an operator's automation quietly does nothing:

| | Cloud Routines | Desktop scheduled task | /loop | | --- | --- | --- | --- | | Runs on | Anthropic-managed cloud | Your machine | Your machine | | Needs your machine on | No | Yes | Yes | | Needs an open session | No | No | Yes | | Survives a restart | Yes | Yes | Restored on --resume if unexpired | | Reaches your local files | No, it works from a fresh clone | Yes | Yes | | Minimum interval | 1 hour | 1 minute | 1 minute |

Rule of thumb. If it has to happen while you are asleep with the laptop shut, it is a cloud Routine (create one with /schedule) or a Desktop scheduled task, not a loop. If it needs your actual working folder and files, it is a Desktop scheduled task or a loop, never a cloud Routine. If it belongs to the repository rather than to you, a GitHub Actions workflow with a schedule: trigger is the honest home for it. (Source: https://code.claude.com/docs/en/scheduled-tasks)

Step 7: The same idea in Codex and Grok Build

Codex CLI has no built-in loop or cron command. Its Scheduled Tasks are a ChatGPT web and desktop feature: the docs are explicit that the CLI does not provide the management interface, and that web tasks cannot work directly in a folder on your computer. Event-triggered tasks, the ones that fire on a Gmail, Slack, or GitHub event, are web and mobile only, not available in the desktop app, the CLI, or the IDE extension. The one place real cron syntax shows up for Codex is a CI pattern: a GitHub Actions workflow on cron: "0 9 * * 1" that refreshes account auth weekly before the session goes stale. (Source: https://learn.chatgpt.com/docs/automations)

Grok Build ships its own /loop in its slash-command list, and it behaves like Claude Code's: local, session-scoped, gone when the session ends. Do not confuse it with Grok Bot's routines, which are a separate hosted product where a routine tells a bot to run a saved workflow on a schedule. Same word, different machine.

Step 8: Keep the off switch in reach

Two things end a loop that has gone stupid. Press Esc to clear a self-paced wakeup, or ask in plain English: "cancel the deploy check job". And one environment variable turns the whole scheduler off, which stops /loop, the cron tools, and anything already scheduled:

CLAUDE_CODE_DISABLE_CRON=1

Caution. A loop repeats whatever you told it, without a human reading each result. Loop the things that read, check, and draft. Do not loop anything that sends a message, posts, deletes, or spends money. One mistake made forty times before lunch is a different kind of problem from one mistake.

Do this now

  • Start one real loop against something you are genuinely waiting on: /loop 5m check if the deployment finished and tell me what happened, with your own deploy named in the prompt.
  • Write four lines into .claude/loop.md, ending with an explicit stop condition.
  • Set one plain-English reminder, then run "what scheduled tasks do I have?" so you have seen the list once.

You are done when...

You have a loop running right now against a real pull request, deploy, or check, and you can say out loud what will stop it: the stop condition in your loop.md, the Esc key, the plain-English cancel, or the seven-day expiry. You can also name, for one job on your list this week, whether it belongs in /loop, a cloud Routine, a Desktop scheduled task, or GitHub Actions, and why.

Sources: Claude Code scheduled tasks at https://code.claude.com/docs/en/scheduled-tasks; Codex automations at https://learn.chatgpt.com/docs/automations; local fact sheet 2026-09-04-advanced-operator-fact-sheet-v1.md.


Template included: Members get a starter loop.md with a written stop condition, the cron cheat sheet, the plain-English scheduling phrases, and the "which scheduler does this job belong to" decision card. Find it in your member dashboard under Templates.

Want it done for you?

Short on time? Agentic Quarks will implement this end to end, wired into your stack, and hand you the keys.

Implementation engagements from $2,500
The course this session belongs to

What you will build in Advanced Operator

Loops that run themselves, one key across every model, and guardrails you have actually tested

5 sessions, 145 minutes, 1 free.

  1. 01Set it on repeat: loops and routinesFree30 minYou are here
  2. 02One key, many models: OpenRouterMember25 min
  3. 03The platform-native router: Vercel AI GatewayMember30 min
  4. 04Cheap drafts, strong reviewsMember35 min
  5. 05Guardrails for the unattended operatorMember25 min
Browse all courses

One payment, no subscription, and a 14-day money back you trigger yourself from your account page. This course on its own is $99.

Members share their results from this session in the community. See what is included.