Tech 9 min read

Automating Coding Tasks in the Cloud with Claude Code Routines

IkesanContents

Anthropic released Claude Code Routines as a research preview on April 14, 2026.
The announcement pulled in 565 points and 336 comments on HackerNews, with the dominant reaction being “Claude Code is getting close to a complete cloud execution environment.”

In short, a Routine is a saved bundle of prompt, repositories, and connectors that can be triggered automatically via schedule, API call, or GitHub event.
It runs on Anthropic-managed infrastructure, so it keeps working even when your laptop is closed or it’s the middle of the night.

What Changed

Previously, Claude Code ran as a local process.
It was tied to an open terminal session and could only work while the user was actively operating it.

The Claude Code Channels research preview introduced the ability to push messages into a running session from the outside, but the Claude Code session itself still had to stay alive.
Routines remove that constraint entirely — the cloud handles startup, execution, and teardown.

Claude Code had already shipped features like multi-agent PR review as research previews before this.
But those still assumed the user would trigger them manually.
Routines delegate the triggering to the system side, letting Anthropic’s infrastructure manage repeated execution.

Relationship to Claws

Back in February, Andrej Karpathy coined the term “Claws” for a concept where you layer orchestration, scheduling, and persistence on top of LLM agents to make them persist across sessions.
Karpathy’s original vision had them running locally on a Mac Mini, but Routines take this to the cloud.
For a deeper look, see “AI Agent Orchestration: Claws and Cord.”

In the Claws framing, the core idea was “agents autonomously queuing and executing tasks.”
Routines put the autonomous execution part on Anthropic-managed infrastructure, freeing you from local machine power management and process babysitting.
The tradeoff: no access to local files, and no offline persistence.

Routine Structure

ElementDescription
PromptThe instructions executed each run. Must be self-contained since execution is autonomous
RepositoriesTarget GitHub repositories (multiple allowed). Cloned from the default branch each run
EnvironmentDefines network access, environment variables, and setup scripts for the cloud environment
ConnectorsMCP connectors for Slack, Linear, Google Drive, etc. (all connectors enabled by default)
TriggersSchedule, API, or GitHub. Multiple triggers can be combined on a single routine

A routine runs as a full Claude Code session on Anthropic’s cloud.
There’s no permission mode selection and no approval prompts.
It can execute shell commands, call skills committed to the repository, and freely use configured connectors.
Scope is controlled by three knobs: repository settings, environment, and connectors.

Pushes to repositories are restricted to branches with the claude/ prefix by default.
This prevents accidental pushes to long-lived branches like main or develop.
Explicitly enabling Allow unrestricted branch pushes removes this restriction.

Three Trigger Types

Schedule Trigger

Choose from presets: hourly, daily, weekdays, or weekly.
Timezone input is in local time with automatic conversion, so setting “every morning at 9 AM (JST)” works regardless of which region the cloud infrastructure runs in.
Actual start times may slip by a few minutes due to stagger processing.

For custom cron intervals, pick the closest preset in the form, then specify a cron expression directly via the CLI’s /schedule update.
The minimum interval is one hour; anything shorter is rejected.

API Trigger

Generates a dedicated HTTP endpoint for the routine.
POST with a bearer token to start a new session; the response returns a session URL.

curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01ABCDEFGHJKLMNOPQRSTUVW/fire \
  -H "Authorization: Bearer sk-ant-oat01-xxxxx" \
  -H "anthropic-beta: experimental-cc-routine-2026-04-01" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"text": "Sentry alert SEN-4521 fired in prod. Stack trace attached."}'

The JSON response includes a session ID and URL.

{
  "type": "routine_fire",
  "claude_code_session_id": "session_01HJKLMNOPQRSTUVWXYZ",
  "claude_code_session_url": "https://claude.ai/code/session_01HJKLMNOPQRSTUVWXYZ"
}

The text field passes run-specific context.
You can inject dynamic information each time — alert bodies, stack traces, deployment results.
The value is free-form text with no structural interpretation, so JSON or Markdown is delivered as a raw string.

The endpoint requires the experimental-cc-routine-2026-04-01 beta header, and the API shape may change.
Backward compatibility with two previous beta header versions is maintained during migration windows.

GitHub Trigger

Installing the Claude GitHub App on a target repository enables routine firing on repository events.
Currently supported event categories are Pull Request and Release.

PR triggers support granular filters.

FilterMatches
AuthorGitHub username that opened the PR
TitlePR title
BodyPR body text
Base branchTarget merge branch
Head branchSource branch
LabelsApplied labels
Is draftWhether the PR is a draft
Is mergedWhether the PR has been merged
From forkWhether the PR is from a fork

Each filter supports operators like equals, contains, starts with, is one of, and matches regex.
matches regex matches against the entire field, so for partial matching use .*hotfix.* or just use contains.

Each GitHub event spawns an independent new session.
There’s no session reuse, so two updates to the same PR mean two sessions.

During the research preview, per-routine and per-account rate limits on event ingestion apply, and events exceeding the cap are dropped until the window resets.

Practical Use Cases

Representative examples from the documentation.

Use CaseTriggerWhat It Does
Backlog groomingSchedule (weeknight)Reads new issues from the issue tracker since last run, applies labels and assigns owners. Posts a summary to Slack
Alert triageAPI (from monitoring tool)Receives alert body via text, cross-references stack traces with recent commits. Opens a draft PR with a suggested fix
Automated PR reviewGitHub (pull_request.opened)Applies the team’s review checklist and posts inline + summary comments. Separate from multi-agent PR review — this is the generic version where you design the prompt
Library syncGitHub (pull_request.closed)Detects changes to SDK A with a merged filter, ports them to SDK B in another language, and opens a corresponding PR

Comparison with Stripe’s In-House Infrastructure

Stripe’s Minions achieves something similar on its own infrastructure.
Minions generates over 1,300 PRs per week with zero human effort, using disposable AWS EC2-based “Devbox” development environments and a goose fork for autonomous execution.

The difference between Routines and Minions comes down to where the infrastructure lives.
Minions maintains its own Devbox pool within Stripe’s AWS account, with self-built features like 10-second pre-warmed startup and network isolation within QA environments.
Routines hand all of that infrastructure work to Anthropic, accepting Anthropic’s guardrails — daily execution caps, branch restrictions — in exchange.

If your engineering team is large enough to absorb the operational cost of running your own infrastructure, the Minions approach makes sense.
For individuals or small teams who just want “tasks that run overnight,” Routines get you up and running faster.

Management and Operations

Routines can be created and managed from three surfaces: the CLI (/schedule), the web at claude.ai/code/routines, and the Desktop app.
All three write to the same cloud account, so a routine created in the CLI appears in the web UI immediately.
In the Desktop app, choosing “New remote task” creates a Routine, while “New local task” creates a local scheduled task on the desktop machine.

Routines are tied to an individual claude.ai account.
Sharing with team members isn’t supported, and GitHub commits, PRs, Slack messages, and Linear tickets are all executed under the routine creator’s account.

Daily Execution Limits

PlanDaily Routine Runs
Pro5
Max15
Team / Enterprise25

When the limit is exceeded, organizations with extra usage enabled can continue execution via metered billing.
Without it, execution is refused until the window resets.

CLI Operations

The /schedule command is the entry point for Routine operations.

/schedule                         # Create a new routine interactively
/schedule daily PR review at 9am  # Create with inline description
/schedule list                    # List all routines
/schedule update                  # Modify an existing routine
/schedule run                     # Execute immediately

Adding and editing API triggers and GitHub triggers is web-only.
CLI-based API token generation and revocation are also not available at this time.

Choosing Between GitHub Actions, Desktop Scheduled Tasks, and Routines

Anthropic also offers GitHub Actions and Desktop Scheduled Tasks as related features.
While their capabilities overlap, each has a distinct niche.
GitHub Actions integrates into CI/CD pipelines, with workflow YAML and runner environments riding on GitHub’s ecosystem.
Desktop Scheduled Tasks runs on the local machine, for when you need access to local files or private environments.
Routines provide machine-independent cloud execution with native GitHub App integration and the ability to span multiple external services via MCP connectors.
Best suited for tasks you want running repeatedly overnight.

Adding GitHub Copilot CLI’s /fleet to the picture helps clarify things further.
/fleet takes a single prompt, has an orchestrator decompose it, and dispatches work to multiple sub-agents in parallel.
If Routines are the scheduling layer — “when and why to run” — /fleet is the execution layer — “how to parallelize within a single run.”
The two operate at different layers and don’t compete.

ToolLayerStrength
RoutinesScheduling & triggersPeriodic execution, event-driven, cloud-resident
/fleetRuntime parallelismSplitting large tasks for concurrent processing
GitHub ActionsCI/CD pipelineBuild, test, and deploy automation
Desktop Scheduled TasksLocal periodic executionAccess to local files and private environments

Since this is a research preview, the API specification, daily limits, and trigger types are subject to change.
See the official documentation at code.claude.com/docs/en/routines.