Let's Achieve "Working While You Sleep" with Claude Code's /schedule — A Thorough Explanation of the Differences with /loop

2026-03-25
18min read
Updated: 2026-03-27
hf_20260324_221213_bdf0fa19-7ca8-4dd1-8030-baa1be04e27d.webp

Table of Contents

"Check PRs every morning, and if any have been merged, update the documentation."

Wouldn't it be great if you could give Claude instructions like that and just leave it alone?

On March 24, 2026, the /schedule command was added to Claude Code. With it, you can automatically run tasks on a recurring basis on Anthropic's cloud infrastructure. Even with your laptop closed or while you're asleep, Claude will quietly keep working away.

In this article, I'll explain how to use /schedule in detail, while also clarifying the differences from the /loop command that was added recently.

What is /schedule?

/schedule is a command for running Claude Code prompts on a recurring schedule in the cloud.

For example, here's what you can do:

  • Review open PRs every morning at 9am
  • Analyze the cause of a CI failure and output a summary
  • Automatically sync documentation when a PR is merged
  • Run a dependency package check every week

The key point is that it runs in the cloud. There's no need for a local Claude Code session to be running. Tasks are executed on Anthropic's infrastructure, and results can be viewed as sessions at claude.ai/code/scheduled.

Differences from /loop

Claude Code also recently had a /loop command for recurring execution added to it. You're probably wondering, "So what's the difference from /schedule?" Let's compare them.

/loop/schedule
Where it runsLocally (within a CLI session)Cloud (Anthropic infrastructure)
If you close your PCStopsKeeps running
ExpirationAutomatically expires after 3 daysContinues until manually stopped
RepositoryAccesses local filesClones and uses a GitHub repository
External integrationsInherits the session's MCP settingsCan configure MCP connectors (Slack, Linear, etc.) per task
Use casesDeployment monitoring, short-term pollingLong-term recurring tasks, automated workflows
Required planOK with Claude Code CLIPro, Max, Team, Enterprise

Simply put, /loop is for "keep an eye on this for a bit", while /schedule is for "do this every day".

How to use /loop

I've covered /loop in detail in this article: → Run prompts on a recurring schedule with Claude Code! How to use the /loop command and scheduled tasks

Here, let's just cover the key points for comparison with /schedule. /loop is easy to use within a session.

/loop 5m Check if the deployment is complete and let me know the result

This will check every 5 minutes. It's convenient, but it stops when you close the CLI session and automatically expires after 3 days. It's perfect for short-term use cases like "I want to keep an eye on the deployment I'm running right now."

For specifying intervals, you can use s (seconds), m (minutes), h (hours), and d (days). If you omit the interval, it defaults to 10 minutes.

/loop check the build              # Every 10 minutes (default)
/loop 30m check the build          # Every 30 minutes
/loop check the build every 2h     # Every 2 hours (can also be written at the end)

You can also loop other commands and skills.

/loop 20m /review-pr 1234

How to use /schedule

/schedule can be configured interactively from the CLI. For example, to create a task that "reviews PRs every morning at 9am," you'd enter this:

/schedule daily PR review at 9am

Claude will then set up the following items interactively:

  1. Task name and prompt — Write what you want Claude to do. Since it runs autonomously, the trick is to make instructions specific and self-contained
  2. GitHub repository — Select the target repository. It's cloned from the default branch each time
  3. Schedule — Select the execution frequency (hourly, daily, weekdays only, weekly)
  4. Environment settings (optional) — Configure network access, environment variables, and setup scripts
  5. Connectors (optional) — Integration with external services like Slack and Linear

In the Web UI (claude.ai/code/scheduled) or the desktop app, you can configure the same items in a form format. If you don't need environment settings or connectors, it's fine to proceed with the defaults.

Managing schedules

/schedule list      # Display task list
/schedule update    # Edit a task
/schedule run       # Run immediately

From the Web UI, you can also pause, resume, and delete tasks. Execution results are saved as sessions, so you can review what Claude did afterward or create PRs.

Handling branches

By default, Claude can only push to branches with a claude/ prefix. There's no risk of it directly modifying main or develop. You can also lift restrictions per repository if needed.

What can it be used for?

Use cases for development teams

  • Morning PR reviews: Review all open PRs at 9am, leaving comments and summaries
  • Automated CI failure analysis: If CI that ran overnight has failed, analyze the cause and have a report ready by morning
  • Automatic documentation sync: Update related documentation every time a PR is merged
  • Weekly dependency audits: Check dependency packages every Monday and report any security alerts or updates

Use cases for individual developers and freelancers

  • Blog repository proofreading: Proofread draft articles every morning and submit improvement suggestions as PRs
  • Competitor service monitoring: Periodically check competitor repositories and changelogs and summarize changes
  • Codebase health checks: Check technical debt and code quality scores every week and create a report

Notes and best practices

Write prompts specifically

Tasks executed with /schedule run completely autonomously. Since you can't interact with them to make corrections, eliminate ambiguity from your prompts and make success conditions clear.

❌ Review the PRs
✅ Check all open PRs and leave review comments from the perspectives of code quality, security, and test coverage.
   Approve if there are no critical issues.

Use /loop and /schedule appropriately

  • Monitoring work currently in progress/loop (deployment monitoring, waiting for test results)
  • Daily/weekly recurring tasks/schedule (PR reviews, documentation updates)
  • One-time reminders → Natural language (e.g., "Check the test results in 45 minutes")

Be mindful of usage quota consumption

/schedule tasks launch a Claude session in the cloud each time they run, consuming your plan's usage quota. For Pro/Max plans, no additional charges are incurred, but the quota is shared with regular chats and Claude Code. Carelessly setting "run every hour" can reduce the quota available for your regular work, so it's wise to keep the frequency to the minimum necessary.

Summary

To summarize /schedule and /loop:

  • /loop: A lightweight in-session scheduler. Perfect for "keep an eye on this for a bit." Expires after 3 days
  • /schedule: A full-featured cloud-based scheduler. Makes "do this every day" a reality. Keeps running even with your PC closed

With the arrival of /schedule, Claude Code has taken another step forward, evolving from an "interactive coding assistant" to an "autonomously working development team member." The ability to automate routine tasks (PR reviews, documentation updates, security checks, etc.) in particular is a major benefit for both individual developers and teams.

Also, processing that you were doing with the Claude API in n8n might be migrated to this /schedule.

The experience of Claude finishing work while you sleep — this is one of the great purposes of using AI!

Reference links

Share this article

Related Articles