Skip to content

Instantly share code, notes, and snippets.

@aydinnyunus
Last active March 13, 2026 21:21
Show Gist options
  • Select an option

  • Save aydinnyunus/9d507810e78554e2a18668a3dcfd65a8 to your computer and use it in GitHub Desktop.

Select an option

Save aydinnyunus/9d507810e78554e2a18668a3dcfd65a8 to your computer and use it in GitHub Desktop.
Claude /loop Scheduler
Error in user YAML: (<unknown>): mapping values are not allowed in this context at line 2 column 56
---
name: claude-loop-scheduler
description: Documents Claude Code's built-in scheduler: /loop for recurring prompts, one-time reminders, and cron tools (CronCreate, CronList, CronDelete). Use when the user asks about scheduling prompts, recurring tasks, /loop, reminders, polling deployments, or babysitting builds in Claude Code.
---

Claude Code built-in scheduler

Claude Code can run prompts on a schedule: recurring loops, one-time reminders, or cron-style tasks. Tasks are session-scoped; they stop when you exit. For durable scheduling across restarts, use Desktop scheduled tasks or GitHub Actions.

Source: Run prompts on a schedule

Schedule a recurring prompt with /loop

/loop [interval] <prompt>
  • Interval is optional. Default: every 10 minutes.
  • Leading: /loop 5m check if the deployment finished
  • Trailing: /loop check the build every 2 hours
  • No interval: /loop check the build → every 10 minutes

Units: s (seconds), m (minutes), h (hours), d (days). Seconds round up to the nearest minute (cron granularity). Odd intervals (e.g. 7m, 90m) are rounded; Claude reports what was chosen.

Loop over a command/skill:

/loop 20m /review-pr 1234

One-time reminder

Natural language; single-fire, then the task deletes itself.

remind me at 3pm to push the release branch
in 45 minutes, check whether the integration tests passed

Manage tasks

  • List: what scheduled tasks do I have?
  • Cancel: cancel the deploy check job or by task ID

Underlying tools: CronCreate, CronList, CronDelete. Each task has an 8-character ID. Max 50 tasks per session.

Behavior

  • Scheduler checks every second; enqueues at low priority. Prompts run between your turns, not during a response.
  • Timezone: All times are local (e.g. 0 9 * * * = 9am local).
  • Jitter: Recurring tasks fire up to 10% of period late (capped at 15 min). One-shot at :00/:30 can fire up to 90s early. Use a non-round minute (e.g. 3 9 * * *) if exact timing matters.
  • Expiry: Recurring tasks expire 3 days after creation (one final run, then delete). Recreate or use Desktop/GitHub for longer.

Cron expression (CronCreate)

5-field: minute hour day-of-month month day-of-week. Supports *, steps (*/15), ranges (1-5), lists (1,15,30). Day-of-week: 0/7 = Sunday … 6 = Saturday. No L, W, ?, or name aliases.

Example Meaning
*/5 * * * * Every 5 minutes
0 * * * * Every hour on the hour
0 9 * * * Every day at 9am
0 9 * * 1-5 Weekdays at 9am

Disable

CLAUDE_CODE_DISABLE_CRON=1 disables the scheduler; cron tools and /loop become unavailable.

Limitations

  • Tasks only run while Claude Code is running and idle. Exit = all tasks gone.
  • No catch-up: if Claude was busy, one fire when idle, not one per missed interval.
  • No persistence across restarts.

For unattended cron-style automation, use GitHub Actions schedule or Desktop scheduled tasks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment