Skip to main content

Claude Code Routines: Automate Dev Work 24/7

Set up Claude Code Routines to automate PR reviews, deploy checks, and backlog triage on a schedule, via API, or GitHub triggers.

Kodetra TechnologiesKodetra Technologies
5 min read
Apr 15, 2026
0 views
Claude Code Routines: Automate Dev Work 24/7

Anthropic just shipped Claude Code Routines yesterday (April 14, 2026), and it might be the most practical AI developer feature released this year. You configure a prompt once, point it at a repo, and it runs automatically — on a schedule, from an API call, or when something happens on GitHub. Your laptop stays closed the whole time.

What Are Claude Code Routines?

Claude Code Routines are saved automation configurations that run on Anthropic's cloud infrastructure. Each routine combines a prompt, one or more GitHub repositories, and optional connectors (Slack, Linear, Google Drive, etc.). Once configured, the routine executes autonomously as a full Claude Code cloud session — no approval prompts, no babysitting required.

Routines launched on April 14, 2026 as a research preview. They're available on all paid plans: Pro, Max, Team, and Enterprise.

What You'll Need

  • A Claude Code account on a paid plan (Pro at minimum)
  • Claude Code on the web enabled in your settings
  • A GitHub repository connected to your Claude account
  • About 10 minutes for your first routine

How Do the Three Trigger Types Work?

Every routine needs at least one trigger. You can combine multiple triggers on a single routine.

TriggerHow It StartsBest For
ScheduledRuns hourly, daily, weekdays, or weeklyBacklog triage, docs drift, nightly reports
APIHTTP POST to a dedicated endpointDeploy verification, alert triage, CI/CD hooks
GitHubReacts to PR or release eventsCode review, SDK porting, security checks

Step 1: Open the Routines Dashboard

Head to claude.ai/code/routines and click New routine. You can also create one from the CLI by typing /schedule in any Claude Code session, or from the Desktop app under Schedule > New task > New remote task.

Step 2: Write Your Prompt

Give your routine a clear name and write the prompt Claude will execute each run. This is the most important part. The routine runs without supervision, so your prompt needs to be explicit about what to do and what counts as success.

Here's an example prompt for automated PR review:

Review every open PR in this repository. For each PR:
1. Check for security issues (SQL injection, XSS, exposed secrets)
2. Flag performance concerns (N+1 queries, missing indexes, large payloads)
3. Verify test coverage for changed files
4. Leave inline comments on specific lines
5. Add a summary comment with pass/fail and a confidence score

You'll also pick which model to use from a dropdown — Claude runs that model on every execution.

Step 3: Connect Your Repositories

Add the GitHub repos your routine needs access to. Each repo gets cloned fresh at the start of every run, starting from the default branch. Claude pushes changes to claude/-prefixed branches by default. If you need pushes to other branches, enable Allow unrestricted branch pushes for that repo.

Step 4: Pick Your Environment

Select a cloud environment that controls network access, environment variables (API keys, tokens), and setup scripts (like dependency installs). A Default environment works for most cases. Create custom environments beforehand if you need specific secrets or tools.

Step 5: Configure Your Trigger

For scheduled triggers: Pick from hourly, daily, weekdays, or weekly presets. Times use your local timezone. Need a custom interval like every two hours? Pick the closest preset, then run /schedule update in the CLI to set a cron expression. Minimum interval is one hour.

For API triggers: Select API as the trigger type, save the routine, then copy the generated URL and bearer token. The token shows once — store it somewhere safe. Here's how to call it:

curl -X POST https://api.anthropic.com/v1/claude_code/routines/trig_YOUR_ID/fire \
  -H "Authorization: Bearer sk-ant-oat01-YOUR_TOKEN" \
  -H "anthropic-beta: experimental-cc-routine-2026-04-01" \
  -H "anthropic-version: 2023-06-01" \
  -H "Content-Type: application/json" \
  -d '{"text": "Deploy completed. Run smoke tests."}'

The response returns a session ID and URL so you can watch the run live.

For GitHub triggers: Choose the repository, select an event type (pull request or release), and add optional filters. Filter options include author, title, base branch, head branch, labels, draft status, and more. You'll need the Claude GitHub App installed — the setup walks you through it.

Step 6: Review Connectors and Create

All your connected MCP connectors (Slack, Linear, etc.) are included by default. Remove any the routine doesn't need. Click Create, and the routine appears in your list, ready to fire on the next trigger match.

Click Run now on any routine's detail page to test it immediately.

What Are the Usage Limits?

Routines consume your subscription usage the same way interactive sessions do, plus a daily cap on total runs per account.

PlanDaily Routine RunsPrice
Pro5Included
Max15Included
Team25Included
Enterprise25Included

Organizations with extra usage enabled can exceed these limits on metered overage. Check your remaining runs at claude.ai/settings/usage.

How Does This Compare to GitHub Actions?

FeatureClaude Code RoutinesGitHub Actions
IntelligenceFull AI reasoning per runScript-based, no AI unless you add it
SetupWrite a prompt, pick triggersWrite YAML workflow files
FlexibilityAdapts to context each runFollows fixed steps
TriggersSchedule, API, GitHub eventsGitHub events, schedule, manual
CostIncluded in Claude plan + usageFree tier + per-minute billing
Best forReview, triage, analysis tasksBuild, test, deploy pipelines

Routines don't replace CI/CD. They complement it. Use GitHub Actions for builds and deploys. Use Routines for the thinking work — reviewing PRs, triaging bugs, updating docs.

FAQ

Can I use Routines from the CLI only? You can create scheduled routines via /schedule in the CLI. API and GitHub triggers require the web UI at claude.ai/code/routines to configure.

Do Routines work with private repositories? Yes. Connect your GitHub account via /web-setup in the CLI or through the web settings. The routine clones repos using your connected GitHub identity.

What happens if a routine fails mid-run? Each run creates a session you can open and inspect. You'll see exactly what Claude tried, where it stopped, and can continue the conversation manually from that point.

Is this the same as Desktop scheduled tasks? No. Desktop scheduled tasks (created via New local task) run on your machine and need it to stay on. Routines run on Anthropic's cloud infrastructure — your laptop can be off.


If you found this useful, subscribe to CodeBrainery for more step-by-step tutorials like this — new guides drop daily. You can also follow us to get notified when we publish something new. Got questions? Drop them in the comments.