What Is Claude Code /loop ― A Session-Scoped Scheduler That Queues Your Next Follow-Up¶
Audience: Developers and DevOps engineers who use Claude Code daily and want to automate monitoring and periodic checks
Key Points¶
- Session-scoped scheduler
/loopis not infinite AI autonomy — it re-triggers Claude at a set interval within the current session - Eliminates follow-up prompts No more manually typing "is the deploy done yet?" every five minutes
- Four automation layers
/loop, Hooks, Desktop Scheduled Tasks, and GitHub Actions each serve a different purpose — knowing the boundaries matters
Not Just a Timer. It Queues Your Next Follow-Up for the AI¶
With /loop in Claude Code, you can now attach recurring check-in tasks to your terminal session: "check again in 5 minutes," "review PRs every 20 minutes," "tell me when the build finishes." Anthropic's changelog lists /loop and cron scheduling tools as additions in v2.1.711.
In one sentence: /loop does not automate Claude's internal work loop — it schedules when to hand Claude the next task. Claude Code already runs an agentic loop of "gather context → execute → verify → repeat"2. /loop is a thin scheduler that periodically restarts that loop from the outside. Understanding this distinction is key.
Syntax ― What Can It Do?¶
The basic form is straightforward:
/loop 5m check if the deployment finished and tell me what happened
/loop ships as a bundled skill that re-executes a prompt or slash command at a set interval3. The interval can appear at the start or end; the default is 10 minutes. Units include s (seconds), m (minutes), h (hours), and d (days), though seconds are rounded to the nearest minute since the underlying engine is cron-based. Odd intervals like 7m or 90m are snapped to the nearest clean interval, and the actual interval is echoed back3.
Notably, you can schedule other slash commands and skills, not just plain text:
/loop 20m /review-pr 1234
/loop check the build every 2 hours
The real value isn't /loop alone — it's that skills and custom commands become periodically invocable building blocks3.
Natural-language one-shot reminders also work:
Remind me to push the release branch at 3 PM
Claude creates a pinned cron expression for a specific time and auto-deletes it after firing3.
Implementation status as of March 2026
While the release notes and docs list /loop as added in v2.1.71, as of March 9, 2026 there are multiple reports on Anthropic's GitHub issues of CLI v2.1.71 returning Unknown skill: loop1. The specification details in this article are based on the official docs, but be aware of potential version discrepancies or incomplete rollout when trying it in practice.
Why It Matters ― Killing the Second and Third Follow-Up Prompts¶
In daily Claude Code usage, the bottleneck is often not the implementation itself but the repetitive check-ins: Is the deploy done? Is CI still red? Any new comments on the PR? Should I retry now?
/loop lets you schedule that next follow-up, so you don't have to type the same check five minutes later. The official docs list deploy monitoring, PR babysitting, and long build verification as primary use cases — which lines up with the design intent3.
This is fundamentally different from "let AI do everything at once." Anthropic's own writing on long-running agent harnesses notes that high-level single-shot instructions tend to cause overreach, context loss, and incomplete exits4. The value of /loop is not infinite autonomy but making small re-evaluation cycles easy to create.
Three Sweet Spots Where /loop Shines¶
1. State Monitoring¶
The best fit: deploys, builds, tests, and backfills — tasks with long wait times and reasonably clear success criteria. Claude checks the current state on each tick, does follow-up if needed, and summarizes the result3.
2. Recurring Workflows¶
Scheduling slash commands like /review-pr or custom skills via /loop turns review, monitoring, and checklist updates into practical recurring workflows3.
3. Lightweight Reminders¶
A natural-language one-shot reminder like "check integration tests in 45 minutes" also works. Claude converts it to a one-shot cron task3.
When NOT to Use /loop¶
/loop is convenient, but it is not a persistent job engine. Mistaking it for one leads to trouble.
Session-Scoped (Volatile)¶
The most critical constraint: scheduled tasks are session-scoped — they live only while the Claude Code process is alive3. Closing the terminal, ending the session, or restarting kills them all. Persistence is zero.
No Catch-Up for Missed Fires¶
If a task's fire time passes while Claude is processing a long request, it fires once when Claude becomes idle. Three missed fires do not queue three executions — it is always at most one3.
Jitter (Timing Offsets)¶
To prevent all sessions from hitting the API at the same instant, fire times include a deterministic offset3. Recurring tasks get up to 10% of the period (capped at 15 minutes). One-shot tasks scheduled at :00 or :30 get up to 90 seconds of pre-fire offset. The offset derives from the task ID, so the same task always has the same offset. To avoid one-shot jitter, use odd minutes like :03 or :17.
3-Day Auto-Expiry¶
Recurring tasks expire automatically 3 days after creation3. This prevents forgotten loops from running forever, but it also makes /loop unsuitable for permanent production monitoring. For anything longer than 3 days, cancel and re-create before expiry, or switch to Desktop Scheduled Tasks.
Other Limits¶
Maximum 50 tasks per session. Setting CLAUDE_CODE_DISABLE_CRON=1 disables the scheduler entirely, making /loop and cron tools unavailable3 — useful for organizational policies that prohibit periodic execution.
In short, /loop makes your current work session slightly smarter. It does not replace SRE monitoring or production CI/CD automation.
/loop vs. Hooks vs. Desktop vs. GitHub Actions¶
The official docs cover each in isolation, so here is a practical comparison:
| Aspect | /loop (CLI) | Hooks | Desktop Scheduled Tasks | GitHub Actions |
|---|---|---|---|---|
| Nature | Judgment-based re-checks | Deterministic, always-run | Clear periodic jobs | Durable CI/CD automation |
| Persistence | Gone when session ends | Persisted in config | Persists while app runs | Cloud-side permanent |
| Trigger | Time interval | Lifecycle events | Specified times | PR / Issue / cron |
| LLM reasoning | Yes (Claude thinks each time) | Shell hooks: No / Prompt-based & agent-based hooks: Yes | Yes (new session each time) | Yes |
| Missed-run catch-up | One fire on idle | N/A (synchronous) | Latest 1 in past 7 days | Managed by GitHub |
| OS support | All | All | macOS / Windows | Any (cloud) |
Hooks5 run automated actions on specific Claude Code lifecycle events. The basic shell hooks are deterministic — Anthropic describes them as "automatic actions that always happen, not things the LLM decides on a whim." Think "always run formatter after save" or "never edit this directory." However, Hooks also include prompt-based and agent-based hooks that do use Claude's model for judgment5. /loop, by contrast, has Claude re-evaluate with full judgment on each tick — its primary purpose is periodic re-assessment rather than event-driven automation.
Desktop Scheduled Tasks6 launch a fresh local session at a specified time, unlike /loop which runs inside an existing CLI session. The Desktop app must be open and the machine awake, but missed runs catch up with the latest one within the past 7 days. "Daily dependency audit at 9 AM" is a better fit for Desktop.
GitHub Actions7 provide repository-driven durable automation — a fundamentally different scope from session-attached /loop. Claude can respond to @claude mentions on PRs and Issues to analyze code, implement changes, and create PRs.
Decision Heuristic — "Is It OK if This Disappears When I Close the Session?"¶
When in doubt, ask one question: is it OK if this disappears when I close the session? Yes → /loop. No → choose Desktop, GitHub Actions, or an external cron based on your persistence requirements.
Writing /loop Prompts That Don't Bite You¶
Instead of a vague "keep an eye on it until it's done," spell out what to check, how to judge, and how far to go on each tick:
/loop 10m check whether the deploy for branch feature/auth has finished.
If it is still running, summarize current status in 3 bullets only.
If it failed, identify the failing step and propose the next command,
but do not execute fixes yet.
If it succeeded, tell me the URL and the commit SHA that was deployed.
This works well because it scopes Claude's role to monitoring, summarizing, and escalating on each iteration. Anthropic's long-running agent harness article makes the same point: for work that spans sessions, incremental progress with recorded state beats trying to do everything in one shot4. The same principle applies to /loop.
Operational Notes for Now¶
The scheduling subsystem is still new. Anthropic's status page reported that Desktop/Cowork Scheduled Tasks were temporarily disabled on March 8, 2026 due to a DST (daylight saving time) transition bug8. While this may not directly affect CLI /loop, it is safer to start with semi-automated "human-in-the-loop" monitoring rather than mission-critical unattended jobs for now.
Summary¶
/loop is not "Claude working forever on its own." It is the feature that transforms Claude Code conversations from one-shot requests into revisitable workflows.
The official docs focus on syntax and constraints, but the real win is elsewhere: eliminating the follow-up prompts humans type every few minutes to check on things.
Start small — deploy monitoring, CI re-checks, periodic PR reviews. From there, factor out responsibilities to skills, Hooks, Desktop Scheduled Tasks, and GitHub Actions. That progression makes Claude Code automation remarkably clean.
Related Articles¶
- Claude Code Autonomous Scheduling Complete Guide
- Claude Code Hooks Complete Guide
- Claude Code Cron Schedule Automation Complete Guide
- Claude Code GitHub Actions
Claude Code Release Notes v2.1.71 (GitHub). Documents the addition of
/loopcommand and cron scheduling tools. https://github.com/anthropics/claude-code/releases ↩↩Claude Code Documentation "How Claude Code works." Explains the agentic loop mechanism. https://code.claude.com/docs/en/how-claude-code-works ↩
Claude Code Documentation "Run prompts on a schedule." Primary source for
/loopsyntax, cron specs, and constraints. https://code.claude.com/docs/en/scheduled-tasks ↩↩↩↩↩↩↩↩↩↩↩↩↩Anthropic Engineering Blog "Effective harnesses for long-running agents." Best practices for long-running agent operations. https://www.anthropic.com/engineering/effective-harnesses-for-long-running-agents ↩↩
Claude Code Documentation "Automate workflows with hooks." Explains the deterministic execution model of Hooks. https://code.claude.com/docs/en/hooks-guide ↩↩
Claude Code Documentation "Use Claude Code Desktop." Desktop Scheduled Tasks specs and missed run catch-up behavior. https://code.claude.com/docs/en/desktop ↩
Claude Code Documentation "Claude Code GitHub Actions." Repository-driven automation. https://code.claude.com/docs/en/github-actions ↩
Anthropic Status Page. March 8, 2026 notice of temporary Scheduled Tasks disablement. https://status.anthropic.com/ ↩