| name | description |
|---|---|
loop |
Documents /loop-style recurring reminders and Claude Code's built-in scheduler. In Cursor: /loop [interval] <message> adds a crontab entry (macOS + Linux); one-shot uses background sleep + notify. List/cancel via crontab. In Claude Code: use built-in /loop. Use when the user asks for /loop, scheduled reminders, or recurring prompts. |
When the user asks for a recurring reminder in Cursor (e.g. /loop 5m remind me to stand up or loop every 1m remind me to stand up), do not ask them to use Claude Code. Implement it with crontab so reminders persist across sessions and work on macOS and Linux.
- Interval: leading (
/loop 5m ...) or trailing (... every 2 hours). Units:s,m,h,d. Default if missing: 10 minutes. Cron has 1-minute granularity; round seconds up to 1m. - Message: the reminder text (e.g. "remind me to stand up" → "Stand up").
- Unique ID: generate a short id (e.g. 8 alphanumeric, like
standup5ora1b2c3d4) and use it asCURSOR_LOOP_<id>so the reminder can be listed and cancelled later.
Comment format: Every crontab entry for /loop must end with a structured comment so scheduled tasks can be listed and deleted by id. Use:
# CURSOR_LOOP_<id> | <interval> | <message>
Example: # CURSOR_LOOP_standup5 | 5m | Stand up. The agent parses this to show a tasks table and to remove by id.
| Interval | Cron (minute hour day month dow) |
|---|---|
| 1m | * * * * * |
| 5m | */5 * * * * |
| 15m | */15 * * * * |
| 1h | 0 * * * * |
| 2h | 0 */2 * * * |
| 1d | 0 0 * * * |
For other values: Nm → */N * * * *, Nh → 0 */N * * *. Round to a supported step if needed.
macOS (notification when user is logged in):
( crontab -l 2>/dev/null; echo "CRON_EXPR osascript -e 'display notification \"MESSAGE\" with title \"Reminder\"' # CURSOR_LOOP_ID | INTERVAL | MESSAGE" ) | crontab -Linux (needs notify-send, often from libnotify-bin):
( crontab -l 2>/dev/null; echo "CRON_EXPR DISPLAY=:0 notify-send 'Reminder' 'MESSAGE' # CURSOR_LOOP_ID | INTERVAL | MESSAGE" ) | crontab -- Replace
CRON_EXPRwith the cron expression (5 fields). - Replace
MESSAGEwith the user's message; escape inner single/double quotes for the shell. - Replace
CURSOR_LOOP_IDwith the unique id (e.g.CURSOR_LOOP_standup5). - Replace
INTERVALwith the interval string (e.g.5m,1h) and keepMESSAGEin the comment so the line is parseable when listing.
Detect OS with uname -s (Darwin → macOS, Linux → Linux).
After adding: "Reminder every <interval> added. To remove: crontab -l | grep -v CURSOR_LOOP_<id> | crontab -" or "Cancel with: cancel the <message> reminder."
When the user asks "what scheduled tasks do I have" or "list my reminders":
crontab -l 2>/dev/null | grep CURSOR_LOOP- Each line ends with a comment
# CURSOR_LOOP_<id> | <interval> | <message>. - Parse the comment: split on
|(space-pipe-space) to get id, interval, message. - Display as a table, e.g.:
| ID | Interval | Message |
|---|---|---|
| standup5 | 5m | Stand up |
- For each row, to cancel:
crontab -l | grep -v CURSOR_LOOP_<id> | crontab -(use the ID from the table). - If there are no lines, say "No scheduled tasks."
When the user says "cancel the stand up reminder" or "remove reminder <id>":
crontab -l 2>/dev/null | grep -v CURSOR_LOOP_<id> | crontab -- Use the id from the comment (the part after
CURSOR_LOOP_and before the first|). If the user names the message, find the line whose comment contains that message and use its id.
"Remind me in 30 minutes to ..." or "in 45 minutes ..." cannot use cron (no "run once in N min"). Run in background:
macOS: ( sleep SECONDS && osascript -e 'display notification "MESSAGE" with title "Reminder"' ) &
Linux: ( sleep SECONDS && DISPLAY=:0 notify-send 'Reminder' 'MESSAGE' ) &
Report PID and when it will fire. User can stop with kill <PID>.
On Linux, notify-send is often in the libnotify-bin package. If the user doesn't have it, suggest installing it (e.g. sudo apt install libnotify-bin or equivalent).
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
/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
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
- List:
what scheduled tasks do I have? - Cancel:
cancel the deploy check jobor by task ID
Underlying tools: CronCreate, CronList, CronDelete. Each task has an 8-character ID. Max 50 tasks per session.
- 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.
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 |
CLAUDE_CODE_DISABLE_CRON=1 disables the scheduler; cron tools and /loop become unavailable.
- 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.