Skip to content

Routines & Scheduling

Automate recurring work without keeping your computer on. Routines run on Anthropic-managed cloud infrastructure.


A routine is a saved Claude Code configuration that runs automatically:

  • A prompt (what Claude should do each run)
  • One or more repositories (code to clone and work in)
  • Connectors (MCP tools like Slack, Linear, Jira)
  • One or more triggers (when to run)

Routines execute in the cloud — your laptop can be closed and they still run.

Routines are available on Pro, Max, Team, and Enterprise plans.


Run on a recurring cadence or once at a specific time.

Presets: hourly, daily, weekdays, weekly

Custom intervals: use /schedule update in CLI to set a cron expression. Minimum interval: 1 hour.

A dedicated HTTP endpoint. POST to it with a bearer token to start a run.

Terminal window
curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_01XXXXX/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."}'

Response:

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

React to repository events: pull requests, releases.

Supported events:

EventTriggers when
Pull requestPR opened, closed, assigned, labeled, synchronized
ReleaseRelease created, published, edited, deleted

Filter PRs by: author, title, body, base branch, head branch, labels, is draft, is merged.


Every weeknight: read issues opened since last run, apply labels, assign owners, post summary to Slack.
  • Trigger: schedule (daily, weeknights)
  • Connectors: issue tracker, Slack
  • Result: team starts the day with a groomed queue
When monitoring fires → call routine API endpoint with alert body.
Routine pulls stack trace, correlates with recent commits, opens draft PR with proposed fix.
  • Trigger: API (called by your alerting system)
  • Result: on-call gets a PR instead of a blank terminal
On every new PR: apply your team checklist, leave inline comments, add summary.
  • Trigger: GitHub (pull_request.opened)
  • Result: human reviewers focus on design, not mechanics
After every prod deploy → call routine API.
Run smoke checks, scan error logs, post go/no-go to release channel.
  • Trigger: API (called by your CD pipeline)
  • Result: deploy window closes only after verification
Weekly: scan merged PRs, flag docs that reference changed APIs, open update PRs.
  • Trigger: schedule (weekly)
  • Result: docs stay in sync automatically
On every merged PR in SDK A → port the change to SDK B, open matching PR.
  • Trigger: GitHub (pull_request.closed, filtered to merged)
  • Result: two parallel SDKs stay in sync

Visit claude.ai/code/routinesNew routine.

Steps:

  1. Name + prompt — write a self-contained, explicit prompt (runs autonomously, no approval prompts)
  2. Select repositories — cloned at the start of each run from the default branch
  3. Select environment — controls network access, env vars, setup scripts
  4. Select trigger(s) — schedule, API, GitHub event, or any combination
  5. Review connectors — all your connected MCP connectors are included by default (remove unused ones)
  6. Create — click Run now to start immediately
Terminal window
/schedule # Create conversationally
/schedule daily PR review at 9am # Create recurring
/schedule clean up feature flag in one week # Create one-off
/schedule list # See all routines
/schedule update # Change an existing routine
/schedule run # Trigger immediately

/schedule requires a claude.ai subscription login (not a Console API key).


By default, routines can only push to claude/-prefixed branches (safety measure).

To allow pushing to any branch: enable Allow unrestricted branch pushes when creating/editing the routine.


Schedule a routine to fire once at a specific time:

/schedule tomorrow at 9am, summarize yesterday's merged PRs
/schedule in 2 weeks, open a cleanup PR that removes the feature flag

After firing, the routine auto-disables and is marked Ran in the UI.

One-off runs do not count against the daily routine run cap.


Routines use your claude.ai integrations as connectors.

Local MCP servers (added via claude mcp add) are not available in routines — they live on your machine. To use them in a routine: add them as connectors on claude.ai, or declare them in a committed .mcp.json file.


  • Routines draw down your subscription usage like interactive sessions
  • There is a daily cap on routine runs per account
  • See usage at claude.ai/settings/usage
  • Organizations with usage credits can continue on metered overage

OptionRuns whereBest for
RoutinesAnthropic cloudUnattended, recurring, multi-repo
Desktop scheduled tasksYour machineLocal files, local tools
/loopCLI sessionQuick polling within an open session

/schedule shows “Unknown command”: You’re using a Console API key or cloud provider (Bedrock/Vertex). Use a claude.ai login instead. Or DISABLE_TELEMETRY / DO_NOT_TRACK is set.

“Routines are disabled by your organization”: An Owner disabled them at claude.ai/admin-settings/claude-code. Ask an Owner to enable them.

  • Trick: scheduling ladder — “/loop in the session → desktop task on your machine → routine in the cloud (machine off).”
  • Show: create one nightly routine with /schedule, live.
  • They’ll trip on: expecting cloud routines to see local files — they run on Anthropic VMs.

Learning path:33-headless-and-scripting.md · Index · ➡ 35-github-actions.md

Written by Fenil Patel