Claude Code Routines: How to Run Automated Tasks Without Leaving Your Computer On
Claude Code's new Routines feature lets you schedule cloud-based tasks that run without your machine. Here's how to set them up and what they can do.
The Problem With Keeping Your Computer On
Most developer automation tools share a quiet assumption: your machine is always running. Run a cron job, a local agent loop, a scheduled script — and suddenly you need a server, a Mac mini left on overnight, or a cloud VM just to keep things ticking.
Claude Code Routines changes that assumption. It’s a feature inside Claude Code that lets you schedule automated AI tasks that run entirely in Anthropic’s cloud infrastructure. Your laptop can be closed. The task still runs.
This article explains what Claude Code Routines are, how they’re different from other scheduling approaches, how to set one up, and what kinds of workflows they’re actually useful for.
What Claude Code Routines Actually Are
Claude Code Routines is a cloud-based scheduling system built directly into Claude Code. Instead of triggering tasks from your local terminal, you define a Routine — a named, scheduled job — and hand it off to Anthropic’s infrastructure to run on a cadence you set.
The key distinction: the execution happens server-side. There’s no requirement for a persistent local process, no daemon keeping your machine awake, and no need to self-host anything.
Each Routine is essentially a combination of:
- A prompt or task definition — what Claude should do when the Routine fires
- A schedule — how often it runs (cron-style or natural language intervals)
- Tool permissions — which capabilities the agent has access to (file system, web, code execution, etc.)
- An output destination — where results go (a file, a message, an API call, etc.)
When the schedule triggers, Anthropic spins up a Claude agent in their cloud, runs the task, delivers the output, and shuts down. You’re billed for the inference. You don’t pay for idle compute.
For more context on how the broader Anthropic infrastructure is evolving to support this kind of always-on agent behavior, see what Anthropic’s managed agents actually do.
How Routines Differ from the /loop Command
Claude Code already had a way to do recurring work: the /loop command. It’s useful inside an active session for repeating a task on an interval while you’re working. But it has a hard constraint — it runs in your session, which means it stops the moment you close Claude Code or your terminal.
The /loop command is session-local. Routines are persistent.
Here’s how they compare:
| Feature | /loop command | Routines |
|---|---|---|
| Runs when terminal is closed | No | Yes |
| Cloud-based execution | No | Yes |
| Persists across sessions | No | Yes |
| Supports cron scheduling | No | Yes |
| Requires local infrastructure | Yes | No |
The /loop command is still useful for in-session repetition — checking test results every few minutes while you’re actively building, for example. But for anything that needs to fire overnight, on a weekly cadence, or independently of your workflow, Routines is the right tool.
If you’re trying to figure out which approach fits your situation, this comparison of Claude Code loop vs scheduled tasks walks through the decision in more detail.
How to Set Up a Claude Code Routine
Setting up a Routine is done through Claude Code’s interface. Here’s the basic flow:
Step 1: Open the Routines Panel
In Claude Code, navigate to the Routines section. This is separate from your regular chat or project interface. You’ll see any existing Routines and an option to create a new one.
Step 2: Define the Task
Write out what you want the agent to do. Be specific. Routines run unattended, so vague instructions produce inconsistent results. A good task definition includes:
- What data to collect or act on
- What to do with it (summarize, transform, write to file, send a request, etc.)
- What a successful run looks like
- Any edge cases to handle gracefully
Example of a weak task definition:
“Check my GitHub repos and report anything interesting.”
Example of a stronger one:
“Fetch open pull requests across repos in the
acme-orgGitHub organization. For any PRs that have been open more than 3 days with no reviewer activity, write a summary to/reports/stale-prs.mdlisting the PR title, author, and days open.”
Step 3: Set the Schedule
You can use cron syntax (0 9 * * 1-5 for weekdays at 9am) or natural language intervals that Claude Code interprets. Available cadences include:
- Every N minutes/hours
- Daily at a specific time
- Weekly on specific days
- Custom cron expressions
Step 4: Configure Tool Access
Decide which tools the Routine’s agent can use. Options typically include:
- File system access (read/write within your project)
- Web fetch and browser automation
- Code execution
- External API calls
- Git operations
Limit tool access to what the task actually needs. Broad permissions on an unattended agent is a recipe for unexpected side effects.
Step 5: Set an Output Destination
Where should results go? Common options:
- Write to a file in your project directory
- Post to a webhook or API endpoint
- Send a notification
- Update a database or external service
Step 6: Test Before Activating
Run the Routine manually once before enabling the schedule. Verify the output matches what you expected. Fix any issues with the prompt or tool configuration before handing it off to run unattended.
What Routines Can Actually Do
The scope of what a Routine can handle depends on the tools you’ve granted access to. Here are concrete examples across a few categories:
Code and Repository Tasks
- Stale PR detection — scan open pull requests, flag ones with no activity, write a report
- Test coverage monitoring — run your test suite on a schedule, log coverage changes over time
- Dependency audits — check for outdated or vulnerable packages and write a summary
- Automated changelog drafts — pull recent commits and draft a changelog entry
Research and Monitoring
- Competitive monitoring — check competitor websites or blogs for new content and summarize changes
- Keyword tracking — monitor search results or forums for mentions of your product
- News digests — fetch headlines from specified sources and summarize the ones relevant to a topic
Data and Reporting
- Daily metrics summaries — pull data from an API, format it, write a report file
- Error log analysis — read logs from the previous day and surface unusual patterns
- Usage trend reports — aggregate data and generate a readable summary on a weekly cadence
Operational Tasks
- Database maintenance jobs — run cleanup queries on a schedule
- File organization — move, rename, or archive files based on rules
- Notification workflows — trigger messages based on conditions in your data
For patterns on how these kinds of workflows chain together into something bigger, Claude Code’s agentic workflow patterns covers the architecture in detail.
Routines in the Context of Claude Code’s Broader Agent Features
Routines don’t exist in isolation. They’re part of a growing set of features Anthropic has been adding to make Claude Code a more complete agentic development environment.
A few related features worth understanding:
Headless mode — lets Claude Code run without an interactive terminal session. Routines use this under the hood. If you want to understand what’s happening at the execution layer, Claude Code headless mode explained is worth reading.
Agent Teams — Claude Code now supports running multiple parallel agents on the same project. A Routine could kick off a coordinating agent that spins up subagents for parallel work. See how Claude Code agent teams work for details.
Chyros (background daemon) — references to a background daemon called Chyros have surfaced in Claude Code’s source. It appears to be part of the infrastructure enabling persistent, always-on agent behavior. What Chyros is and how it fits is still being pieced together as more details emerge.
AutoDream — another feature in the Claude Code ecosystem, focused on memory consolidation between sessions. If you’re thinking about agents that learn and improve over time, AutoDream’s approach to memory is relevant context.
Together, these features point toward something bigger than a coding assistant. Anthropic is building infrastructure for agents that operate continuously — not just when you’re at your keyboard.
Practical Limitations to Know Before You Rely on Routines
Routines are genuinely useful, but there are real constraints worth understanding:
Context window limits still apply. Each Routine run is a fresh agent invocation. It doesn’t carry memory from previous runs unless you’ve explicitly written state to a file or external store that it reads at the start of each run.
Long-running tasks have time limits. There are caps on how long a single Routine execution can run. Tasks that require hours of continuous work aren’t a fit. Design Routines to complete within a reasonable window — typically under 30 minutes for most workloads.
Debugging is harder. When a Routine fails, you get logs, but you’re not in an interactive session. Write your task prompts defensively: include explicit error handling instructions, tell the agent what to write when something goes wrong, and log intermediate state.
Tool access is intentionally limited. Not every Claude Code capability is available inside a Routine. Verify that the tools your task needs are actually available in the Routines environment before building something complex around them.
Costs scale with frequency. Every Routine run consumes inference tokens. A Routine that runs every 5 minutes and does substantial work can accumulate meaningful costs. Start with longer intervals and tighten them only if needed.
How Routines Compare to Traditional Automation Tools
The natural question is: why not just use GitHub Actions, a cron server, n8n, or Zapier?
The honest answer is that those tools are often better for pure automation — fixed, deterministic workflows with no reasoning involved. If you’re moving data from point A to point B on a schedule, a simple pipeline tool does that cleanly and cheaply.
Routines are more valuable when the task requires judgment. Summarizing content, deciding what’s worth flagging, interpreting log data, drafting text based on changing conditions — these benefit from an AI agent in the loop.
If you’re comparing Claude Code Routines specifically to n8n for a development context, this comparison of Claude Code Routines vs n8n breaks down where each tool fits better.
For tasks that fall somewhere in between — deterministic steps with AI reasoning at one or two points — a hybrid approach often works best. Use a traditional scheduler to kick off a process, pass the reasoning step to Claude, and handle the output with standard tooling.
Where Remy Fits
Routines solve the “keep it running” problem for Claude Code-based agent workflows. But the upstream problem — what do those agents actually build and maintain? — is where Remy comes in.
Remy is a spec-driven development environment. You write a spec in annotated markdown that describes your full-stack application, and Remy compiles that into a real backend, database, auth system, and deployed frontend. The spec stays in sync with the code as your application evolves.
That matters for scheduled workflows because the things your Routines need to interact with — APIs, databases, reporting surfaces, admin interfaces — are exactly what Remy builds. Instead of stitching together a pile of infrastructure to give your agents something to work with, you describe your application in a spec and deploy it.
And because Remy runs on the same underlying MindStudio infrastructure that supports hundreds of AI integrations, the full-stack apps it builds are easy to connect to agent workflows. A Routine can write to your app’s API endpoint. Another Routine can query your database and generate a report. The pieces fit.
If you’re thinking about building out an automated, agent-driven development environment, Remy is a natural complement to what Claude Code Routines provides. You can try Remy at mindstudio.ai/remy.
Frequently Asked Questions
What is Claude Code Routines?
Claude Code Routines is a feature inside Claude Code that lets you schedule AI agent tasks to run on Anthropic’s cloud infrastructure. You define a task, set a schedule, configure tool access, and the agent runs on that cadence without any local machine staying on.
Do Claude Code Routines require my computer to be running?
No. That’s the core value. Routines execute on Anthropic’s servers, not on your local machine. You can close your laptop, and scheduled Routines continue to fire on their set intervals.
How is a Routine different from using /loop in Claude Code?
The /loop command runs within an active Claude Code session on your local machine. It stops when your session ends. Routines are persistent, cloud-based, and run independently of any active session. For ongoing, scheduled work, Routines are the right choice. For in-session repetition while you’re actively working, /loop is simpler.
What can Claude Code Routines access?
Routines can be granted access to various tools depending on your configuration: file system operations, web fetch and browser automation, code execution, external API calls, and git operations. You control which tools are available to each Routine. It’s good practice to limit permissions to only what the specific task needs.
How much do Claude Code Routines cost?
Each Routine run consumes inference tokens based on the length of the task prompt, any context the agent reads, and the output it produces. Anthropic charges standard Claude API rates for this usage. There’s no separate fee for Routines as a feature — you pay for what you use. High-frequency Routines with long-running tasks will accumulate costs faster, so calibrate your schedule to actual need.
Can Claude Code Routines maintain memory between runs?
Not automatically. Each Routine run is a fresh agent invocation with no built-in memory of previous runs. To maintain state, you need to explicitly read from and write to a persistent store — a file in your project, an external database, or an API endpoint. Design your task prompt to read prior state at the start and write updated state at the end.
Key Takeaways
- Claude Code Routines are cloud-based scheduled tasks that run without your local machine staying on.
- They differ from the
/loopcommand, which is session-local and stops when you close Claude Code. - Setup involves defining a task prompt, setting a schedule, configuring tool access, and specifying an output destination.
- Routines work best for tasks that require judgment — summarizing, analyzing, drafting — not purely deterministic data pipelines.
- Each run is stateless by default; persistent state requires explicit read/write to an external store.
- Costs scale with frequency and task complexity, so start conservative and tighten schedules as needed.
- Routines are part of a broader Claude Code agentic ecosystem that includes headless mode, agent teams, and emerging always-on infrastructure.
If you’re building the applications and APIs that those agents need to interact with, try Remy — it handles the full-stack infrastructure side so your workflows have something solid to run against.