Claude / Advanced · Advanced

← All Advanced pages

Scheduled tasks & /loop

Run a prompt on a repeat or on a clock. /loop and the Cron tools schedule inside a session; /schedule runs detached cloud routines.

GA · updated 2026-11-19

Three mechanisms, split by whether the work needs a session open. For the full picture of when to use which, and the cadence cost math, see Loops & Autonomy.

How you use it day-to-day

  • /loop repeats a prompt or slash command. Lead with an interval (/loop 30m /babysit-prs, units s / m / h / d) or trail it (every 2 hours). Omit the interval to let the model pace itself. Default if you say nothing is about 10 minutes. It is session-scoped: it ends when the session ends.
  • ScheduleWakeup is the engine behind self-paced /loop. You set delaySeconds (1 minute up to 1 hour) and pass the same prompt forward. Short delays while something is in flight, long delays when idle. Watch the cache: 270s stays warm, 1200s and up amortizes the miss, never 300s.
  • Cron tools (CronCreate / CronList / CronDelete) schedule programmatically with standard 5-field cron expressions (*/15 * * * *, wildcards, ranges, steps, lists). Also session-scoped. One-time future runs are supported.
  • /schedule creates cloud routines that run with no session open and survive the session closing. This is the one to reach for when the work must happen whether or not you are around.

Gotchas

  • Session scope is the big divider. /loop and the Cron tools die with the session; /schedule routines do not. If it has to run overnight unattended, it belongs in /schedule.
  • Recurring tasks auto-expire. A safety bound (docs and community cite about 7 days): the task fires one last time, then deletes itself, so a forgotten loop cannot run forever. A session also caps at around 50 scheduled tasks. Verify the exact current numbers in the docs.
  • Define a stop condition. Since 2.1.319 a self-paced /loop ends when a turn finishes without scheduling the next wake-up; it no longer adds a fallback wake-up on its own. Set CLAUDE_CODE_LOOP_KEEPALIVE=1 for the old behavior.
  • Skills with their own tools now stop an unattended run. Since 2.1.325, scheduled tasks and /loop ask before running a skill whose frontmatter declares allowed-tools or hooks. Nobody is there to answer, so the job waits. Add Skill(name) to permissions.allow for each skill a scheduled job runs. The same release changed "Always allow" in Desktop, IDE and SDK hosts, so a scheduled task that leaned on a saved rule can now wait for you too.
  • Prefer a denial to a hang. permissions.denyInsteadOfPrompting (2.1.319) turns any call that would wait on a prompt into a denial and lets the turn carry on. For unattended jobs a denied step you can read in the log beats a run that sits on a prompt until it expires.
  • A detached routine on a paid API spends while you sleep. Put the spending cap in the job.
  • Watch for jobs that stop, not only jobs that fail. A job that quietly stops running writes no error, so no error looks exactly like success. Once you have more than a few, keep one list of everything you schedule and check when each one last finished. The pattern, and an open-source checker for launchd, cron, GitHub Actions and Vercel jobs, is in Silent When Healthy.