Contents
- What Are Claude Code Scheduled Tasks?
- How Does /loop Work for Local Monitoring?
- When /loop makes sense
- The catch
- How Do You Set Up /schedule for Cloud Automation?
- Method 1: Web interface (easiest)
- Method 2: Desktop app
- Method 3: CLI
- The prompt is everything
- What's the Difference Between /loop and /schedule?
- What Can You Actually Automate With Scheduled Tasks?
- Real examples I'm running
- What connectors enable
- What Are the Limitations of Claude Code Scheduled Tasks?
- How Do You Write Good Prompts for Scheduled Tasks?
- A prompt that actually works
- How Much Do Scheduled Tasks Cost?
- Frequently Asked Questions
- Do Claude Code scheduled tasks work when my computer is off?
- What's the minimum interval for scheduled tasks?
- Can scheduled tasks create GitHub PRs and commit code?
- How do I debug a scheduled task that isn't working?
- Do scheduled tasks count against my Claude Pro usage limits?
- Key Takeaways
I set up a Claude Code scheduled task that writes two blog posts per week, creates GitHub PRs, and publishes them while I'm making coffee. The whole setup took 8 minutes. Three weeks later, it's published 6 articles without a single manual trigger.
That's not a hypothetical. That's the content pipeline running behind this blog right now.
Claude Code's scheduled tasks, launched March 2026, give you two tools for recurring automation: /loop for short-lived local monitoring, and /schedule for persistent cloud tasks that run even when your laptop is closed. Here's exactly how to set both up and when to use each.
TL;DR: Claude Code's
/schedulecreates persistent cloud tasks that run on Anthropic's infrastructure even when your machine is off, while/loophandles temporary local monitoring for up to 3 days. Scheduled tasks are available on all paid plans ($20/month Pro) and support MCP connectors for Slack, GitHub, and other integrations.
What Are Claude Code Scheduled Tasks?
Scheduled tasks let you write a prompt once and have Claude execute it automatically on a recurring schedule (Claude Code Docs, 2026). Think cron jobs, but instead of shell scripts, you're running a full AI agent with access to your codebase, web search, and connected tools.
There are two flavors:
/loopruns a prompt on repeat during your active session. It's local, temporary, and stops when your session ends or after 3 days max./schedulecreates a persistent task on Anthropic's cloud infrastructure. It runs on a cron schedule regardless of whether your computer is on.
The distinction matters. Using /loop for a task that needs to run tomorrow morning means it won't. Using /schedule for something you need checked every 30 seconds means you can't. The minimum cloud interval is 1 hour.
How Does /loop Work for Local Monitoring?
The /loop command is the simpler option. Type /loop 5m check if the dev server is returning 200 and Claude runs that check every 5 minutes inside your current session (Better Stack Community, 2026).
When I'm testing a deployment, I use /loop to watch error logs in real-time. The command accepts natural language for timing: "every 30 seconds", "5 minutes", "2 hours" all work.
When /loop makes sense
- Monitoring a deployment you just pushed
- Watching test results during a refactoring session
- Polling an API endpoint for status changes
- Running lint checks while you make edits in another file
The catch
/loop is session-bound. Close your terminal, and the loop stops. It has no catch-up behavior. Miss a check, and it's gone. Maximum lifetime is 3 days. For anything that needs to survive beyond your current work session, you want /schedule.
How Do You Set Up /schedule for Cloud Automation?
There are three ways to create a scheduled task, and they all end up in the same place: Anthropic's cloud running your prompt on a cron schedule.
Method 1: Web interface (easiest)
Go to claude.ai/code/scheduled and click "New scheduled task." You'll set a name, paste your prompt, pick a frequency, and choose which MCP connectors to include.
Method 2: Desktop app
Click "Schedule" in the Cowork sidebar, then "+ New task." Same setup flow, just inside the desktop app.
Method 3: CLI
Type /schedule in any Claude Code session. Claude walks you through the setup conversationally, asking what you want done, how often, and which repo to connect.
In my experience, the web interface is fastest for the initial setup. The CLI is better when you're already in a session and want to schedule something you just built.
The prompt is everything
Since the task runs autonomously in the cloud with zero human guidance, your prompt needs to be completely self-contained. A bad prompt like "check the errors" will produce useless results. A good prompt specifies exactly what to do, which files to read, what actions to take, and what success looks like.
Here's the prompt structure I use for every scheduled task:
You are a [role] for [project].
## What to do
1. Read [specific files]
2. [Specific action with clear criteria]
3. Write results to [specific location]
## Rules
- [Constraint 1]
- [Constraint 2]
## What success looks like
- [Measurable outcome]
What's the Difference Between /loop and /schedule?
Here's the comparison that took me a few failed attempts to learn:
| Feature | /loop | /schedule |
|---|---|---|
| Runs where | Your machine (local) | Anthropic cloud |
| Minimum interval | 30 seconds | 1 hour |
| Maximum lifetime | 3 days | Indefinite |
| Survives restart | No | Yes |
| Catch-up on missed runs | No | Yes (last 7 days) |
| MCP connectors | Session tools only | All connected services |
| Cost | Uses session tokens | Uses plan allocation |
| Best for | Active monitoring | Recurring automation |
The catch-up behavior is worth highlighting. If your computer was off when a /schedule task was supposed to fire, it runs one catch-up execution for the most recent missed time and discards older ones (Claude Help Center, 2026). So you won't get 7 duplicate runs after a week-long vacation. Just one.
What Can You Actually Automate With Scheduled Tasks?
Anything you'd type into Claude Code manually, you can schedule. The task gets a full Claude session with access to your repo, web search, and any MCP connectors you've enabled.
Real examples I'm running
Content pipeline (Tuesday/Thursday 10am): Claude picks a topic from a scored queue, researches it via web search, writes a 2,000-word article following my brand voice guidelines, runs a 100-point SEO rubric check, and creates a GitHub PR on my blog repo. Total human input: reviewing the PR before merge.
Performance review (Sunday 9am): Claude reads exported Google Search Console data, calculates reward scores for each article, classifies them into performance quadrants, and writes a report with specific improvement recommendations.
Topic discovery (Monday 8am): Claude searches the web for trending topics in my niche, scores them by demand and competition, checks for overlap with existing content, and adds the best ones to a topic queue.
What connectors enable
MCP connectors extend what scheduled tasks can touch. Connect Slack, and Claude can post daily summaries to a channel. Connect GitHub, and it can create PRs, review code, or triage issues. Connect Google Drive, and it can process documents on a schedule.
All your connected connectors are included by default when you create a task. Remove any the task doesn't need to keep things clean.
Building automations with Claude Code? Inside the AI Automations by Jimi community, members share their exact scheduled task prompts, automation configs, and real results. Get Access →
What Are the Limitations of Claude Code Scheduled Tasks?
These are real constraints I've hit, not theoretical concerns.
Desktop scheduling requires your machine to be on. Tasks created through the Desktop app only run while the app is open and your computer is awake. If it sleeps, the task fires once when it wakes up, not for every missed interval. For reliable scheduling, use the web interface at claude.ai/code/scheduled, which runs on Anthropic's servers.
Tasks consume more quota than chat. A single complex task (file operations, web searches, multiple tool calls) uses significantly more of your plan allocation than regular conversation (Claude Help Center, 2026). On Pro ($20/month), I can comfortably run 3-4 scheduled tasks per day without hitting limits. Heavier usage may need the Max plan ($100/month).
Minimum interval is 1 hour for cloud tasks. You can't schedule something every 5 minutes on the cloud. For high-frequency checks, use /loop locally.
No inter-task state. Each scheduled run starts fresh. It doesn't remember what happened in the last run. Workaround: write state to files in your repo (like a last-run.json) that the next run can read.
Timing isn't precision-guaranteed. Tasks fire "around" the scheduled time, not at the exact second. If you need something at exactly 9:00:00 AM, use a traditional cron job instead. For "run this roughly every morning," scheduled tasks work perfectly.
How Do You Write Good Prompts for Scheduled Tasks?
After running scheduled tasks for three weeks, the pattern I've landed on has four parts:
1. Role and scope. Tell Claude what it is and what project it's working on. "You are a code review agent for the payments-api repo" is better than "review code."
2. Explicit file references. Name the exact files to read. "Read config/rules.json" beats "check the configuration." The agent starts with zero context every run.
3. Decision criteria. "If the error count exceeds 10 in the last hour, create a GitHub issue" gives Claude clear logic to follow. Vague instructions produce vague results.
4. Output location. "Write results to reports/daily-review.md" ensures you can find what the agent did. Without this, the work happens but you might never see it.
A prompt that actually works
You are a dependency audit agent for my-app.
1. Read package.json and check each dependency
for known security vulnerabilities via web search
2. If any HIGH or CRITICAL vulnerabilities found:
- Create a GitHub issue titled "Security: [package] vulnerability"
- Include the CVE number, affected versions, and fix command
3. Write a summary to reports/dependency-audit.md
with date, packages checked, and issues found
If no vulnerabilities found, still update the report
with "All clear" and today's date.
How Much Do Scheduled Tasks Cost?
Scheduled tasks run on your existing Claude plan at no extra charge. But they do consume your usage allocation faster than regular chat.
Claude Pro costs $20/month. Claude Max runs $100-$200/month with higher limits (Anthropic, 2026). On Pro, I've been running 3 recurring tasks (daily + twice weekly + weekly) without issues. That's roughly 10-12 task executions per week.
If you're currently paying for separate API calls through OpenRouter or directly through the Anthropic API, scheduled tasks could replace that spend entirely. I was spending roughly $25/month on API calls for a content automation pipeline. Switching to scheduled tasks on my existing Pro plan brought that incremental cost to $0.
The breakpoint: if you need more than about 15-20 task executions per week with complex prompts, you'll likely want Max.
Frequently Asked Questions
Do Claude Code scheduled tasks work when my computer is off?
Tasks created at claude.ai/code/scheduled run on Anthropic's cloud infrastructure and work regardless of your computer's state. Tasks created through the Desktop app require your machine to be awake and the app open. For reliability, use the web interface (Claude Code Docs, 2026).
What's the minimum interval for scheduled tasks?
For cloud-based /schedule tasks, the minimum is 1 hour. For local /loop tasks, you can go as low as 30 seconds. If you need sub-hourly cloud automation, /loop during active sessions is your option, or combine both approaches (MindStudio, 2026).
Can scheduled tasks create GitHub PRs and commit code?
Yes. If you connect your GitHub repo when creating the task, the agent can read files, write files, create branches, and open PRs using the gh CLI. This is how I run an automated content pipeline that publishes blog posts as PRs for review.
How do I debug a scheduled task that isn't working?
Check the task's run history at claude.ai/code/scheduled. Each run shows the full session log. The most common issues: a vague prompt that Claude interprets differently each run, missing file paths, or a disconnected MCP connector that the task depends on.
Do scheduled tasks count against my Claude Pro usage limits?
Yes. Scheduled tasks consume more of your plan allocation than regular chat because they involve multi-step tool use. On Pro ($20/month), expect to comfortably run 10-15 complex task executions per week (Claude Help Center, 2026).
Key Takeaways
- Use
/loopfor temporary local monitoring (up to 3 days, minimum 30-second intervals) and/schedulefor persistent cloud automation (minimum 1-hour intervals, survives machine restarts) - The prompt is the most important part of any scheduled task. Make it self-contained with explicit file paths, decision criteria, and output locations
- Scheduled tasks run on your existing Claude plan with no extra cost, but consume quota faster than regular chat. Pro handles 10-15 executions/week comfortably
- Create tasks at claude.ai/code/scheduled for reliable cloud execution that doesn't depend on your machine being awake
Want to see scheduled tasks in action on real projects? Inside the AI Automations by Jimi community, I share the exact prompts, workflows, and configs I use to automate content, code reviews, and monitoring with Claude Code. Join the Community →
