Back to Blog

Claude Code /routines: How Scheduled Cloud Tasks Actually Work

7 min read

Claude Code /routines: How Scheduled Cloud Tasks Actually Work

Anthropic just shipped /routines for Claude Code, and it closes one of the biggest gaps in the product. You can now schedule Claude Code tasks to run automatically in the cloud — no laptop open, no terminal session, no hosting a separate automation on Railway with API fees. Three trigger types are supported: schedule (cron-style), API call (on-demand), and event-based (like GitHub webhooks). Max users get 15 runs per 24 hours, which rules out high-volume automation but covers the personal-assistant use cases most people actually want.

I spent this afternoon building a real routine — daily GitHub trending scraper for AI repos — and I want to walk through exactly how it works, what the gotchas are, and where it fits versus alternatives like n8n.

What Are Claude Code Routines?

Routines are scheduled or triggered Claude Code tasks that run on Anthropic's web infrastructure instead of your machine. They're the fix for the "I wish Claude Code could just do this one thing every day" problem that has been outstanding since Claude Code shipped.

There are three trigger types:

  1. Scheduled — cron-style. "Run every morning at 9:00 AM."
  2. API call — on-demand. Hit an endpoint and the routine fires.
  3. Event-based — responds to external events like GitHub activity.

The critical thing is that routines run on Anthropic's cloud infrastructure, not your laptop. This is the difference between needing a dedicated VPS or an always-on machine versus just clicking a checkbox. It replaces the session-based loops and local cron jobs most people have been hacking together for the last year.

One important caveat: this is not a replacement for heavy-duty automation. Max users get 15 runs per 24 hours. If you're running hundreds of n8n workflows a day, routines are the wrong tool. If you want five or ten small things done automatically for you personally, this is exactly the right tool.

How Do You Create a Routine in Claude Code?

You have two paths: the CLI with /schedule, or the Claude Code desktop app.

Via the CLI: use /schedule and answer the prompts — name, what to do, which GitHub repo the output goes to, cloud environment, and trigger type.

Via the desktop app: open Claude Code desktop, go to the "Scheduled" tab in the left sidebar, click "new task," then "new remote task." Fill out the same fields visually — name, prompt, repo, environment, and trigger.

I prefer the desktop app for the initial setup because it's easier to see what's going on while you're learning. Once you know the flow, the CLI is faster.

Every routine needs a target GitHub repository. Whatever the routine produces has to get written somewhere, and Claude Code uses a GitHub repo as the destination. If you haven't already, connect the GitHub integration in your claude.ai settings — and if you want event-based triggers from GitHub, install the Claude GitHub app too.

What Do You Need Before Running a Routine?

Three things:

  1. A GitHub repo for the output. Create a new one specifically for the routine unless you want it writing into an existing project.
  2. GitHub connector authorized. Settings -> Connectors -> GitHub. If you hit "GitHub access is unauthorized" when you try to run, this is why.
  3. Cloud environment configured. If you're on the Ultra plan, this is probably already done. Otherwise, add a default environment in your Claude settings. You can use the default one for most routines.

The cloud environment is basically the sandbox Claude Code runs inside when it executes remotely. Default works fine for most personal automation — you only need to customize if you have specific tool or dependency requirements.

What's a Real Example of a Claude Code Routine?

Here's the one I actually built: a daily scraper that pulls the top 10 trending GitHub AI repos from the last 7 days, plus the top 5 from the last 30 days, and writes a markdown report with an editor's take.

I've been doing this manually via a Windows API call for a while — dumb, static, just pulls the raw data. Now I'm offloading it to Claude Code, and because it's AI-powered, it can layer in actual analysis on top of the data. That's the real value proposition: not just scheduled execution, but scheduled execution with reasoning.

The prompt I gave it:

Create a routine that calls the GitHub search API, pulls the top 10 trending repos of the last 7 days in AI, checks the top 5 over the last 30 days, evaluates relevance, and writes a markdown file with an editor's take summarizing what's happening in the space.

I had Claude Code open in a separate session write the prompt for me (yes, I used Claude Code to prompt Claude Code — meta, but it works). The key fields to include: name, repository, environment, schedule, prompt.

I set the schedule to 8:00 AM daily, the model to Sonnet 4.6 (don't need Opus for this), and pointed it at the repo I created for it. First run needed a GitHub reauth, then it ran clean.

How Do You Watch a Routine Run in Real Time?

After you trigger a manual test run, Claude Code gives you a link to watch the execution live. You can see the instructions it received, the tool calls it's making, and the final output being written.

My GitHub trending routine wrote a markdown file that looks very different from my old API-only output. Instead of raw data, it opens with an "editor's take" — a quick summary of what's notable in the trending list this week. Then it gives me the top 10 repos with links, followed by the 30-day breakdown. All the links work, all the data is correct. This is the kind of output that would have required a separate LLM processing step in n8n — here it's just baked in.

The run posts directly to the GitHub repo you connected, which means you get a clean version history of every daily run. That alone is worth something for trend tracking.

How Do You Set Up API-Triggered Routines?

API triggers cannot be configured via the CLI. You have to set them up through the web UI at claude.ai/code/routines. The Claude Code docs walk you through the exact steps.

Same applies to GitHub event triggers — web UI only. The docs also list every supported GitHub event, so you can check whether your use case (a new PR, a push, an issue open, etc.) is actually supported before you build.

Remember the 15-runs-per-24-hours cap applies to API triggers too. That rules out some high-frequency use cases, but it's fine for things like "run this whenever I push to a specific branch" or "run this when I hit a webhook from my own dashboard."

Who Should Use Claude Code Routines?

If you have a handful of tasks you wish Claude Code could do every day while you're not at the computer, routines are for you. If you're running production-scale automation with hundreds or thousands of daily executions, keep using n8n or whatever you already have — routines aren't built for that.

Real use cases that fit:

  • Daily trend reports (like my GitHub one).
  • Weekly summary emails triggered on a schedule.
  • Automated PR review or labeling triggered by GitHub events.
  • On-demand data processing triggered by API when you need it.

Use cases that don't fit:

  • High-volume scraping or multi-run workflows.
  • Anything that needs to run more than 15 times per day.
  • Automations that need deep integration with non-GitHub platforms.

For the personal-productivity sweet spot, routines finally let you stop babysitting a terminal for repeatable Claude Code tasks. That's a meaningful improvement.

Frequently Asked Questions

How many Claude Code routines can I run per day?

Max users can run 15 routines per 24 hours as of this release. Anthropic may change that limit, but for now, plan for small-scale personal automation — not high-volume production workflows.

Do Claude Code routines need my laptop to be open?

No. That's the whole point. Routines run on Anthropic's web infrastructure, so they execute whether your machine is on, off, or closed. Output gets written to the GitHub repo you connect to the routine.

Can I trigger a routine from an API call?

Yes. API triggers are one of the three supported types, along with scheduled (cron) and event-based (like GitHub webhooks). API triggers have to be set up through the web UI at claude.ai/code/routines — not the CLI.

What's the difference between a routine and a session-based task?

A session-based Claude Code task requires your terminal to be open and a live session to be running. A routine runs in the cloud on Anthropic's infrastructure on a schedule, API trigger, or event, with no local session needed.

Can routines use Opus, or only Sonnet?

You can pick the model when you set up the routine. I used Sonnet 4.6 for my GitHub trending scraper because it's overkill to use Opus for a data-pull-plus-summary task. For more complex reasoning routines, Opus makes sense.


If you want to go deeper into automating Claude Code workflows, join the free Chase AI community for templates, prompts, and live breakdowns. And if you're serious about building with AI, check out the paid community, Chase AI+, for hands-on guidance on how to make money with AI.