hippo: Claude Code ships with a built-in lightweight cron scheduler. You can have Claude check a deployment every few minutes or remind you to push a branch at 3 PM—all inside your active terminal session. This post breaks down the official doc Run prompts on a schedule.


1. What Are Scheduled Tasks?

Scheduled Tasks is Claude Code’s built-in prompt scheduler. If you have ever used Linux crontab, the mental model is identical: automatically run a prompt on a schedule or at a specific time.

Common use cases:

  • Polling deployment status: Push your code and let Claude check GitHub Actions every 5 minutes instead of watching the tab.
  • Watching a PR: Have Claude periodically check review activity or CI checks on a pull request.
  • Monitoring long builds: Track a slow compile or integration test run while you keep working.
  • One-shot reminders: Set a reminder to wrap up and push code before a 3 PM meeting.

hippo’s note: If you want event-driven alerts like “ping me the moment a deploy fails,” the docs point to Channels—your CI can push failure events straight into the session without polling. Stick to polling when the upstream system has no push mechanism.

Key constraint: tasks are session-scoped. They live inside the running Claude Code process; close the terminal and they are gone. Unlike system crontab (which survives reboots) or GitHub Actions schedule triggers (which run persistently in the cloud), /loop is lightweight, ephemeral scheduling meant for “watch this for me while I’m actively working.”

The official docs compare all three scheduling options side by side:

Feature Cloud Desktop /loop
Runs on Anthropic cloud Your machine Your machine
Requires machine awake No Yes Yes
Requires open session No No Yes
Persists across restarts Yes Yes No (session-scoped)
Local file access No (fresh clone) Yes Yes
MCP servers Per-task connectors Config files & connectors Inherited from current session
Permission prompts No (runs autonomously) Configurable per task Inherited from current session
Custom schedule Via CLI /schedule Yes Yes
Minimum interval 1 hour 1 minute 1 minute

The core tradeoff: Cloud runs on Anthropic’s infrastructure without your machine awake; Desktop needs your machine on, but not an open session; /loop requires the active session to stay open.


2. Official Docs Breakdown

2.1 Recurring Prompts with /loop

/loop is the fastest way to schedule a recurring prompt. Pass an optional interval and a prompt, and Claude registers a background cron job while you keep using the session normally.

Three syntaxes:

1
2
3
4
5
6
7
8
# Option 1: leading interval — put the interval first
/loop 5m check if the deployment finished and tell me what happened

# Option 2: trailing every clause — put the interval at the end
/loop check the build every 2 hours

# Option 3: omitted interval — defaults to every 10 minutes
/loop check the build status

Claude parses the interval into a cron expression, then confirms the cadence and task ID.

Interval syntax reference:

Form Example Parsed schedule
Leading token /loop 30m check the build Every 30 minutes
Trailing every clause /loop check the build every 2 hours Every 2 hours
No interval /loop check the build Every 10 minutes (default)

Supported units are s (seconds), m (minutes), h (hours), and d (days). Seconds round up to the nearest minute because cron’s minimum granularity is one minute. When an interval does not cleanly divide its unit (such as 7m or 90m), Claude rounds to the nearest clean interval and tells you what it chose.

Looping another command or skill:

1
2
# Automatically review a specific PR every 20 minutes
/loop 20m /review-pr 1234

On each trigger, Claude executes /review-pr 1234 just as if you typed it manually—handy for re-running packaged workflows on a cadence.

2.2 Setting One-Shot Reminders

Skip /loop for one-shot reminders—just describe what you want in plain language. Claude creates a single-fire task that deletes itself after running.

1
2
3
4
5
# Option 1: specific time
remind me at 3pm to push the release branch

# Option 2: relative time
in 45 minutes, check whether the integration tests passed

Claude pins the trigger to an exact minute and hour via a cron expression and confirms when it will fire. No manual cron syntax required.

2.3 Managing Tasks (CronCreate / CronList / CronDelete)

You can inspect or cancel tasks in plain language:

1
2
3
4
5
# List all active scheduled tasks
what scheduled tasks do I have?

# Cancel a specific task using natural language
cancel the deploy check job

Under the hood, Claude manages jobs through three tools, which you can also invoke directly:

1
2
3
# Call CronCreate directly for exact cron expression control
# Check CI status every day at 9:07 AM
CronCreate with cron: "7 9 * * *" prompt: "check CI status" recurring: true

Cron tools reference:

Tool Purpose Key parameters
CronCreate Create a new task 5-field cron expression, prompt, recurring flag
CronList List all tasks None; returns task ID, schedule, and prompt
CronDelete Cancel a task 8-character task ID

Each task receives an 8-character ID for cancellation via CronDelete. A single session can hold up to 50 active scheduled tasks.

2.4 Execution Behavior: Timing, Jitter, Timezone, and Expiration

These details determine how Scheduled Tasks behave in practice.

Timezone: All schedules evaluate in your local timezone, not UTC. 0 9 * * * means 9:00 AM local time.

Jitter: To prevent every Claude Code session from hitting the API simultaneously on the minute mark, the scheduler adds a deterministic offset derived from the task ID—so the same task always gets the same offset.

Jitter rules:

Task type Jitter rule Practical example
Recurring tasks Delayed up to 10% of the period, capped at 15 minutes An hourly job may fire anywhere between :00 and :06
One-shot tasks (on the hour / half-hour) Fired up to 90 seconds early A 3:00 reminder may fire as early as 2:58:30
One-shot tasks (off-hour / non-half-hour) No jitter applied A 3:07 reminder fires at 3:07 sharp

If you need an exact fire time, pick a minute other than :00 or :30—for example, 3 9 * * * instead of 0 9 * * *.

7-day expiration: Recurring tasks automatically expire 7 days after creation, firing one final time before deleting themselves. This prevents forgotten loops from running indefinitely. If you need a longer-lived schedule, cancel and recreate it before expiration—or move to Cloud Scheduled Tasks or Desktop Scheduled Tasks.

2.5 Cron Expression Reference

CronCreate accepts standard 5-field cron expressions: minute hour day-of-month month day-of-week.

Every field supports wildcards (*), single values (5), steps (*/15), ranges (1-5), and comma-separated lists (1,15,30).

Cron expression cheatsheet:

Expression Meaning
*/5 * * * * Every 5 minutes
0 * * * * Every hour on the hour
7 * * * * At minute 7 of every hour
0 9 * * * Daily at 9:00 AM local time
0 9 * * 1-5 Weekdays at 9:00 AM local time
30 14 15 3 * March 15 at 2:30 PM local time

In the day-of-week field, 0 or 7 is Sunday and 6 is Saturday.

Unsupported syntax: Extended cron tokens—L (last day), W (nearest weekday), ? (unspecified), and name aliases (MON, JAN)—are not supported. Stick to standard numeric 5-field expressions.

Easy gotcha: When both day-of-month and day-of-week are constrained (for example, 0 9 15 * 1), the schedule matches if either field matches (“the 15th of the month OR every Monday”). That is standard vixie-cron semantics, not a bug.

2.6 Disabling & Inherent Limitations

Disabling the scheduler:

1
2
# Disable the cron scheduler completely
export CLAUDE_CODE_DISABLE_CRON=1

With this set, the cron tools and /loop are unavailable and any existing tasks stop firing.

Three inherent limitations:

  1. Fires only while running and idle: Closing the terminal or exiting the session wipes all tasks.
  2. No catch-up for missed fires: If Claude is busy with a long task and misses scheduled triggers, it fires once when it becomes idle—not once per missed interval.
  3. No persistence across restarts: Restarting Claude Code clears all session-scoped tasks.

For unattended, durable schedules, use Cloud Scheduled Tasks, GitHub Actions schedule triggers, or Desktop Scheduled Tasks instead.


3. Field Notes & Pitfalls

hippo: Real-world usage patterns, surprises, and rules of thumb from using Scheduled Tasks day to day.

Use Case 1: Polling GitHub Actions Builds

Right after pushing to master, I use /loop to watch the pipeline:

1
/loop 5m check the latest GitHub Actions run on master and tell me if it succeeded or failed

I keep coding while Claude checks every 5 minutes and reports the outcome. Once the run finishes, I cancel the job.

Use Case 2: Pre-Meeting Commit Reminder

When I need to push work in progress before an afternoon meeting:

1
remind me 15 minutes before 3pm to commit and push my current changes

Set it once and forget about watching the clock.

Pitfall 1: Confusing Trigger Delays on High-Frequency Jobs

I once set a 1-minute check and wondered why Claude sometimes took several minutes to respond. The reason: scheduled prompts are queued at low priority. If Claude is busy working through a turn (such as analyzing a codebase), the scheduled job waits until the current turn finishes. That is by design, not a bug—just keep in mind that high-frequency loops (like every minute) will effectively run much slower during heavy interactive work.

Pitfall 2: Forgotten Recurring Jobs Quietly Expiring

I set up a daily check expecting it to run indefinitely, only to find it gone a week later—recurring tasks auto-expire after 7 days. That is generous for ad-hoc polling, but not meant for permanent jobs. My rule now is simple: use GitHub Actions schedule triggers for long-running automation, and keep /loop strictly for short-lived session polling.


4. FAQ

Q: Do /loop tasks survive a Claude Code restart?
A: No. All /loop tasks are session-scoped and disappear when you exit or restart. Use GitHub Actions or Cloud Scheduled Tasks for persistent schedules.

Q: How do I avoid jitter when I need an exact trigger time?
A: Avoid :00 and :30. Use 3 9 * * * instead of 0 9 * * * to bypass one-shot jitter completely. Recurring tasks still incur a delay of up to 10% of their period, though the offset is deterministic—the same task always shifts by the same amount.

Q: How many scheduled tasks can I create at once?
A: Up to 50 per session, which is plenty for practical workflows.

Q: Are extended cron tokens like L (last day of month) or W (nearest weekday) supported?
A: No. Only standard 5-field numeric cron expressions (wildcards, single values, steps, ranges, and comma lists) are supported. L, W, ?, MON, JAN, and similar extensions are rejected.

Q: What does “no catch-up for missed fires” mean for recurring tasks?
A: Suppose you schedule a check every 5 minutes, and Claude spends 20 minutes on a long turn. Four triggers were missed during that window, but once Claude goes idle it fires once, not four times back-to-back.


5. Summary

Scheduled Tasks give Claude Code a lightweight, in-session cron engine—/loop for recurring polling, natural language for one-shot reminders, and CronCreate / CronList / CronDelete for direct control. Remember three constraints: tasks are session-scoped (gone on exit), recurring jobs auto-expire after 7 days, and picking an off-hour minute avoids one-shot jitter. For unattended, durable automation, switch to GitHub Actions or Cloud Scheduled Tasks.


Series Navigation


Based on the official Run prompts on a schedule.

Last updated: 2026-04-08