Claude Code Loops in 7 Minutes
Quick Overview
Claude Code introduces the /loop command, a powerful new feature for scheduling recurring tasks for up to three days, which is executed within the current session and automatically stops when the session ends, with options to leverage existing skills like Firecrawl or Gmail.
Key Points: The /loop command allows users to schedule recurring tasks within Claude Code for up to three days at a time. Scheduled tasks are session-scoped, meaning they stop running when the Claude Code session ends or the user closes the terminal. The system automatically rounds up specified intervals to the nearest minute due to cron's minimum granularity (00:01). Users can cancel early scheduled jobs using the natural language command or by referencing the Job ID (e.g., "cancel task that scrapes Hacker News every four hours"). The feature is shown leveraging existing skills, such as using Firecrawl to scrape Hacker News stories every four hours and then emailing a brief summary via a Gmail skill. For more durable automation that survives restarts, users are directed to use GitHub Actions workflows, Desktop scheduled tasks, or scheduling tools outside the current session.
Context: The video demonstrates a new feature in Claude Code, announced via a tweet from Boris Cherny, which introduces the '/loop' command. This command integrates cron-like scheduling capabilities directly into the interactive coding environment, allowing users to automate repetitive tasks using existing skills or natural language prompts.
Detailed Analysis
Claude Code has released the /loop command, enabling users to schedule recurring tasks within the current session for up to three days. This functionality is demonstrated by setting up a task to run every 10 seconds to say "Hello," which successfully executes multiple times before the interval is rounded up to a 1-minute minimum granularity dictated by cron scheduling. A more complex example shows leveraging the Firecrawl skill to scrape Hacker News every four hours, filter for AI/dev stories, scrape full articles, and email a brief summary using the Gmail skill. The scheduling system automatically assigns a Job ID (e.g., ale75204) and includes notes: recurring jobs auto-expire after 3 days, and they are session-scoped, meaning they stop when the Claude session exits. Users can check active tasks with 'cron list' and cancel them using 'cron delete' followed by the Job ID, or simply by stating the cancellation command in natural language. The speaker notes that for tasks requiring persistence across restarts or outside the active session, users should look toward GitHub Actions or Desktop scheduled tasks.