Back to AI guides

Recurring Tasks in Claude Code: The /loop Skill and Desktop Scheduler

Stanley Ulili
Updated on March 23, 2026

Claude Code's /loop skill schedules prompts and slash commands to run on a recurring interval using cron. It is designed for in-session automation during an active development or debugging session. A separate scheduler in the Claude Desktop application handles tasks that need to persist beyond a single session.

Understanding where each tool's scope ends is what determines which one to reach for.

The /loop skill

Basic syntax

 
/loop [interval] <prompt>

The interval is a number followed by a unit character: m for minutes, h for hours, or d for days. The prompt is any natural language instruction or slash command. The minimum interval is one minute, since the underlying mechanism is cron.

Terminal output message explicitly stating "cron's minimum granularity is 1 minute"

Specifying a shorter interval like 30s rounds up to one minute.

Scheduling a task

Running /loop 1m say hello produces a confirmation like this:

Detailed confirmation output after scheduling a task showing the Job name, Cadence, Job ID, and Duration

Output
CronCreate(*/1 * * * * : say hello)
L Scheduled c21d95a0 (Every minute)

● Scheduled! ✔
  - Job: say hello
  - Cadence: Every 1 minute (*/1 * * * *)
  - Job ID: c21d95a0
  - Duration: Recurring tasks auto-expire after 3 days
  - Cancel anytime: CronDelete c21d95a0

The confirmation includes the job name, cadence, a unique job ID used to manage the task, and the expiration notice. The task runs until it is cancelled, the session ends, or the three-day limit is reached.

Time-based scheduling

The /loop skill also accepts natural language time specifications. A prompt like /loop say hello at 6:30pm causes Claude to ask for clarification:

Output
Did you mean:
1. One-shot - Run once at 6:30pm today/tomorrow?
2. Daily recurring - Run every day at 6:30pm?

All times are interpreted using the local machine's time zone, not UTC.

Integrating skills

Any slash command available in Claude Code can be placed inside a /loop. Monitoring a log file during a debugging session is a common use case:

 
/loop 2m tail the last 20 lines of logs/server.log and summarize any new errors

Checking on a long-running background job:

 
/loop 5m check how many items are left in the job queue

Watching for newly assigned issues during triage:

 
/loop 10m check if any new GitHub issues have been assigned to me in the anthropic/claude-code repo

For tasks that do not need advanced reasoning, switching to Haiku reduces cost and latency:

 
/model haiku

Managing active jobs

Running show running cron jobs invokes the CronList tool and displays a table of all scheduled tasks in the current session.

Tabular output from the CronList tool showing Job ID, Schedule, and Prompt for three active cron jobs

Cancelling by job ID:

 
cancel job 79febfa1

Cancelling by description:

 
stop the task that tweets every 3 minutes

Claude identifies the matching job and deletes it.

Limitations

Three-day expiration

Every task created with /loop expires after three days.

Close-up of the terminal line reading "Duration: Recurring tasks auto-expire after 3 days"

This is a deliberate safety feature to prevent forgotten tasks from making API calls indefinitely. It also means /loop is not suitable for monitoring tasks that need to keep running past that window.

Session-only persistence

Scheduled tasks are stored in memory for the current session only. Closing the terminal or ending the Claude Code session (ccq --exit) wipes all active loops immediately. A new session starts with no scheduled jobs. This is fundamentally different from a system cron job, which is written to disk and managed by the operating system.

Jitter

To avoid many instances executing at exactly the same second, a small deterministic offset is added to each task's firing time.

Claude Code documentation page explaining jitter, with bullet points describing its effect on recurring and one-shot tasks

Recurring tasks can have a jitter of up to 10% of their period, capped at 15 minutes. An hourly task might fire anywhere between zero and six minutes past the hour. The offset is derived from the task ID, so it is consistent across runs. For most monitoring and automation tasks this is acceptable, but it rules out /loop for anything requiring precise timing.

Persistent scheduling in the Claude Desktop app

For tasks that need to survive reboots and run indefinitely, the Claude Desktop application has a separate Scheduled tasks feature.

Creating a scheduled task

In the Claude Desktop sidebar, select Scheduled, then click + New task.

Main "Scheduled tasks" screen in the Claude Desktop application showing the "New task" button

The configuration modal provides:

The "New scheduled task" modal showing fields for Name, Description, Prompt, and Frequency

  • Name and description for easy identification
  • Prompt, the core instruction for Claude
  • Frequency: Manual, Hourly, Daily, Weekdays, or Weekly
  • Under More options: model selection (Opus, Sonnet, or Haiku) and a folder to work in

Tasks created here are not subject to the three-day limit and are saved by the application. They run as long as the computer is on and the Claude Desktop app is running in the background.

Code tab vs. Cowork tab

The Scheduled feature exists in both the Code and Cowork tabs of the desktop app with different capabilities.

Tasks scheduled under the Code tab have access to the local filesystem, suitable for tasks that read files, run scripts, or interact with the local environment.

Tasks scheduled under the Cowork tab run in a sandboxed environment without local filesystem access, suited for tasks that fetch from web APIs or summarize online content.

Final thoughts

/loop in the terminal is for short-term, in-session automation. Use it when you want to delegate repetitive manual checks to Claude while you focus on something else during an active work session. The three-day expiration and session-only persistence are appropriate constraints for this scope.

The desktop scheduler is for long-term, persistent automation: daily briefings, weekly reports, or any task that needs to keep running across reboots and beyond the lifespan of a terminal session.

Both tools are documented in the Claude Code documentation.

Got an article suggestion? Let us know
Licensed under CC-BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.