What problem do routines solve compared with running agents locally?
Routines run on Claude Code's managed infrastructure so sessions remain available, host state and connectors, and avoid local-hosting and cron maintenance.
Video Summary
Routines let Claude Code run proactively on Anthropic-managed infrastructure so agents don't depend on your laptop.
Define three core routine decisions: trigger (when), context (what repos/connectors), and steering (how Claude should behave).
Triggers can be time-based schedules or event-driven (GitHub events, webhooks) and include event payloads as context.
Give Claude access to source code, docs repos, and connectors (Slack, Google Drive, monitoring) so outputs match context.
Ensure quality via agent-on-agent reviews, live monitoring/steering, and human verification before merging PRs.
Routines run on Claude Code's managed infrastructure so sessions remain available, host state and connectors, and avoid local-hosting and cron maintenance.
Routines support time-based schedules and event-driven triggers like GitHub events or custom webhooks with event payloads as context.
Connect the code repo, the docs repo, and relevant connectors (e.g., Google Drive briefs, Slack) so Claude can read code changes and match existing style.
Use agent-on-agent review, enable live monitoring and steering during sessions, and require human verification of PRs before merging.
Create a routine by defining the prompt, repos, connectors, and trigger — you're one /schedule command away from your first run.
"I'm Maya, a member of our applied AI team here at Anthropic, and I'll be talking about how to build a proactive agent workflow with Claude Code."
Maya introduces herself as part of the applied AI team at Anthropic, highlighting her dual role in developing their first-party products and assisting customers in building their own products and features using their models.
She is presenting in a workshop setting that discusses Claude Code and its routines feature aimed at creating effective workflows for proactive agents.
"The first challenge is deciding where these agents should run."
Building proactive agents currently involves several complexities, such as determining the right environment for the agents to operate. Running them locally can lead to session interruptions if the machine shuts down.
Another difficult aspect is triggering these agents at the right time, which typically requires additional infrastructure like cron jobs or custom endpoints, adding to the development burden.
A significant challenge faced while developing these agents is maintaining human oversight. Often, there's a need for real-time monitoring of the agent's actions, which is not easily achievable with current setups.
"Routines is a brand new feature inside of Cloud Code that automates the initiation of a remote Claude Code session."
Routines allows users to define the prompt, repository connections, connectors available, and triggers to automate session handling effectively.
This feature addresses issues by ensuring that agents are always available and operating on controlled infrastructure, relieving users of the burden of maintaining their own servers.
Users can set up these proactive agents to work with a customizable schedule or event-driven triggers, which enhances their functionality.
"The question for us is how can we automate documentation creation with routines?"
Enthropic’s team has seen a significant increase in weekly pull requests (PRs) for Claude Code, leading to a necessity for more efficient documentation processes.
The responsibility for documentation maintenance fell heavily on one engineer, prompting her to adopt the routines feature to streamline this repetitive task.
By creating a routine that reviews changes in the main branch against the documentation repository weekly and opens a PR for necessary updates, she maximizes efficiency and reduces manual workload.
"Three main decisions you'll need to make when creating any routine are its trigger, context, and how to steer Claude in the session."
Defining when the routine should trigger is crucial; it can be time-based or event-based, depending on the requirements.
Context refers to what information Claude needs to operate successfully, like access to specific documentation or tools to provide updates.
Steering or guiding Claude during the session ensures that the output aligns with user needs and expectations, allowing for a more controlled outcome from the automation processes.
"For this docs example, we need to give Claude access to not only our source code but also our docs repo."
To successfully implement a proactive agent workflow with Claude, it is crucial to provide access to both the codebase repositories and documentation. This includes access to the Claude code source to identify new changes and the documentation repository for creating pull requests (PRs).
Additional contextual resources can further enhance Claude’s performance. By giving Claude access to existing marketing briefs or relevant files stored in Google Drive, it can align its outputs with the language and style of existing marketing materials.
It's beneficial to connect Claude with communication tools like Slack for real-time notifications, such as being alerted every time it creates a PR. Keeping this context in mind can significantly affect the success rate of Claude's outputs.
"How do we ensure the quality of Claude's outputs? One way is to invest in agent-on-agent review."
The quality of Claude’s outputs can be maintained through several strategies. One innovative approach is the agent-on-agent review, where multiple agent systems assess each other's outputs. This process allows Claude to generate documentation and have another routine automatically provide critiques or comments on the PR it creates before human intervention is needed.
Monitoring sessions can also be important. While having Claude work independently is ideal, interventions might be necessary to steer its outputs in the right direction. Users can interact with Claude during a live session, ask questions, and alter its course if needed.
Finally, verifying Claude’s outputs is essential. For documentation tasks, the outputs created must be reviewed and compared with expected results. This step ensures that any changes made by Claude meet the required standards.
"This is a weekly documentation sync for our Claude code fork."
Setting up a routine to automatically manage documentation updates is an effective use of Claude. The routine can be scheduled to run at predefined intervals, such as every Monday, ensuring that the documentation remains current without manual oversight.
During a session, Claude reads initial instructions and begins its work by examining the source code repository for any recent changes. It can then generate a PR based on this analysis, thus streamlining the documentation process.
The routine's design allows for flexibility, enabling users to trigger actions based on specific events, such as creating GitHub issues, which can initiate documentation checks and updates.
"I want to create a new documentation automation routine that triggers every time I create a new GitHub issue."
Another example of efficiently leveraging Claude’s capabilities is through event-based automation triggers, such as GitHub events. By setting up a routine that activates anytime a new issue is created, Claude can automatically start a session to investigate the issue and determine if it relates to documentation gaps.
Instructions specific to the triggered event can be embedded, enabling Claude to analyze the issue in detail and take appropriate actions, like opening a PR if necessary. The automation integrates seamlessly with platforms like Slack for real-time notifications about changes or updates.
This event-based automation not only increases efficiency but also maintains more organized and up-to-date documentation as issues arise and get resolved systematically.
"I want to make sure that this service is healthy and shouldn't roll back these changes."
Developers can implement Claude to tackle common software engineering challenges by automating critical processes, such as verifying deployments. Setting an appropriate trigger based on the continuous deployment (CD) pipeline post can initiate a routine that checks the health status of deployed services.
Providing Claude with context is key for effective monitoring. Access to the relevant source code and monitoring tools such as DataDog or Grafana will enable Claude to evaluate the service's performance post-deployment.
Active steering of the routine includes having Claude perform investigations and provide recommendations on whether to roll back changes if any issues arise. As trust in Claude’s capabilities grows, developers can allow Claude to make rollback decisions autonomously based on the monitoring data at its disposal.
"Proactive agents beat reactive agents."
Proactive agents are initiated on a time-based trigger, offering timely responses and actions.
By integrating tools like GitHub and Slack, proactive agents can access various platforms where issues are reported or managed.
Claude serves to assist in prioritizing tasks and can even open pull requests (PRs) for critical issues, thereby enhancing productivity.
"Routines handle for you."
The designed routines allow users to focus on their domain and process expertise instead of worrying about the underlying infrastructure maintenance.
This streamlining of tasks ensures that users can allocate their mental resources to value-adding activities instead of repetitive upkeep.
"You're a single schedule command away from creating your very first routine."
Users are encouraged to take immediate action by starting to create routines within Claude Code.
The simplicity of setting up a routine is emphasized, with only a single command required to initiate the process.