Claude Code Routines first look: GitHub, calendar and audits
Watch on YouTube ↗ Subscribe on YouTube ↗
Written guide: Claude Code Routines: Scheduled Tasks, PRs and Email
A first look at Claude Code Routines, announced April 14, 2026 in preview: saved prompts that run on a schedule, a GitHub event or an API call. Mike keeps a daily email triage routine, adds a GitHub security audit on pull requests and a calendar update, then creates a daily site speed audit and a weekly blog strategy routine from the Claude Code command line. Routines use plan credits, with a Pro plan allowing five included runs a day, and Mike reaches about 90 percent usage.
Video summary
The video covers 11 parts: Introduction to Anthropic Routines, Feature Overview: PR Reviews, Backlogs & Events, Case Study: Daily Email Triage Routine, Setting Up GitHub Event Triggers for Security, Manually Running vs. Automated Schedules, Connecting Google Calendar for Daily Notifications, Analyzing Security Risks in Open Pull Requests, Using the Claude Code CLI for Routine Setup, Automated Speed Tests for TubeAnalytics.net, Weekly Content Strategy & Auto-Commit Agent, and Troubleshooting Session Tokens & Credit Usage.
What this video covers
What you build
Several Claude routines: a daily email triage, a GitHub pull request security review, a Google Calendar update, a daily site performance analysis and a weekly blog content strategy file committed to a repo.
Tools used
Key steps
- 0:11 - Read the announcement: routines can work through a backlog, review pull requests and react to events in the cloud.
- 1:21 - Look at the daily email triage routine, which categorizes, summarizes and drafts replies.
- 1:57 - Create a routine triggered by GitHub events to review pull requests for security issues.
- 4:01 - Run it manually and see it start.
- 5:02 - Add a daily Google Calendar update using a connector.
- 6:14 - Read the security review of four open pull requests, rated medium concern.
- 7:05 - Create a routine from the Claude Code command line and fix a 401 error by logging in again.
- 10:49 - Create a weekly blog strategy routine that commits a strategy document.
- 11:54 - Notice credit use climbing and troubleshoot session tokens.
Not covered
- Whether the speed audit produces useful data, since the site returns 403 to the automated requests.
- The strategy document produced by the weekly routine, which is still running at the end.
- A YouTube connector, which is not available, so the comments report is dropped.
- Costs. Mike says creating routines in the command line burns many tokens and recommends the web interface.
In this video
- 0:00 Introduction to Anthropic Routines
- 0:11 Feature Overview: PR Reviews, Backlogs & Events
- 1:21 Case Study: Daily Email Triage Routine
- 1:57 Setting Up GitHub Event Triggers for Security
- 4:01 Manually Running vs. Automated Schedules
- 5:02 Connecting Google Calendar for Daily Notifications
- 6:14 Analyzing Security Risks in Open Pull Requests
- 7:05 Using the Claude Code CLI for Routine Setup
- 7:51 Automated Speed Tests for TubeAnalytics.net
- 10:49 Weekly Content Strategy & Auto-Commit Agent
- 11:54 Troubleshooting Session Tokens & Credit Usage
Questions and answers
What triggers a routine?
A schedule, a GitHub event or an API call, per the video.
How many runs does Pro include?
Mike says five included daily runs.
Which way is cheaper to create them?
The web interface, according to Mike, because doing it in Claude Code used a lot of tokens.
Keep learning
Transcript
Hey there, welcome to the channel. In this video I'm going to take you through how to get started using Anthropic's new routines, which are essentially automated work that you can complete inside Claude Code. I've got the official blog article pulled up here, which was published on April 14th. So this has only been live for 4 days and it's currently a preview release. Essentially, what this allows you to do is work through your backlog, review your PRs, and respond to events in the cloud.
So that could either be an API call or in response to an event like let's say every time I push a new version to my GitHub repository, it can do a security audit or speed test or, you know, any number of things. Routines ship with access to your repos and your connectors, so you can easily connect up different apps, no different from something like Manis or OpenClaw, which is kind of what this is going after is the OpenClaw crowd. So here's how it works.
Read the rest of the transcript
You basically just give it a name, you give it a prompt, and then you can either set a schedule, an event, or API call. In order to get started, all you have to do is come over here to claude.ai/clauderoutines, and you can create a routine. In my case, I'm currently on the pro plan of Claude Code, so I only have five included daily runs available. I've already set up something for email triage, which here's the instructions.
You can review the inbox for new and unread emails, and then for each email it's just going to categorize them, summarize them, and draft a response. So as you can see, this is already running automatically every day. And this is the review for yesterday. It just shows some of the actions that I need to attend to in my email inbox, as well as the summaries of each email. So this is really handy.
Instead of going back and forth to Gmail, I can just easily summarize all of my emails and get alerted of anything that needs action. So that's really handy, but in this case, I really want to set up something which will trigger on an event, such as every time I push to my GitHub. So I would like to do like a security audit. And we're just going to paste in review this PR for security issues.
I'm going to go ahead and select my repository, which is private right here. And then we're just going to select GitHub event. So I've already installed the GitHub app inside Claude Code. You can see I've just done that inside the terminal over here. And I can press enter. And then we can just go ahead and install that. I can say create a long-lived token with the Claude subscription, and that's just going to open up a new window, and then I can authorize the command line interface
to the GitHub app. And it says actually failed to access repository. Maybe it's because it's private. I'm not entirely sure. But in this case, it shouldn't really matter that much because it looks like it already has access to it. And then this is just going to fire on every matching event. And this all This is also going to use my credits as well, just so you know. We can add that trigger. And now that's going to trigger every time I get a pull request.
I can also do the same for push requests as well. Uh but that's about it for this, and then we can also set the permissions. So here I'm going to turn that off, and we're going to click on create. And this is just going to review the push. And now if I run this, it's starting to run. As you can see here, this is a manual run, but normally if I were to push something to GitHub, like get commit and push over here, it would run
every time I put something new up onto GitHub. So that's just going to do a security audit. There are ways also to do this over here inside something like Claude Code. So if I came over to my Claude Code here, I could do security review. And that's essentially going to do something very similar, which is going to review the security of my platform. Uh so that's really handy to have access to, and it's doing that right now over here.
Now if I want to set up another one, I could create a new routine, and then I can also just set trigger. So run on a recurring cron schedule, and here you're just going to set your time. So I'll just make it 10:00 a.m. daily. In this case, I would like to get a report from my YouTube channel with comments. So we're just going to paste that in here, and then we say YouTube comments. We'll see if it can actually do this.
Here we would add a connector, and then here you can just select manage connectors. And we should be able to add YouTube in here. I'm assuming they have some sort of API, although I'm not entirely sure. If we go to connectors here, we've only got a few. So either Google Calendar or Google Drive. So it looks like I probably won't be able to use YouTube for this. We could do Google Calendar. So I'm just going to connect up my Google Calendar real quick.
And we can get notifications of events that are on my calendar. So we're just going to go ahead and approve that. And this is very similar to something like OpenClaw or Manis. I've used Manis before, which is very similar to this. Uh so here we're just going to say calendar notifications. And give me give me a list of upcoming events on my calendar. And then in that case, we're just going to add that connector. Here there's Google Calendar, so we're just going to do that.
Calendar update. And we're just going to set that as well. So that's going to run every day at 9:00 a.m. It's just going to give me an update on my calendar if I have any important events for the day. So now we've got that routine, and we should have a few other ones in here as well. So we'll just refresh that. As you can see, I've got the calendar update, the security audit, and also the email triage here. Now we'll see this one is still running.
It has essentially taken my entire GitHub repo, the latest version, and it's giving me a security review for all four open PRs. So here's the full review. It says overall medium concern, needs verification before merging. And we have a few other ones in here as well, and it gives it a risk tolerance level as well. So here's the things that I would want to fix. And that's pretty much all there is to it.
So this is going to run every time I push a new version of my web app to GitHub. That's really, really handy. We can create another routine, and we can also And again, if you want to read through the docs for any other use cases or templates that you might want to use, you can go ahead and do that as well. And you can also create this from the command line interface. You just click on schedule.
So if I came over here to schedule, I could do it over here as well, inside the command line. And that should do essentially the same thing. We can set up a routine from within Claude Code over here. And it's going to create a scheduled routine conversationally, and then you can pass a description directly, such as schedule daily PR review at 9:00 a.m. I'm just going to say create routine directly from within Claude Code. So now it's asking, "What should the scheduled agent do?
Describe the task and include what repo repo files to work on, what actions to take, commit, open PR, just analyze." So in this case, we'll just say "Just analyze the speed." It could do that as well, and then it could just generate a report, which I would get every day at 9:00 a.m. It's asking a few quick questions, so we're just going to run this daily.
And it's asking, "What should the agent do with its findings?" I'll just going to say "Just analyze, no changes." And then it's asking for the site URL, which is tubeanalytics.net. So it's going to run daily. It's just going to analyze it on this URL. So we'll submit the answers. And that's going to submit that routine, which we should see appear over here. And it's asking what time daily. Since I'm in Bangkok, I'm going to run this at 8:00 a.m. Bangkok time.
And now it should create this routine within a few seconds here. So you don't necessarily need to use the web interface. You could also use the command line, or you could use VS Code or whatever you're running Claude Code in. And now it's saying create the scheduled agent. I'm going to say "Yes, go ahead and create that." It's going to create the routine. It had a 401 error, it looks like, so maybe it's not going to be able to do this.
We'll see if this actually works. It's saying auth is failing on remote trigger API. Likely a session token expired or not connected. Let's just go ahead and refresh the Claude AI session. I'm going to select two here. If I type Claude auth login, it's going to ask me to log in with my browser over here. We're just going to go ahead and authorize that. And now it should be able to create the routine. So I'll just say continue here.
Okay, so now it was able to trigger that remotely, and you can see the trigger ID, the next run, and also manage. So if I click on this, we can go ahead and manage that routine. I'm just going to open it up real quick. And it created the prompt automatically here. It just says "Your performance analysis agent for tubeanalytics website. Your job is to run a daily speed and performance audit. Do not make any changes to files or commit anything.
This is for analysis only." So this is pretty cool. It's just going to run a speed test every day at 8:00 a.m. I'm not exactly sure how useful this is going to be, but if I just go ahead and click on run now, it'll run the speed test, and it'll be interesting to see what the output is here. There we go. So now it's running the live TTFB test and header checks in parallel, and then it's going to scan the code base.
All pages are returning 403. So it looks like it's blocking the curl bot requests unfortunately. We'll see if it's able to get past that. But right now it's doing a performance code analysis and it should be able to do the speed test. So this is pretty cool that you're actually able to run things automatically every time an event happens or you know like from an API call. And again, I could do the exact same thing if I wanted to schedule another event.
So let's say I want to create new blog articles for the site. This will just create a content strategy plan. And now it's going to ask me a few qualifying questions. Uh it's either commit a strategy doc or it's just going to analyze. In this case I want to commit the strategy doc so it will generate a blog content strategy.md file and it's going to put that in my repository. And we could do this weekly every Monday.
We're just going to go ahead and submit and that'll create yet another routine for uh Claude Code. And again, I'm just going to go ahead and open up routines and we should see that new routine right here. So there it is, the daily site speed audit. We can click on that and preview it real quick. Uh keep in mind that this is using my credits as well.
So if I come back over to the terminal here and I do uh usage you can see that it is using a lot of credits. So I've already at 90% credit usage just from this routine that's running over here. I'm going to go ahead and stop this because it's using a lot of credits. But we'll just go ahead and continue creating this new trigger here.
And this is going to run every Monday so it'll just, you know, create a list of blog articles that I might want to write. Looks like it has an error but it is now executing the remote trigger to create the routine, weekly blog content strategy, right there. And it just says test prompt for TubeAnalytics blog strategy agent because it hasn't actually finished running this yet. It's burning through a lot of tokens just to do this so I would not recommend doing this inside Claude Code.
It's better just to create it using the web interface over here. But we'll see if this can actually finish. There we go. So it was finally able to create the weekly blog content strategy routine. There's the schedule so it's going to run every Monday at 8:00 a.m. Bangkok time and the next run is going to be in a few days and output's going to be blog content strategy.md and that's going to go directly into my repository.
It says you are a blog content strategy agent for TubeAnalytics, YouTube Analytics as software as a service, do these steps. And this is all in one line so it's just going to read the blog post all the slugs, titles, target keywords, assign each a topic cluster from these different categories. If I just go ahead and click on run here, it's going to start that workflow and this is also going to run every day at 8:00 a.m.
It's going to read in all sections and load the key pages in parallel and then it's going to suggest other blog articles that I may want to write. So it's right now it's just looking through my comparisons, it's reading all my project details uh and it's doing everything here. So you can see it just pulled in all of my blog articles and it's going to suggest other blog articles that I may want to write and any gaps that I'm missing in my content strategy.
So we'll see how long this takes to run. So thank you so much for watching this tutorial. Hopefully it is helpful for you. Please go ahead and subscribe to the channel if you haven't already and I will see you in the next one. Take care, stay safe, peace from Thailand, signing off.



