- Maya (Applied AI team at Anthropic) introduces "routines," a new Claude Code feature that turns Claude Code from a tool that waits for you into a proactive teammate that notices problems and acts on them.
- Routines run on Claude Code's managed infrastructure, are triggered by schedules or events (including GitHub events and custom webhooks), and remain interactive and steerable like a normal Claude Code session.
- The talk walks through a real Anthropic use case — automating documentation creation — and a framework of three decisions per routine: trigger, context, and steerability.
Build a proactive agent workflow with Claude Code
- Building proactive agents today is painful: deciding where they run (not your laptop), managing hosting/persistence/auth, figuring out triggers, and being unable to watch, steer, or resume headless sessions — routines address all three.
- A routine is an automation defined only by a prompt, the repos to connect, the connectors available, and a trigger; Claude Code handles hosting, session state, and connectors on its managed infrastructure so nothing depends on your laptop being open.
- Triggers come in two kinds: time-based (e.g. a weekly docs review) and event-based, including native GitHub events (issue opened, release cut, labeled PR merged) and custom events posted to webhooks with the payload as context.
- Context is the ceiling on success: give the routine access to the right code repos plus extra context (Google Drive for marketing briefs, Slack to ping you), because whatever context Claude has determines how successful it can be.
- Steerability options include agent-on-agent review (the generator/critic pattern — one routine creates a docs PR, another triggers on that PR to leave comments), opening the live session on the web to nudge or resume Claude, and verifying outputs by rendering the changed page.
- The real Anthropic example: weekly PRs for Claude Code rose 200%, overwhelming the single docs engineer, so "Sarah" used
/scheduleto create routines that diff merged changes against the docs repo and open PRs, plus an issue-triggered routine that investigates documentation gaps. - Routines apply to many workflows — a deploy verifier triggered by a CD webhook with monitoring tools and Slack/Twilio alerts, an on-call investigator, or a PM backlog triager — moving from reactive agents that wait for enter to proactive agents that react to problems and open PRs themselves.
Routine — A Claude Code automation defined by a prompt, repos, connectors, and a trigger that runs on managed infrastructure.
Proactive agent — An agent that notices when something breaks and acts on it, rather than waiting for a user prompt.
Trigger — The condition that starts a routine: time-based (schedule) or event-based (GitHub events, custom webhooks).
Managed infrastructure — Claude Code's hosted environment that handles hosting, session state, and connectors for routines.
Connector — An integration (GitHub, Slack, Google Drive, MCP) that gives a routine access to external tools and context.
Headless session — A Claude Code session run without an interactive terminal, historically hard to watch or steer.
Generator/critic pattern — A multi-agent setup where one agent produces output and another critiques it, used for agent-on-agent review.
/schedule — The Claude Code command used to create a routine.
Human in/out of the loop — Whether a person actively monitors and steers an agent or lets it run autonomously.
Hello everyone. How are you? Good. Okay, amazing. Welcome to the last workshop session of the day. I hope you've all enjoyed the very first day of Code with Claude. My name is Maya. I'm a member of our Applied AI team here at Anthropic. What that means is I spend about half my time developing our own first-party products and features, and the other half helping customers develop their very own products, features, and agents on top of our models. Today, I'm here to talk to you about how to build a proactive agent workflow with Claude Code. Can I get a show of hands? Who has used our routines feature inside of Claude Code? Some folks over here. Awesome. That's what I'm going to be talking about today.
So first off, a question for the group. Who has tried to run Claude Code on a cron? Put your hands up high. Now, keep your hands up if you've enjoyed building all of that infra and maintaining that job. We have one guy back there. Thank you for your effort. We felt similar pain internally at Anthropic as we tried to develop proactive agents that run on Claude Code, and we decided to do something about it. We believe that coding agents shouldn't wait for you to press enter to get started. Right now, Claude Code is a really powerful coding tool, but we want to take Claude Code and turn it into a really powerful coding teammate. A teammate notices when something breaks and does something about it. Right now, a tool waits for you to enter your prompt and press enter. So the goal of today's presentation is to talk about how we have created this feature called routines to take Claude Code from a tool today into the teammate of tomorrow.
Today we'll be talking about four things. I'll go through some of the challenges that you folks have felt building proactive agents today. I'll go through this new feature inside Claude Code called routines. We'll go through a real example about how we use routines internally at Anthropic to automate documentation creation. And finally, we'll talk about applying routines to your own workflows.
First, the challenges with building proactive agents today. The first thing that's difficult is deciding where these agents should run. You probably don't want them running on your local machine, because if you close your laptop or it dies, your agent session is done. That means you'll need to manage things like hosting, data persistence, and authentication — a whole infra stack outside of your prompts, which is doable but a lot of boilerplate. The next thing is figuring out when to actually kick off these sessions and trigger these agents. You can build on top of cron, or post to endpoints you have to spin up, but again there's a lot of infra to build yourself. Finally, sometimes you want to be a human in the loop, but other times a human out of the loop. Right now when you kick off a headless Claude Code session, it's often hard to figure out what your agent is actually doing in real time. There's no way to watch, steer, bound, or resume your agent session. So we wanted to address each of these three issues and build routines.
Routines is a brand new feature inside Claude Code. It's an automation where you can kick off a remote Claude Code session by only defining the prompt, what repos you want to connect it to, what connectors it has available, and a trigger. Claude Code handles the rest. There were three main things we were thinking about as we developed this. First, we wanted these agents to be always available. These routines run on Claude Code's managed infrastructure, and we deal with the hosting, the session state, and the connectors for you. Nothing depends on your laptop being open. Next, we want these agents to work proactively with customizable triggers. You might kick them off on a time-based schedule, or work event-based. We have the ability to work natively with GitHub events, as well as your own custom events that you can post to webhooks and endpoints with the event payload as context. Finally, these Claude Code sessions launched with routines are interactive and steerable as if you were launching Claude Code in the terminal. Every routine is really just a Claude Code session under the hood that you can open, watch, follow up on, steer, and resume from web, CLI, and desktop.
I want to walk you through a real use case we use here at Anthropic internally. The question for us and a member of our engineering team is: how can we automate docs creation with routines? To add a little data behind this, weekly PRs for Claude Code have gone up 200% since the beginning of the new year. This has been awesome for our Claude Code engineering team — their productivity is insane. This has been awesome for you folks because you get new features very quickly. The one person this has not been so awesome for is the one engineer responsible for maintaining our documentation across Claude Code and the agent SDK. When routines launched, she was a super big fan and early adopter. I want to walk you through how she set up a couple routines to help automate documentation creation.
On my side here, I have the terminal open. I encourage you to open your terminal and launch Claude Code. Inside the terminal, I can type /schedule and type in something that Sarah, our documentation queen, has done to set up this routine. She typed in: once a week, "Please review all the new changes merged to main against our documentation repo and create a PR to update docs if you see any changes." I encourage you to think right now: what are some tasks you do every day that would help if they could run on a schedule or if Claude Code could initiate these sessions for you? After kicking this off, Claude comes back and prompts me with a couple questions. It might ask, "Hey Maya, what time every week do you want me to kick this off? Once I create a PR, do you want me to notify you, maybe ping you on Slack?" Once I answer, Claude creates a routine that we'll view inside Claude Code on the web.
First, the three main decisions you'll make as you create any routine. The first decision is when your routine should trigger — what's the event, or is there a cadence you want this to run on? The second is what context or information Claude needs to be successful. The third is how you actually steer Claude in the session to keep it honest.
The first one is the trigger. Inside routines, there are two ways. You can have things kick off on a schedule, a time-based trigger. For that earlier example, this is how we do a weekly review of differences between our source code and our documentation repo. You can also have routines kick off on an event-based cadence. Maybe every time a release is cut, you can diff the release branch against the docs. Or maybe engineers deploying changes tag their PRs with a label that says "need docs," and you kick off Claude Code sessions anytime one of these labeled PRs gets merged.
The next thing is context. What does your agent need to know? Likely you'll give it access to one or more codebase repos. For this docs example, we give Claude access to our Claude Code source code to figure out what new changes exist, and also our docs repo for Claude to create new PRs. You might provide additional context — maybe I want Claude to have access to all our existing marketing briefs so it uses similar language. If that lives in Google Drive, I'll hook up the Drive connector. Or anytime Claude creates a PR, I want it to ping me on Slack, so I give it the Slack connector. It's important to think about this because whatever context Claude has, that's the ceiling of how successful Claude will be.
Finally, steerability. How do we ensure the quality of Claude's outputs? One thing I think is interesting is to invest in agent-on-agent review. If you've designed multi-agent systems and heard of the generator/critiquer pattern, we've borrowed it here. You can set up one routine to create docs PRs, and another routine that triggers on that PR's creation to leave comments before a human gets to it. Another option: we emphasized it's nice to have a human out of the loop, but sometimes you need to monitor these sessions and nudge Claude in a different direction. You can open Claude Code on the web and view what's happening in a live session as if working in the terminal. You can ask it questions mid-session, push it in another direction, and resume a past routine or session to continue the conversation. Finally, we verify Claude's outputs. For this documentation example, we render the documentation page Claude changed and confirm those outputs are what we expect.
Now I'll jump back into the routine we kicked off. I'm in Claude.ai, I go to the left side panel, click the code button, and jump into routines. I click on this routine I created earlier. On the left, it's connected to two repositories — our mocked-up Claude Code source code and our Claude Code documentation. It runs every Monday at 10:00 a.m. and is connected to GitHub and Slack. These instructions on the right Claude generated based on the initial prompt and my answers. This is a weekly documentation sync for our Claude Code fork. I click on a session and see the initial instructions pasted at the beginning of this Claude Code session. Claude has read these, started by looking at the source code repository for recent merged PRs, looked at our change log, compared that to the documentation repo, found some changes, and opened a PR for me.
Now I want to show another example where we kick off a routine based on a GitHub event. I've created a new routine and filled some of it in. I want this to trigger every time I create a new GitHub issue. I pasted instructions to investigate the issue this session triggers on, figure out if it's a documentation gap, and if so, open a PR and ping me in this channel. I've connected our Claude Code documentation repo and source code. Like I mentioned, there are two trigger types, schedule-based and event-based, and within event-based we have native GitHub events as well as the ability to trigger from your own code by sending a post request. Here I create a GitHub event trigger on issue opens, connected to Slack and our GitHub MCP. I have a new issue to create in our Claude Code docs repo — I happen to know a few tools are missing from docs in this new version. I create it, refresh the page, and see a new run picked up. The initial instructions are the first prompts, and the additional context from the issue was passed in. I happen to know I already have another PR open for this, so let me just guide Claude to stop this session — showing the ability to steer Claude in real time after a routine kicks off.
Now let's talk about ways to use routines to automate your challenges as developers. The first is a deploy verifier. Maybe you recently deployed changes to a service and want to make sure it's healthy and you shouldn't roll back. I think about this in three ways: what should my trigger be, what context is important to provide, and how do I plan to steer this routine? My CD pipeline can post after every deploy, so that's a good trigger — I post to a webhook that routines support. For context, it's nice to give Claude access to the source code for the service, and access to monitoring tools — DataDog, Grafana, whatever you use. If something goes down, I want Claude to alert me on Slack, email, or even text using Twilio. For steering, maybe I start by having Claude run an investigation and give me a go or no-go decision to roll back. I can jump into Claude Code on the web and read Claude's analysis. Then I can continue to work with Claude to roll back a change. Eventually, as I trust its decisions, I can let Claude roll back the change itself based on the monitoring data. Other challenges: an on-call investigator, or a PM going through a backlog of GitHub issues or Slack posts, kicked off on a time-based trigger, given access to GitHub and Slack, using Claude to prioritize and open PRs for the most important issues.
My final takeaways: Proactive agents beat reactive agents. We want Claude to go from a tool to a teammate. You can move from an agent waiting for you to press enter to an agent that reacts to problems and opens a PR itself. We built routines so you don't have to focus on maintaining all of this infra, but instead concentrate on your domain and process expertise. Finally, I encourage you to get started with routines today. You're a single /schedule command inside Claude Code away from creating your very first routine. Awesome. Thanks so much.
TL;DR
- Maya (Applied AI team at Anthropic) introduces "routines," a new Claude Code feature that turns Claude Code from a tool that waits for you into a proactive teammate that notices problems and acts on them.
- Routines run on Claude Code's managed infrastructure, are triggered by schedules or events (including GitHub events and custom webhooks), and remain interactive and steerable like a normal Claude Code session.
- The talk walks through a real Anthropic use case — automating documentation creation — and a framework of three decisions per routine: trigger, context, and steerability.
Takeaways
- Building proactive agents today is painful: deciding where they run (not your laptop), managing hosting/persistence/auth, figuring out triggers, and being unable to watch, steer, or resume headless sessions — routines address all three.
- A routine is an automation defined only by a prompt, the repos to connect, the connectors available, and a trigger; Claude Code handles hosting, session state, and connectors on its managed infrastructure so nothing depends on your laptop being open.
- Triggers come in two kinds: time-based (e.g. a weekly docs review) and event-based, including native GitHub events (issue opened, release cut, labeled PR merged) and custom events posted to webhooks with the payload as context.
- Context is the ceiling on success: give the routine access to the right code repos plus extra context (Google Drive for marketing briefs, Slack to ping you), because whatever context Claude has determines how successful it can be.
- Steerability options include agent-on-agent review (the generator/critic pattern — one routine creates a docs PR, another triggers on that PR to leave comments), opening the live session on the web to nudge or resume Claude, and verifying outputs by rendering the changed page.
- The real Anthropic example: weekly PRs for Claude Code rose 200%, overwhelming the single docs engineer, so "Sarah" used
/scheduleto create routines that diff merged changes against the docs repo and open PRs, plus an issue-triggered routine that investigates documentation gaps. - Routines apply to many workflows — a deploy verifier triggered by a CD webhook with monitoring tools and Slack/Twilio alerts, an on-call investigator, or a PM backlog triager — moving from reactive agents that wait for enter to proactive agents that react to problems and open PRs themselves.
Vocabulary
Routine — A Claude Code automation defined by a prompt, repos, connectors, and a trigger that runs on managed infrastructure.
Proactive agent — An agent that notices when something breaks and acts on it, rather than waiting for a user prompt.
Trigger — The condition that starts a routine: time-based (schedule) or event-based (GitHub events, custom webhooks).
Managed infrastructure — Claude Code's hosted environment that handles hosting, session state, and connectors for routines.
Connector — An integration (GitHub, Slack, Google Drive, MCP) that gives a routine access to external tools and context.
Headless session — A Claude Code session run without an interactive terminal, historically hard to watch or steer.
Generator/critic pattern — A multi-agent setup where one agent produces output and another critiques it, used for agent-on-agent review.
/schedule — The Claude Code command used to create a routine.
Human in/out of the loop — Whether a person actively monitors and steers an agent or lets it run autonomously.
Transcript
Hello everyone. How are you? Good. Okay, amazing. Welcome to the last workshop session of the day. I hope you've all enjoyed the very first day of Code with Claude. My name is Maya. I'm a member of our Applied AI team here at Anthropic. What that means is I spend about half my time developing our own first-party products and features, and the other half helping customers develop their very own products, features, and agents on top of our models. Today, I'm here to talk to you about how to build a proactive agent workflow with Claude Code. Can I get a show of hands? Who has used our routines feature inside of Claude Code? Some folks over here. Awesome. That's what I'm going to be talking about today.
So first off, a question for the group. Who has tried to run Claude Code on a cron? Put your hands up high. Now, keep your hands up if you've enjoyed building all of that infra and maintaining that job. We have one guy back there. Thank you for your effort. We felt similar pain internally at Anthropic as we tried to develop proactive agents that run on Claude Code, and we decided to do something about it. We believe that coding agents shouldn't wait for you to press enter to get started. Right now, Claude Code is a really powerful coding tool, but we want to take Claude Code and turn it into a really powerful coding teammate. A teammate notices when something breaks and does something about it. Right now, a tool waits for you to enter your prompt and press enter. So the goal of today's presentation is to talk about how we have created this feature called routines to take Claude Code from a tool today into the teammate of tomorrow.
Today we'll be talking about four things. I'll go through some of the challenges that you folks have felt building proactive agents today. I'll go through this new feature inside Claude Code called routines. We'll go through a real example about how we use routines internally at Anthropic to automate documentation creation. And finally, we'll talk about applying routines to your own workflows.
First, the challenges with building proactive agents today. The first thing that's difficult is deciding where these agents should run. You probably don't want them running on your local machine, because if you close your laptop or it dies, your agent session is done. That means you'll need to manage things like hosting, data persistence, and authentication — a whole infra stack outside of your prompts, which is doable but a lot of boilerplate. The next thing is figuring out when to actually kick off these sessions and trigger these agents. You can build on top of cron, or post to endpoints you have to spin up, but again there's a lot of infra to build yourself. Finally, sometimes you want to be a human in the loop, but other times a human out of the loop. Right now when you kick off a headless Claude Code session, it's often hard to figure out what your agent is actually doing in real time. There's no way to watch, steer, bound, or resume your agent session. So we wanted to address each of these three issues and build routines.
Routines is a brand new feature inside Claude Code. It's an automation where you can kick off a remote Claude Code session by only defining the prompt, what repos you want to connect it to, what connectors it has available, and a trigger. Claude Code handles the rest. There were three main things we were thinking about as we developed this. First, we wanted these agents to be always available. These routines run on Claude Code's managed infrastructure, and we deal with the hosting, the session state, and the connectors for you. Nothing depends on your laptop being open. Next, we want these agents to work proactively with customizable triggers. You might kick them off on a time-based schedule, or work event-based. We have the ability to work natively with GitHub events, as well as your own custom events that you can post to webhooks and endpoints with the event payload as context. Finally, these Claude Code sessions launched with routines are interactive and steerable as if you were launching Claude Code in the terminal. Every routine is really just a Claude Code session under the hood that you can open, watch, follow up on, steer, and resume from web, CLI, and desktop.
I want to walk you through a real use case we use here at Anthropic internally. The question for us and a member of our engineering team is: how can we automate docs creation with routines? To add a little data behind this, weekly PRs for Claude Code have gone up 200% since the beginning of the new year. This has been awesome for our Claude Code engineering team — their productivity is insane. This has been awesome for you folks because you get new features very quickly. The one person this has not been so awesome for is the one engineer responsible for maintaining our documentation across Claude Code and the agent SDK. When routines launched, she was a super big fan and early adopter. I want to walk you through how she set up a couple routines to help automate documentation creation.
On my side here, I have the terminal open. I encourage you to open your terminal and launch Claude Code. Inside the terminal, I can type /schedule and type in something that Sarah, our documentation queen, has done to set up this routine. She typed in: once a week, "Please review all the new changes merged to main against our documentation repo and create a PR to update docs if you see any changes." I encourage you to think right now: what are some tasks you do every day that would help if they could run on a schedule or if Claude Code could initiate these sessions for you? After kicking this off, Claude comes back and prompts me with a couple questions. It might ask, "Hey Maya, what time every week do you want me to kick this off? Once I create a PR, do you want me to notify you, maybe ping you on Slack?" Once I answer, Claude creates a routine that we'll view inside Claude Code on the web.
First, the three main decisions you'll make as you create any routine. The first decision is when your routine should trigger — what's the event, or is there a cadence you want this to run on? The second is what context or information Claude needs to be successful. The third is how you actually steer Claude in the session to keep it honest.
The first one is the trigger. Inside routines, there are two ways. You can have things kick off on a schedule, a time-based trigger. For that earlier example, this is how we do a weekly review of differences between our source code and our documentation repo. You can also have routines kick off on an event-based cadence. Maybe every time a release is cut, you can diff the release branch against the docs. Or maybe engineers deploying changes tag their PRs with a label that says "need docs," and you kick off Claude Code sessions anytime one of these labeled PRs gets merged.
The next thing is context. What does your agent need to know? Likely you'll give it access to one or more codebase repos. For this docs example, we give Claude access to our Claude Code source code to figure out what new changes exist, and also our docs repo for Claude to create new PRs. You might provide additional context — maybe I want Claude to have access to all our existing marketing briefs so it uses similar language. If that lives in Google Drive, I'll hook up the Drive connector. Or anytime Claude creates a PR, I want it to ping me on Slack, so I give it the Slack connector. It's important to think about this because whatever context Claude has, that's the ceiling of how successful Claude will be.
Finally, steerability. How do we ensure the quality of Claude's outputs? One thing I think is interesting is to invest in agent-on-agent review. If you've designed multi-agent systems and heard of the generator/critiquer pattern, we've borrowed it here. You can set up one routine to create docs PRs, and another routine that triggers on that PR's creation to leave comments before a human gets to it. Another option: we emphasized it's nice to have a human out of the loop, but sometimes you need to monitor these sessions and nudge Claude in a different direction. You can open Claude Code on the web and view what's happening in a live session as if working in the terminal. You can ask it questions mid-session, push it in another direction, and resume a past routine or session to continue the conversation. Finally, we verify Claude's outputs. For this documentation example, we render the documentation page Claude changed and confirm those outputs are what we expect.
Now I'll jump back into the routine we kicked off. I'm in Claude.ai, I go to the left side panel, click the code button, and jump into routines. I click on this routine I created earlier. On the left, it's connected to two repositories — our mocked-up Claude Code source code and our Claude Code documentation. It runs every Monday at 10:00 a.m. and is connected to GitHub and Slack. These instructions on the right Claude generated based on the initial prompt and my answers. This is a weekly documentation sync for our Claude Code fork. I click on a session and see the initial instructions pasted at the beginning of this Claude Code session. Claude has read these, started by looking at the source code repository for recent merged PRs, looked at our change log, compared that to the documentation repo, found some changes, and opened a PR for me.
Now I want to show another example where we kick off a routine based on a GitHub event. I've created a new routine and filled some of it in. I want this to trigger every time I create a new GitHub issue. I pasted instructions to investigate the issue this session triggers on, figure out if it's a documentation gap, and if so, open a PR and ping me in this channel. I've connected our Claude Code documentation repo and source code. Like I mentioned, there are two trigger types, schedule-based and event-based, and within event-based we have native GitHub events as well as the ability to trigger from your own code by sending a post request. Here I create a GitHub event trigger on issue opens, connected to Slack and our GitHub MCP. I have a new issue to create in our Claude Code docs repo — I happen to know a few tools are missing from docs in this new version. I create it, refresh the page, and see a new run picked up. The initial instructions are the first prompts, and the additional context from the issue was passed in. I happen to know I already have another PR open for this, so let me just guide Claude to stop this session — showing the ability to steer Claude in real time after a routine kicks off.
Now let's talk about ways to use routines to automate your challenges as developers. The first is a deploy verifier. Maybe you recently deployed changes to a service and want to make sure it's healthy and you shouldn't roll back. I think about this in three ways: what should my trigger be, what context is important to provide, and how do I plan to steer this routine? My CD pipeline can post after every deploy, so that's a good trigger — I post to a webhook that routines support. For context, it's nice to give Claude access to the source code for the service, and access to monitoring tools — DataDog, Grafana, whatever you use. If something goes down, I want Claude to alert me on Slack, email, or even text using Twilio. For steering, maybe I start by having Claude run an investigation and give me a go or no-go decision to roll back. I can jump into Claude Code on the web and read Claude's analysis. Then I can continue to work with Claude to roll back a change. Eventually, as I trust its decisions, I can let Claude roll back the change itself based on the monitoring data. Other challenges: an on-call investigator, or a PM going through a backlog of GitHub issues or Slack posts, kicked off on a time-based trigger, given access to GitHub and Slack, using Claude to prioritize and open PRs for the most important issues.
My final takeaways: Proactive agents beat reactive agents. We want Claude to go from a tool to a teammate. You can move from an agent waiting for you to press enter to an agent that reacts to problems and opens a PR itself. We built routines so you don't have to focus on maintaining all of this infra, but instead concentrate on your domain and process expertise. Finally, I encourage you to get started with routines today. You're a single /schedule command inside Claude Code away from creating your very first routine. Awesome. Thanks so much.