Claude Code Routines: Cloud AI That Codes While You Sleep

AI Bot
By AI Bot ·

Loading the Text to Speech Audio Player...

On April 14, 2026, Anthropic shipped one of the most requested features in Claude Code: Routines. Think of them as AI-powered cron jobs that actually understand your codebase — scheduled tasks that run on Anthropic's cloud, keep working after you close your laptop, and make context-aware decisions about your code.

If you have been cobbling together GitHub Actions plus headless Claude calls to automate repository maintenance, Routines replace that entire duct-tape stack with a first-party solution.

What Exactly Is a Routine?

A routine is a saved Claude Code configuration that bundles three things:

  • A prompt — the instructions Claude follows autonomously
  • One or more repositories — cloned fresh from the default branch at every run
  • Connectors — integrations like GitHub, Slack, or Linear that Claude can interact with

Once created, the routine runs on Anthropic's infrastructure without any manual approval dialogs. It can read code, run shell commands, push branches, post Slack messages, and file issues — all unattended.

The Middle Ground Between Cron Jobs and AI Agents

Routines occupy a deliberate sweet spot in the automation spectrum:

ApproachBehavior
Cron jobs / GitHub ActionsRun fixed scripts on a schedule — no reasoning, no adaptation
Claude Code RoutinesRun AI-driven tasks on a schedule or trigger — context-aware decisions
Full AI agentsMaintain long-running state, continuous interaction with tools

Traditional cron jobs execute the same script every time regardless of context. Full AI agents are expensive and hard to scope. Routines sit in between: they bring Claude's reasoning to scheduled tasks without the overhead of a persistent agent process.

Three Ways to Trigger a Routine

1. Scheduled Execution

Set a cron expression or pick a preset (daily, weekly, hourly). The minimum interval is one hour. Perfect for nightly code quality scans, weekly dependency audits, or daily issue triage.

2. API Triggers

Every routine gets a dedicated HTTP endpoint with a bearer token. Fire it from your CI pipeline, a monitoring alert, or any external system:

curl -X POST https://api.anthropic.com/v1/claude_code/routines/{trigger_id}/fire \
  -H "Authorization: Bearer sk-ant-oat01-xxxxx" \
  -H "Content-Type: application/json" \
  -d '{"text": "Sentry alert SEN-4521 in prod."}'

The response includes a session URL where you can monitor Claude's execution in real time.

3. GitHub Webhooks

Hook into pull request events, merges, or issue creation. You can filter by author, branch, labels, and draft state to avoid burning your daily quota on irrelevant events.

Real-World Use Cases

Deployment Verification — After every merge to main, a routine clones the repo, scans CI/CD output for errors, and posts a structured report to your release Slack channel.

Nightly Issue Triage — Every morning at 8 AM, Claude reviews new issues, labels them by severity and area, assigns owners based on CODEOWNERS, and adds triage notes.

PR Review Automation — When a pull request is opened, a routine runs the test suite, checks for common anti-patterns, verifies documentation updates, and posts a review comment.

Weekly Dependency Audit — Every Monday, Claude scans for outdated or vulnerable dependencies, opens a PR with safe upgrades, and summarizes breaking changes.

Setting Up Your First Routine

  1. Navigate to claude.ai/code/routines and click New routine
  2. Write a self-contained prompt — since there is no human in the loop, include success criteria and verification steps
  3. Add repositories — they are cloned fresh from the default branch at every run
  4. Configure the environment — set internet access levels, environment variables, and setup scripts
  5. Choose your trigger — schedule, API, or GitHub webhook
  6. Review connectors — remove any you do not need to minimize the access surface
  7. Test with Run now before enabling autonomous execution

By default, Claude can only push to branches prefixed with claude/ — a safety guardrail that prevents accidental commits to protected branches.

Pricing and Limits

Routines are available on all paid Claude Code plans, but daily run limits vary:

PlanDaily RunsMonthly Cost
Pro5$20
Max15$100–200
Team25Per seat
Enterprise25Custom

These limits are separate from your regular token quota. Exceeding them triggers metered billing if enabled on your account. For a deeper look at Claude Code pricing tiers, see our pricing breakdown.

The Desktop Redesign

Alongside Routines, Anthropic shipped a major desktop app overhaul with an integrated terminal, faster diff viewer, in-app file editor, and multi-session support. The goal is clear: keep developers inside Claude Code rather than bouncing between the AI interface and VS Code or the terminal.

This pairs well with Routines — you can monitor routine executions, review their branch pushes, and iterate on prompts all from the same interface.

Limitations to Watch For

No automatic retries. If a routine fails, the session logs are preserved at claude.ai/code but nothing reruns automatically. You will need to investigate and trigger manually.

Fresh clone every run. Routines do not maintain state between executions. Every run starts from a clean checkout of the default branch. This is a feature (reproducibility) but also a constraint (no incremental work).

No team sharing. Routines are tied to individual accounts. You cannot share a routine configuration across team members yet, though this is likely coming.

Hourly minimum. Scheduled routines cannot fire more often than once per hour during the research preview.

How This Compares to Cursor Automations

Cursor launched its own always-on automation feature earlier this year, triggered by Slack, GitHub, and PagerDuty events. The core concept is similar — background AI agents responding to events — but Claude Code Routines offer deeper repository integration and the ability to execute shell commands directly.

The agentic coding landscape is converging on a common pattern: AI agents that work autonomously on your codebase, triggered by real-world events, and report back asynchronously. Routines are Anthropic's entry into that race.

The Bottom Line

Claude Code Routines turn repetitive dev-ops tasks into AI-driven workflows that run on autopilot. They are not a replacement for thoughtful engineering — you still need to write precise prompts and set proper guardrails — but they remove a significant amount of manual toil from daily development.

If you are already using Claude Code for interactive coding, Routines are the natural next step: let the AI handle the work that does not need you in the chair.


Want to read more blog posts? Check out our latest blog post on AI-Native Cloud: The New Deployment Stack.

Discuss Your Project with Us

We're here to help with your web development needs. Schedule a call to discuss your project and how we can assist you.

Let's find the best solutions for your needs.