How the New /loop Command Lets Claude Code Automate Tasks for Up to 72 Hours

Claude Code v2.1.71 introduces the /loop command, a session‑level scheduler that lets the AI run recurring or one‑time tasks for up to three days, turning idle waiting periods into automated work while offering flexible time formats, nesting, and clear limitations.

AI Insight Log
AI Insight Log
AI Insight Log
How the New /loop Command Lets Claude Code Automate Tasks for Up to 72 Hours

Claude Code version v2.1.71 adds a new /loop command, a session‑level recurring‑task scheduler that can run for a maximum of 72 hours. The command is entered in a Claude Code terminal and repeatedly executes a given instruction at the interval you specify.

/loop – Core Concept

/loop

acts as a conversation‑level scheduler. It lives only in the current Claude Code session; when the terminal is closed the tasks disappear. The interval you provide is translated into a standard five‑field cron expression with minute‑level precision.

Basic Usage

/loop 5m check if the deployment finished and tell me what happened

This example checks deployment status every five minutes and reports the result. /loop check the build every 2 hours If you omit the interval, Claude defaults to every ten minutes: /loop check the build Supported time abbreviations include 5m, 30m, 2h, or natural‑language descriptions. The system converts them to cron syntax internally.

One‑Time Reminders

In addition to loops, Claude Code can set a single reminder without using /loop:

remind me at 3pm to push the release branch
in 45 minutes, check whether the integration tests passed

The reminder is scheduled, triggers once, and is then removed automatically.

Nesting Commands

You can combine /loop with other commands: /loop 20m /review-pr 1234 This runs a PR review every twenty minutes, effectively giving your code a periodic health check if the appropriate Skill is installed.

Key Limitations

Session‑level only : tasks disappear when the session ends; no persistence or checkpoint‑resume.

Maximum 72 hours : loops expire after three days, run a final time, then self‑delete.

No pre‑emptive execution : a loop waits for Claude to finish the current conversation before running.

No catch‑up : missed executions are not replayed.

Up to 50 tasks per session : sufficient for most short‑term use cases.

Practical Scenarios

Scenario 1 – Monitoring Deployments

/loop 5m check if the deployment finished and tell me what happened

Claude notifies you every five minutes until the deployment succeeds or fails.

Scenario 2 – Babysitting PRs

/loop babysit all my PRs. Auto-fix build issues and when comments come in, use a worktree agent to fix them

Claude continuously watches all PRs, automatically fixing build failures and responding to review comments.

Scenario 3 – Daily Slack Summary

/loop every morning use the Slack MCP to give me a summary of top posts I was tagged in

Each morning Claude pulls @‑mentions from Slack via the MCP connector and generates a summary.

Scenario 4 – Pre‑merge Test Reminder

in 2 hours, remind me to run the full test suite before merging

A one‑time reminder ensures you run the full test suite before merging.

Other v2.1.71 Updates

Fixed long‑session keyboard lock‑up.

Resolved voice‑mode start‑up lag after system sleep.

Addressed /fork plan‑file conflict bug.

Prevented oversized images from crashing the context.

Fixed plugin‑installation overwrite when multiple instances run.

Added customizable voice‑mode key binding voice:pushToTalk and expanded the Bash command whitelist, reducing permission prompts.

How This Differs From Traditional Cron

Traditional cron runs static scripts; /loop runs natural‑language instructions that Claude can adapt to the current context each time it is invoked. This blends AI agent reasoning with familiar scheduling semantics.

Value for Developers

The main benefit is turning idle waiting—deployment, tests, PR reviews—into delegated work that the AI monitors, freeing developers to focus on higher‑value tasks.

Getting Started

Ensure Claude Code is version v2.1.71 or later: claude --version If needed, update: npm update -g @anthropic-ai/claude-code Then type /loop in any session to begin. To disable the scheduler, set the environment variable CLAUDE_CODE_DISABLE_CRON=1.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

automation/loopAI schedulingClaude Codecron alternative
AI Insight Log
Written by

AI Insight Log

Focused on sharing: AI programming | Agents | Tools

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.