Skip to content
Back to articles

Schedule Recurring Tasks with Claude Code Loop

March 7, 2026ยท7 min readยท1,300 words
Claude CodeAutomationTutorialVideo Summary
Claude Code Loops in 7 Minutes โ€” Developers Digest
Image: Screenshot from YouTube.

Key insights

  • The /loop skill schedules recurring prompts that run automatically while your Claude Code session stays open, for up to three days
  • Loop works with natural language and pairs with other skills like Firecrawl and Slack MCP for automated workflows
  • All scheduled tasks are session-scoped. Close the terminal and they stop. For persistent scheduling, use the desktop app or GitHub Actions
SourceYouTube
Published March 7, 2026
Developers Digest
Developers Digest
Hosts:Developers Digest

This article is a summary of Claude Code Loops in 7 Minutes. Watch the video โ†’

Read this article in norsk


In Brief

Claude Code now has a built-in /loop skill that lets you schedule recurring tasks directly from your terminal. The video from Developers Digest walks through how to set up loops with natural language, combine them with other skills, and manage scheduled jobs. Boris Cherny, Head of Claude Code at Anthropic, describes Loop as "a powerful new way to schedule recurring tasks for up to 3 days at a time."

3 days
maximum loop duration
1 min
minimum interval
3 tools
CronCreate, List, Delete

What you'll learn

  • How to schedule your first recurring task with /loop or natural language
  • How to combine loops with other Claude Code skills for automated workflows
  • The limitations you need to know: session scope, timing offsets, and expiry

What is Loop?

Loop is Claude Code's built-in scheduling system. It evolved from a community technique called "Ralph Wiggums," which was a way to make Claude Code repeatedly check its own work (0:00).

The problem it solves: when you ask Claude Code to do something complex, it sometimes finishes too early or loses track of the goal after several compaction cycles (when the AI condenses earlier conversation to save memory) (0:22). Loop fixes this by scheduling prompts that fire automatically at regular intervals.

Analogy:

Explained simply: Think of Loop like setting a recurring alarm on your phone. Instead of remembering to check on something yourself, the alarm does it for you. The difference is that Loop doesn't just remind you. It actually runs the task. Unlike a phone alarm that works even when the phone is locked, Loop only runs while your Claude Code session is open.


Setting up your first loop

You can schedule a loop in two ways: the /loop slash command, or plain natural language (1:07).

1

Write your prompt with an interval

Tell Claude Code what you want and how often. For example: "Loop every 4 hours, scrape Hacker News for AI stories and email me a summary." You can use /loop 10m check my PR for build failures or just describe what you want in natural language.

2

Review the scheduled task

Claude Code confirms the schedule by showing three things: the prompt it will send at each interval, any notes about the task, and the auto-expiry time (currently 3 days) (1:39).

3

Let it run

The task fires automatically in the background while your session stays open. You can continue working normally. To check your active loops, ask "What scheduled tasks do I have?" and Claude Code will invoke CronList (4:27).


Interval rules and limits

A few things to know about timing:

  • Minimum interval: 1 minute. Anything shorter gets rounded up (1:27).
  • Maximum duration: 3 days. After that, the loop expires automatically (1:47).
  • Scheduling offset: Tasks can fire up to 10% off their set interval. A 4-hour loop might fire at 3 hours 36 minutes or 4 hours 24 minutes. This is intentional: it prevents thousands of users from hitting the API at the exact same moment (5:10).
Analogy:

Explained simply: Imagine a school bell that rings every hour for recess. If every school in the country used the exact same bell schedule, all the kids would flood the playgrounds at the same second. The 10% offset is like each school ringing its bell a few minutes earlier or later so the "playground" (Anthropic's servers) doesn't get overwhelmed. Unlike a real bell schedule, the offset here is random and changes each time.


Practical examples

The video walks through four examples that show what Loop can do.

Auto-fix PRs

"Loop all my PRs, autofix build issues when comments come in, use a Worktree agent to fix them" (0:52). This keeps your pull requests green without lifting a finger.

Slack digest

"Loop every morning, use the Slack MCP to give me a summary of the top posts I was tagged in" (0:57). This uses Model Context Protocol (MCP), a way for Claude Code to connect to external services.

Daily git recap

"Every day at 8 AM, look at my git history and give me a brief update of everything I worked on the day before. Put it on my desktop" (1:51). Claude Code creates a markdown file summarizing yesterday's commits.

Hacker News email automation

The most complex example chains multiple skills together: Firecrawl scrapes the Hacker News front page, filters for AI and development stories, reads the full articles, then sends an email summary via a Gmail CLI skill (3:38).


Managing your loops

Three tools handle everything (5:00):

  • CronCreate creates a new scheduled task
  • CronList shows all active tasks with their IDs, prompts, and expiry times
  • CronDelete cancels a task

You don't need to remember job IDs. Just say "cancel the task that scrapes Hacker News every 4 hours" and Claude Code finds and removes the right one (4:42).

To disable the entire feature, use the --disable-cron flag (5:45).


Checklist: Common pitfalls

  • Session closed unexpectedly? All loops stop when you close the terminal or shut down your computer. This is by design: loops are session-scoped (2:43).
  • Task not firing on time? The 10% offset means your task won't fire at the exact interval you specified. A 4-hour loop scheduled at noon might fire at 12:07 instead (5:10).
  • Need tasks to survive restarts? Loop is not a replacement for traditional cron jobs. For durable scheduling, use the Claude Code desktop app or set up GitHub Actions (6:42).
  • Session too busy? If Claude Code is actively working on a complex task, scheduled prompts may queue until the current work finishes (6:24).

Practical implications

For solo developers

Start with a simple loop like the daily git recap. It takes 30 seconds to set up and gives you a useful summary every morning. Once you're comfortable, try pairing Loop with MCP integrations.

For teams

Loop can monitor shared resources like PR builds or Slack channels. Set up a loop that watches for failing CI builds and auto-fixes them using Worktree agents, so broken builds don't block the team.

For automation enthusiasts

Chain Loop with skills to build simple automations that would normally need their own setup. The Hacker News email example shows how you can go from data source to formatted email without leaving your terminal.


Test yourself

  1. Transfer: How would you use Loop to monitor a production API endpoint and alert you when response times exceed a threshold?
  2. Trade-off: When would you choose Loop over a traditional cron job on your server, and when would the cron job be the better option?
  3. Architecture: Design a Loop-based workflow that keeps a project's documentation in sync with its codebase. What skills would you chain together, and what interval would you choose?

Glossary

TermDefinition
Loop / /loopClaude Code's built-in skill for scheduling recurring prompts within a session.
Cron jobA scheduled task that runs automatically at specified intervals. Named after the Unix cron utility.
Ralph WiggumsA community technique that predated Loop, where Claude Code would repeatedly check and verify its own work.
Compaction cycleWhen Claude Code condenses earlier conversation context to save memory. Can cause the AI to "forget" its original goal.
Session-scopedOnly active while the specific Claude Code terminal session is open. Closing the terminal stops all session-scoped tasks.
MCP (Model Context Protocol)A protocol that lets AI tools connect to external services like Slack, Gmail, or databases.
SkillA reusable command or workflow in Claude Code, invoked with a slash command like /loop.
WorktreeAn isolated copy of a git repository for parallel work. Lets Claude Code fix a bug on one branch without touching your current work.
Scheduling offsetA small random time variation (up to 10% of the interval) added to prevent all users' tasks from hitting the API simultaneously.
FirecrawlA web scraping tool that can be used as a Claude Code skill to extract content from websites.

Sources and resources