Claude Code Routines — Automate Your Dev Work While You Sleep (2026)

Claude Code That Works While You Sleep
I opened a pull request on GitHub. I didn't tell anyone. I didn't run any command. Within a minute, Claude posted a full code review on the PR — automatically, while my laptop was closed.
That's a Routine. Anthropic shipped it about ten days ago and it changes how Claude Code fits into your day. Instead of you opening a terminal and prompting Claude reactively, Claude becomes the thing that pings you — with PR reviews the moment a teammate opens one, with a daily standup brief in your Slack, with alerts when something needs attention.
This guide walks you through building two real routines: an auto PR reviewer triggered by GitHub events, and a daily standup brief that runs on a schedule.
What a Routine Actually Is
A Routine is a saved Claude Code configuration — a prompt, a repository, and connectors — that runs automatically on Anthropic's cloud. Three things make it different from a normal Claude Code session:
- It runs without you. A schedule, a GitHub event, or a webhook triggers it.
- It runs in the cloud. Your laptop can be closed. Wifi off. It still runs.
- It's a full Claude Code session. It reads files, makes commits, opens PRs, posts to Slack, sends emails — anything Claude Code can do, a Routine can do automatically.
Until now, Claude Code was reactive. Routines flip that. Every developer has tasks they do every morning, every Monday, every deploy. Routines automate those — included with your Claude plan.
Plan Limits — Read This Before You Build
Routines count against your normal Claude usage, plus they have a daily run cap on top:
- Pro plan: 5 runs per day
- Max plan: 15 runs per day
- Team and Enterprise: 25 runs per day
If you're on Pro and you set up something hourly, you'll burn through your budget by lunch. Pick the cadence carefully — most useful routines run once a day or once a week, not constantly.
Step 1: Open the Routines Tab
Open the Claude desktop app and click the Code button to enter the Claude Code section. In the left sidebar you'll see a Routines tab. Click it, then click New routine.
You'll be asked to pick Local or Remote:
- Local — runs on your machine. You'd need to keep your computer on for the routine to fire.
- Remote — runs on Anthropic's cloud. Your laptop can be closed. This is what we want.
Pick Remote. The form opens with five sections: name, instructions (the prompt), repository, trigger, and connectors.
Step 2: Build the PR Auto Reviewer
Name and Prompt
Name the routine PR Auto Reviewer. For the instruction prompt, paste this:
A pull request was just opened on this repository. Review it carefully and post a comment on the PR with:
1. A one-line summary of what the PR changes
2. Any potential bugs, edge cases, or security concerns you spot
3. Suggestions for improvement (if any)
4. A clear verdict: ready to merge, needs changes, or blocking issue
Keep the comment focused and friendly. Use GitHub markdown for formatting.
The prompt is the most important part. Routines run autonomously with no human in the loop, so write it like you're handing instructions to a contractor — be explicit about what to do and what success looks like.
Pick the model you want to use. I selected Opus 4.7 for code review quality.
Pick the Repository
Click the repo selector and pick the GitHub repository you want this routine attached to. Each run starts fresh from the default branch. You can attach multiple repos to a single routine if needed.
Add the GitHub Trigger
Click Add trigger and pick GitHub event. The first time you do this, you'll be asked to install the Claude GitHub App on your repository — pick the GitHub account, then confirm the install. This grants the routine access to the repo events.
Once installed, you'll see four event options:
- PR opened
- PR merged
- Release published
- Issue opened
Pick PR opened. You'll see a warning that this fires on every matching event — which can blow through your daily quota fast on a busy repo. Add a filter to narrow it.
I added an Author filter set to my own GitHub username — so the routine only fires when I open a PR. You can also filter by branch, labels, draft status, or whether the PR comes from a fork.
Review Connectors
Below triggers, you'll see all your connected MCP integrations — Slack, Linear, Google Drive, Gmail, anything else you've connected. By default, the routine can use all of them. Best practice: remove the ones this routine doesn't need so Claude only has access to what it actually requires.
Click Create. The routine is live.
Step 3: Test It with a Real PR
Switch to GitHub. Make a small code change in the repo, commit to a feature branch, and open a PR. The moment the PR is created, the routine fires.
Switch back to the Claude desktop app, open the Routines tab, and you'll see a new run in progress. Click the run to watch the live session — Claude is reading the PR, looking at the diff, forming its review.
When it finishes, switch back to GitHub. The PR now has a detailed review comment from Claude — summary, potential issues, suggestions, verdict. From PR open to review posted: under a minute. No human touched anything in between.
Step 4: Build a Scheduled Standup Brief
Now let's build a second routine that runs on a schedule instead of an event.
Click New routine again. Name it Daily Standup Brief and use this prompt:
Read all open PRs and recent commits in the repository. Post a Slack message to my standup channel with:
- What landed yesterday
- What's in flight (open PRs)
- Anything blocked or stale (PRs older than 3 days)
Keep it under 10 lines. Use bullet points.
Pick the same repository. For the trigger, click Schedule and set it to Daily at 9:00 AM. The minimum schedule interval is one hour — that's a hard limit.
Make sure your Slack connector is enabled. Click Create.
Step 5: Test the Schedule with "Run Now"
You don't have to wait until tomorrow's 9 AM to verify it works. Click Run now on the routine card. The routine fires immediately using the same configuration as the scheduled run.
Open Slack. Within seconds you'll see the standup digest message — what landed, what's in flight, what's blocked. The same routine will fire automatically tomorrow morning at 9 AM, and every weekday after that.
The Three Trigger Types
| Trigger | Best For |
|---|---|
| Schedule | Recurring work — daily standups, weekly reports, dependency checks. Minimum 1-hour interval. |
| GitHub event | Code-driven work — PR reviews, release notes, CI failure analysis, issue triage. |
| API trigger (webhook) | Everything else — your monitoring tool, status page, or any service that can POST to an endpoint. |
You can stack triggers on the same routine. A PR reviewer can fire on GitHub events and run nightly to catch anything that slipped through.
Where Routines Actually Win
Routines aren't a chatbot upgrade. They're the moment Claude Code becomes a teammate that works while you sleep — reviewing PRs, drafting standup notes, catching stale issues, sending you the morning brief.
Pick the work you do every day or every week. Automate the highest-friction one first. With Pro you get 5 runs a day, with Max you get 15 — both are enough to cover the daily-routine use case if you're deliberate about cadence.
Useful Links
- Claude Code Routines: claude.ai/code/routines
- Official docs: code.claude.com/docs/en/routines
- Anthropic announcement: Introducing Routines in Claude Code