惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

P
Privacy & Cybersecurity Law Blog
Engineering at Meta
Engineering at Meta
Forbes - Security
Forbes - Security
MongoDB | Blog
MongoDB | Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
A
About on SuperTechFans
量子位
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
雷峰网
雷峰网
腾讯CDC
P
Proofpoint News Feed
S
Schneier on Security
S
Secure Thoughts
V
Visual Studio Blog
Help Net Security
Help Net Security
The Hacker News
The Hacker News
C
Cyber Attacks, Cyber Crime and Cyber Security
P
Privacy International News Feed
SecWiki News
SecWiki News
S
SegmentFault 最新的问题
T
Threatpost
小众软件
小众软件
MyScale Blog
MyScale Blog
F
Fortinet All Blogs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
P
Proofpoint News Feed
T
Tailwind CSS Blog
I
Intezer
C
CERT Recently Published Vulnerability Notes
U
Unit 42
V
V2EX
Cyberwarzone
Cyberwarzone
Recorded Future
Recorded Future
O
OpenAI News
Project Zero
Project Zero
有赞技术团队
有赞技术团队
Google DeepMind News
Google DeepMind News
Last Week in AI
Last Week in AI
Hugging Face - Blog
Hugging Face - Blog
Know Your Adversary
Know Your Adversary
C
Cybersecurity and Infrastructure Security Agency CISA
Scott Helme
Scott Helme
V2EX - 技术
V2EX - 技术
博客园 - 叶小钗
S
Securelist
A
Arctic Wolf
The Cloudflare Blog
W
WeLiveSecurity
T
Threat Research - Cisco Blogs
博客园 - Franky

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant Common SOC 2 Failures (Real World) Stop Vibe-Checking Your AI App: A Practical Guide to Evals How to Use SonarQube and SonarScanner Locally to Level Up Your Code Quality Your Next To-Do App Is Dead — I Replaced Mine with an OpenClaw AI Sign a Nostr event in 60 lines of Python using coincurve — no nostr-sdk, no nbxplorer, no rust toolchain ITGC Audit Explained Like You’re in Big 4 Patch Tuesday abril 2026: Microsoft parcha 163 vulnerabilidades y un zero-day en SharePoint Stop scraping everything: a better way to track competitor price changes Listing on MCPize + the Official MCP Registry while routing payments OUTSIDE the marketplace — how I kept 100% of my x402 revenue Building an AI-Powered Risk Intelligence System Using Serverless Architecture Why We Ripped Function Overloading Out of Our AI Toolchain Testing AI-Generated Code: How to Actually Know If It Works SaaS Churn Is Killing Your Business. Here Is What to Do About It (Without a Support Team) The Speed of AI Is No Longer Linear - And Self-Improving Models Are Why How to Implement RBAC for MCP Tools: A Practical Guide for Engineering Teams From Standard Quote to Persuasive Proposal: AI Automation for Arborists I built a CLI that scaffolds complete multi-tenant SaaS apps Axios CVE-2025–62718: The Silent SSRF Bug That Could Be Hiding in Your Node.js App Right Now The dashboard that ended our friendship Data Pipelines Explained Simply (and How to Build Them with Python) The Hidden Cost of AI Systems Nobody Talks About. undefined vs undeclared, and how typeof behaves Switching from file-based jobs to NATS/Kafka in Rust without changing code io_uring Adventures: Rust Servers That Love Syscalls Why Agentic AI is Killing the Traditional Database The POUR principles of web accessibility for developers and designers Quantum Neural Network 3D — A Deep Dive into Interactive WebGL Visualization How To Install Caveman In Codex On macOS And Windows Automation Pipeline Reliability: Why Your Workflow Breaks When Nobody Is Watching I Built an 'Open World' AI Coding Agent — It Works From ANY Folder From Freelancing to Product: A Tech Service Company's SaaS Transformation China's AI Giants: Adding Tencent Hunyuan & ByteDance Doubao to AI University (74 Providers) On the Vibe Coders and Their Lies clerk: Auto-Summarize Your Claude Code Sessions AI Weekly — 2026/04/10–04/17 | The Model Lockdown Is Here, but the Toolchain Is the Real Battleground AI 週報 — 2026/04/10–2026/04/17 模型封鎖潮來了,但工具鏈才是真戰場 Maybe this is how Open-Source apps are born... 🚀 Fine-Tune LLMs with LoRA and QLoRA: 2026 Guide tRPC v11 + Next.js App Router: End-to-End Type Safety Without the Boilerplate ShadCN UI in 2026: Why I Stopped Installing Component Libraries and Started Owning My Components SaaS Billing in React Server Components: Stripe + Supabase Without a Single `useEffect` Join our DEV Weekend Challenge — $1,000 in Prizes Across TEN winners! Submissions Due April 20 at 6:59 AM UTC. Implementing FSRS Spaced Repetition in Flutter + Supabase — Adding Memory Science to an AI Learning App "I Texted My Localhost From the Train — Claude Code Fixed the Bug Before I Got Home" I Built a Sales Prep AI and It Went Deeper Than Expected Design to Code #2: One JSON, Eleven Outputs Solving the 100M-Row Problem: A Summary Table Pattern for High-Volume Push Notification Logs Flutter Web With Wasm: What Actually Changes For Developers I Built 50 Royalty-Free Soundtracks for My Side Project in a Weekend Using AI Music Generation The Vibe Coding Security Checklist: 7 Things to Check Before You Ship Stop Letting Googlebot Guess Fix Your React App's SEO Right Desconstruindo o Streaming do LinkedIn: Como Criar um Engine de Extração de Vídeo de Alta Performance com HLS e FFmpeg (EDA Part-1) EDA (Exploratory Data Analysis) Explained With Real Life — Why Looking at Your Data Is the Most Important Step in Machine Learning Brand Relationship Management at Scale: Our 4-Touch Outreach System for 200+ Brands Why String.fromEnvironment() Might Return an Empty String in Dart JGuardrails 1.0.0 — Hardening Java LLM Apps Against Jailbreaks, Toxicity, and Prompt Injection Plan and Schedule a Full Week of Threads Content From One Claude Conversation Coding Cat Oran Ep3, Five Tables Changed Everything Updated: BFF Pattern I'm done watching freelancers get buried by 200 proposals. So I'm building the alternative. This is my first post BFS Algorithm in Java Step by Step Tutorial with Examples Tracking LLM Pricing Monthly: An Open Dataset for 22 AI Models How We Measure Content ROI on a Comparison Site: Revenue Attribution Without Perfect Data Introducing Nova AI Ops: The AI-Native Operating System for SRE Teams I built a free desktop video downloader for Windows — Grabbit How Talkie OCR Helps Vision-Impaired & Dyslexic Users Read the World Around Them VRCFaceTracking安装和iPhone面捕配置教程,有bug Even CrowdStrike Can't See Your Agents The Automation Gold Rush: What n8n Workflows and Claude Are Opening Up for Developers Right Now
Claude Code Routines: Automate AI Workflows on Autopilot in 2026
Ramsis Hamma · 2026-05-17 · via DEV Community

Claude Code Routines: Automate AI Workflows on Autopilot in 2026

TL;DR Summary

  • Claude Code Routines run on Anthropic's cloud infrastructure — your laptop can be closed, routines keep executing
  • Three trigger types: schedule (cron, recurring or one-off), API (HTTP POST from any system), and GitHub events (PRs, releases)
  • Routines run autonomously as full Claude Code sessions — they clone repos, use MCP connectors, run shell commands, and create PRs
  • Use cases include PR review, alert triage, deploy verification, docs drift detection, backport automation, and library sync
  • Available on Pro/Max/Team/Enterprise plans with Claude Code on the web enabled. Create via web dashboard or /schedule in CLI

Direct Answer Block

A Claude Code Routine is a saved configuration — a prompt, repositories, and MCP connectors — that executes automatically on Anthropic's managed cloud infrastructure. You define it once, then it runs on schedule, when called via API, or when a GitHub event fires. Unlike CI/CD pipelines that run deterministic scripts, routines run full AI-powered coding sessions autonomously: they reason about your codebase, use tools, and produce PRs.

Introduction

Most automation tools force a tradeoff: either you write deterministic scripts that can't think, or you run AI agents that need constant supervision. Claude Code Routines split the difference. They run unattended on cloud infrastructure — scheduled, API-triggered, or GitHub-event-driven — but each run is a full Claude Code session with access to your repos, MCP connectors, and shell. The routine's prompt defines what to do; the infrastructure handles when and how. No laptop, no open terminal, no approval prompts.

What are Claude Code Routines and how do they differ from CI/CD pipelines?

Routines are not CI/CD. They are not GitHub Actions. They are autonomous AI coding sessions that run on Anthropic-managed cloud infrastructure when triggered.

The distinction matters because it changes what you automate:

  • CI/CD runs a deterministic script. It can't inspect a PR and decide whether the changes introduce a subtle security issue. It can lint, test, and build — but it can't reason.
  • Routines run a Claude Code session. It reads your codebase, applies judgment, uses tools, and produces a PR with inline comments explaining why something should change.

"A routine stores a prompt, repositories, and connectors as one configuration and runs it automatically. The system executes routines on managed cloud infrastructure, so your workflows run without a local machine." — AlphaSignal summary of Anthropic's announcement

According to Anthropic's documentation, each routine can have one or more triggers attached:

Trigger What fires it Example
Schedule Cron-based recurring or one-off time Nightly PR review at 9am
API HTTP POST with bearer token Alerting system fires routine on error threshold
GitHub Repository events (PR opened, release created) Auto-review every new PR

A single routine can combine triggers. A PR review routine can run nightly, trigger from a deploy script via API, and also react to every new PR opened.

Anthropic's documentation explicitly distinguishes routines from /loop (session-scoped, stops when terminal closes), Desktop scheduled tasks (runs on your machine), and GitHub Actions (deterministic CI). Routines are the "runs on Anthropic cloud, survives independently" tier.

How do you create a routine from the web dashboard, the CLI, and the Desktop app?

Method 1: Web dashboard (claude.ai/code/routines)

This is the most complete creation surface. All three trigger types (schedule, API, GitHub) are configurable here. The creation form walks through:

  1. Name and prompt — the prompt is the most important part. Since routines run autonomously, the prompt must be self-contained and explicit about what success looks like. Anthropic's docs note: "The prompt is the most important part: the routine runs autonomously, so the prompt must be self-contained and explicit about what to do and what success looks like."

  2. Repositories — add GitHub repos for Claude to work in. Each is cloned at run start from the default branch. Claude creates claude/-prefixed branches for changes.

  3. Environment — pick a cloud environment controlling network access (Trusted, Custom, Full), environment variables (API keys, tokens), and a setup script (dependencies install). The setup script result is cached across runs.

  4. Trigger — schedule (preset or custom cron via /schedule update), API (URL + token generated after save), or GitHub event (PR/release with filters).

  5. Connectors and permissions — all connected MCP connectors (Slack, Linear, Google Drive) are included by default. Remove unused ones. Enable "Allow unrestricted branch pushes" if the routine should push to existing branches.

Method 2: CLI (/schedule)

Run /schedule to create a scheduled routine conversationally. You can pass a description:

/schedule daily PR review at 9am
/schedule clean up feature flag in one week

Enter fullscreen mode Exit fullscreen mode

Claude walks through the same info the web form collects. The CLI creates scheduled routines only — to add API or GitHub triggers, edit on the web.

Manage existing routines from CLI:

/schedule list        # see all routines
/schedule update      # change one
/schedule run         # trigger immediately

Enter fullscreen mode Exit fullscreen mode

Method 3: Desktop app

Click Routines in the sidebar, then New routine, and choose Remote (vs Local for Desktop scheduled tasks). All three surfaces write to the same cloud account — a routine created in one appears everywhere immediately.

How do you configure schedule triggers, API triggers, and GitHub event triggers?

Schedule triggers

Pick a preset (hourly, daily, weekdays, weekly) or a custom cron via /schedule update. Minimum interval is 1 hour. Times are entered in your local timezone and converted automatically.

For one-off runs, describe the time naturally:

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

Enter fullscreen mode Exit fullscreen mode

One-off runs don't count against the daily routine run cap. After firing, they auto-disable.

API triggers

API triggers give a routine a dedicated HTTP endpoint. POST to the endpoint with a bearer token to start a new session.

Setup (web only):

  1. Edit routine → Add another trigger → API
  2. Copy the URL
  3. Click Generate token — shown once, store securely

Call:

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

Enter fullscreen mode Exit fullscreen mode

Response returns a session ID and URL for live monitoring. Note the beta header — this is research preview.

GitHub triggers

Configure from web UI only. Requires the Claude GitHub App installed on the target repo.

Supported events: Pull request (opened, closed, assigned, labeled, synchronized) and Release (created, published, edited, deleted).

Filters (all must match):

  • Author, Title, Body, Base branch, Head branch, Labels, Is draft, Is merged

Example: Base branch main + Head branch contains auth-provider → focused auth module review.

Each matching event starts a new session — no session reuse across events.

What are 6 real-world use cases for Claude Code routines — from PR review to alert triage?

A visual 2x3 grid of use case cards: Backlog maintenance, Alert triage, Bespoke code review, Deploy verification, Docs drift, Library port.

Anthropic's documentation provides six example use cases, each mapping a trigger type to unattended, repeatable work:

1. Backlog maintenance (schedule trigger)

Runs weeknights against your issue tracker via MCP connector. Reads new issues, applies labels, assigns owners based on referenced code areas, posts summary to Slack.

2. Alert triage (API trigger)

Monitoring tool calls routine's API endpoint with error threshold breach. Routine pulls stack trace, correlates with recent commits, opens draft PR with proposed fix and link to alert. On-call reviews PR instead of starting from blank terminal.

3. Bespoke code review (GitHub trigger)

Runs on pull_request.opened. Applies team's review checklist, leaves inline comments for security/performance/style, adds summary comment. Human reviewers focus on design, not mechanical checks.

4. Deploy verification (API trigger)

CD pipeline calls routine after production deploy. Routine runs smoke checks, scans error logs for regressions, posts go/no-go to release channel.

5. Docs drift (schedule trigger)

Runs weekly. Scans merged PRs, flags documentation referencing changed APIs, opens update PRs against docs repo.

6. Library port (GitHub trigger)

Runs on pull_request.closed filtered to merged PRs in one SDK repo. Ports the change to a parallel SDK in another language, opens matching PR — keeps libraries in step without human re-implementation.

These aren't hypothetical — they map to the connector ecosystem (Slack, Linear, Google Drive, GitHub) and the network access controls Anthropic provides.

How do routines handle repository access, branch permissions, and connector integrations?

Repository access

Routines need GitHub access to clone repos. When creating from CLI with /schedule, Claude checks if GitHub is connected and prompts /web-setup if not. Two authentication methods exist via the claude.ai interface — OAuth app installation or personal access token.

Each repo is cloned fresh on every run, starting from the default branch unless the prompt specifies otherwise.

Branch permissions

By default, Claude can only push to branches prefixed with claude/. This prevents routines from accidentally modifying protected or long-lived branches. To remove this restriction, enable "Allow unrestricted branch pushes" per repository.

Connectors

Routines use your connected MCP connectors (Slack, Linear, Google Drive, etc.) to read/write to external services. All currently connected connectors are included by default on routine creation. Remove any the routine doesn't need.

Important: MCP servers added locally with claude mcp add are stored on your machine, not your claude.ai account. To use them in routines, add them as connectors at claude.ai/customize/connectors, or declare them in a committed .mcp.json so they're part of the cloned repository.

Network access

Each routine runs in a cloud environment with controlled network access. The Default environment uses Trusted access: package registries, cloud provider APIs, and common dev domains are reachable, but arbitrary domains are blocked (returns 403). MCP connector traffic routes through Anthropic's servers, bypassing network restrictions.

Environment and secrets

Environment variables (API keys, tokens) are set in the cloud environment, not in the prompt. A setup script installs dependencies — the result is cached so it doesn't re-run every session.

How do usage limits, daily run caps, and extra-usage billing work for routines?

Routines draw down your subscription usage like interactive sessions, with additional constraints:

Constraint Detail
Daily run cap Per-account limit on routine starts. View at claude.ai/code/routines
One-off runs Exempt from daily cap — consume regular subscription usage
GitHub webhook caps Per-routine and per-account hourly caps during research preview
Extra usage Organizations with extra usage enabled can exceed caps on metered overage
Without extra usage Additional runs rejected until window resets

The daily cap is visible in the routines dashboard and billing settings. Enable extra usage from Settings > Billing to handle overflow.

Important caveat from Anthropic's docs: "A green status in the run list means the session started and exited without an infrastructure error. It does not mean the task in your prompt succeeded. Open the run to read the transcript and confirm what Claude actually did."

Admins can disable routines organization-wide via the toggle at claude.ai/admin-settings/claude-code. When disabled, existing routines stop and new ones can't be created.

Frequently Asked Questions

Q: Do routines run when my laptop is closed?

Yes. Routines execute on Anthropic-managed cloud infrastructure. This is the key difference from /loop (needs open terminal) and Desktop scheduled tasks (needs machine on).

Q: Can I use routines with repos not on GitHub?

Routines require GitHub-connected repositories for cloning. GitLab, Bitbucket, and self-hosted repos are not currently supported for routine cloning.

Q: What happens if a routine run fails?

The session exits with an error visible in the run transcript. Green status means no infrastructure error — not that the task succeeded. Always review the transcript. Routines don't retry automatically; configure a schedule trigger for recurring attempts.

Q: Can multiple people share a routine?

Routines belong to your individual claude.ai account and are not shared with teammates. Anything the routine does through your connected GitHub or connectors appears as you (commits, PRs, Slack messages use your identity).

Q: What's the minimum schedule interval?

1 hour. Expressions running more frequently are rejected. For sub-hour polling, use /loop in an open session or Desktop scheduled tasks.

Q: How do routines differ from GitHub Actions?

GitHub Actions run deterministic workflows in CI. Routines run AI-powered coding sessions that reason about your codebase and produce intelligent output (PR comments, summaries, analysis). They complement each other — Actions for deterministic CI, routines for intelligent automation.

Glossary

  • Routine: A saved Claude Code configuration (prompt + repos + connectors) that executes autonomously on Anthropic cloud infrastructure
  • Cloud environment: The runtime configuration for cloud sessions, controlling network access, environment variables, and setup scripts
  • MCP connector: An integrated MCP server connected to your claude.ai account that routines can use to read/write external services
  • Trusted network access: The default network policy allowing package registries and cloud APIs while blocking arbitrary domains
  • Daily run cap: Per-account limit on how many routine runs can start per day, visible in the routines dashboard
  • /schedule: The CLI command to create, list, update, or run routines conversationally

Author

Ramsis Hammadi — AI/ML engineer specializing in GenAI, LLM engineering, and automation. Full bio →