Anthropic · April 2026 · Feature Briefing

Claude Code Routines

Saved Claude Code configurations that run automatically on Anthropic's cloud — on a schedule, API call, or GitHub event.

Research Preview Scheduled Runs 3 Trigger Types GitHub Events MCP Connectors

Claude Code keeps working when you close your laptop.

A routine is a saved Claude Code configuration: a prompt, one or more repositories, and a set of connectors. It runs on Anthropic-managed cloud infrastructure — no machine, no open session. Define it once, then let it handle recurring work: PR reviews, nightly triage, deploy verification, docs drift checks.

Routines are in research preview and available on Pro, Max, Team, and Enterprise plans with Claude Code on the web enabled. Create and manage them at claude.ai/code/routines or from the CLI with `/schedule`.

The One-Liner

A routine is a cloud-hosted Claude agent with a saved prompt, repos, and connectors — triggered automatically, without you.

Analogy

Think of a routine like a standing order to a night-shift engineer. You write the brief once. They clock in every night, do the work, and leave you a report. You read the results in the morning.

Available on Pro, Max, Team, and Enterprise

Requires Claude Code on the web to be enabled. Create and manage routines at claude.ai/code/routines or from the CLI with /schedule.

The building blocks

A routine has two parts — what Claude should do, and what makes it run. Separate these and the system becomes clear.

📄
ROUTINE = The Brief

A saved package: prompt, GitHub repos, connectors, and environment. Written once, reused on every trigger fire.

TRIGGER = The Alarm Clock

What starts a run. A schedule, an API POST, or a GitHub event. One routine can have all three at once.

🏃
RUN = One Session

Each trigger fire spins up a fresh cloud session. Claude runs autonomously — no approval prompts, no waiting.

🔌
CONNECTOR = The Toolbox

Your MCP integrations: Slack, Linear, Google Drive. Claude can read from and write to them during each run.

Why cloud matters

Local Claude Code stops when you close your laptop. Routines run on Anthropic's infrastructure — they keep going at 3am, on weekends, during your holiday. The session log is always there when you come back.

Runs as you

Commits, PRs, Slack messages, and Linear tickets created by a routine appear under your GitHub identity. Runs count against your account's daily allowance — not a shared pool.

Three trigger types

Every routine needs at least one trigger. Mix and match — the same routine can react to all three simultaneously.

schedule Recurring cadence

Hourly, daily, weekdays, or weekly. Times set in your local timezone. Custom cron expressions via `/schedule update` in the CLI.

api On-demand via HTTP POST

Each routine gets a dedicated endpoint and bearer token. Pass extra context in the `text` field — Claude receives it alongside the saved prompt.

github React to repo events

PR events (opened, closed, labeled) or release events. Filter by author, branch, label, draft state, or regex on the title.

Branch safety

By default Claude can only push to branches prefixed with `claude/`. To allow unrestricted pushes, enable it explicitly per repository when creating the routine.

Create a cloud routine

All three surfaces — web, CLI, Desktop app — write to the same cloud account. A routine created in the CLI shows up on the web instantly.

1
Start with /schedule

Run `/schedule daily PR review at 9am` in any session. Claude walks through setup conversationally and saves the routine to your account.

2
Write a self-contained prompt

The routine runs fully autonomously. No approval prompts during the run — be explicit about what to do and what success looks like.

3
Select repositories and environment

Each repo is cloned fresh from the default branch on every run. Set environment variables, network access, and a setup script (result is cached).

4
Add triggers

Schedule, API endpoint, and GitHub event triggers can be combined. Add or remove them anytime from the edit form at claude.ai/code/routines.

5
Monitor and manage runs

Each run is a full session — review changes, create a PR, or continue the conversation. Use Run now, pause, or edit from the routine's detail page.

Usage limits

Minimum schedule interval is 1 hour. Routine runs count against your daily cap and subscription usage. Check consumption at claude.ai/settings/usage.

End-to-end: Alert Triage

Your monitoring tool fires at 2am. You want Claude to pull the stack trace, correlate it with recent commits, and open a draft PR with a proposed fix — without waking anyone up.

📄 Step 1 — Write the prompt
You are an on-call engineer. When triggered with an alert body in the 'text' field: 1. Read the stack trace and identify the failing function 2. Search recent commits for changes in that area 3. Propose a fix and open a draft PR with your reasoning 4. Post a summary to #on-call Slack with a link to the PR

The prompt is self-contained — Claude knows exactly what to do with no human in the loop.

⚙️ Step 2 — Configure the routine
Repository: your-org/your-api-service Trigger: API Connectors: Slack, GitHub Environment: network access to your logging APIs

Save it. Claude generates a unique endpoint URL and you create a bearer token (shown once — store it immediately).

🚨 Step 3 — Alert fires at 2am
POST .../routines/trig_01ABC.../fire Authorization: Bearer sk-ant-oat01-xxxxx {"text": "SEN-4521: NullPointerException in PaymentService — 47 errors/min"}

Your monitoring tool (Sentry, Datadog, PagerDuty) POSTs to the routine endpoint. The alert body reaches Claude alongside the saved prompt.

🤖 Step 4 — Claude works autonomously
-> clone: your-org/your-api-service -> git log --oneline -20 -- src/payments/PaymentService.java -> grep -n "processRefund" src/payments/PaymentService.java -> edit: null check added to processRefund() -> git push origin claude/fix-payment-null-check -> GitHub: draft PR #312 opened -> Slack: summary posted to #on-call

All of this happens while you sleep — no approval prompts, no human in the loop.

☀️ Step 5 — You wake up to a report

A Slack message in #on-call links to draft PR #312. Claude's reasoning is in the PR description. You review, approve, and merge — instead of starting from a blank terminal at 2am.

The Payoff

The same routine handles every future alert. Combine it with a schedule trigger (nightly log scan) and a GitHub trigger (every new release) — one routine, three ways to fire, zero manual intervention.

Code Examples

Three ways to work with routines in code. CLI is fastest for creating them; curl and Python are for triggering from external systems.

Setup
What Happens When You Run This
1.

The /fire endpoint receives your POST and authenticates the bearer token

2.

Anthropic spins up a fresh Claude Code cloud session for this routine

3.

Claude clones the configured repos and runs the saved prompt (plus any `text` you passed)

4.

The response returns a session URL — open it to watch Claude work in real time