What Is the Claude Code /loop Command? Usage, Polling, and Scheduling Compared
"Tell me when the build finishes." "If CI goes red, fix it." "Watch the deploy every 5 minutes." Handing these stay-glued chores entirely to AI is what the /loop command, added to Claude Code in 2026, makes possible. This beginner guide explains that /loop is a session-scoped scheduler that runs a prompt or slash command repeatedly on an interval you set (or the AI sets), then covers the four ways to use it (① /loop 5m X = fixed cron interval ② /loop X = self-pacing where the AI judges the interval ③ /loop 15m = the built-in maintenance prompt ④ /loop = auto-maintenance), how to write intervals (number + unit s/m/h/d, minimum 1 minute, natural language like "every 2 hours," and you can loop a slash command: /loop 20m /review-pr 1234), the power of self-pacing (shorter waits when active, longer when quiet, between 1 minute and 1 hour, and — unlike plain cron — it auto-ends the loop once it judges the task done), practical recipes (CI/deploy watching, PR babysitting, long-build checks, reminders, branch auto-maintenance), how to stop it and the cautions (Esc to stop, session-scoped so a new conversation clears it, closing the terminal stops it, fixed intervals last up to 7 days, max 50 tasks per session, fires between turns with jitter, local timezone), how to choose among three scheduling features (/loop for in-session monitoring, Desktop scheduled tasks for resident local work, Routines for unattended cloud ops), and loop.md customization plus disabling via CLAUDE_CODE_DISABLE_CRON=1 — all based on the official docs (as of 2026). What /loop changes is the time axis of work you can hand to AI.