Build a Proactive Agent Workflow with Claude Code (Routines)

Claude · watch the talk ↗ · updated Jun 9, 2026

A talk by Maya (Anthropic Applied AI team) from the "Code with Claude" event, demonstrating how Claude Code's new routines feature eliminates the infrastructure burden of running proactive coding agents on schedules or event triggers, turning Claude Code from a reactive tool into an autonomous teammate that can open PRs, monitor deployments, and update documentation without human initiation.


Key Takeaways

  • Routines are managed, remote Claude Code sessions triggered by time schedules or events — no local hosting, session management, or authentication required 4:27
  • Every routine is a full, interactive Claude Code session: observable, steerable, and resumable from web, CLI, or desktop 6:06
  • Three decisions define any routine: trigger (when), context (what repos/tools Claude can access), and steering (how to keep outputs on track) 8:44
  • Agent-on-agent review (generator + critiquer pattern) is recommended for quality assurance on autonomous outputs 12:12
  • The entry point is a single /schedule command inside Claude Code 21:48

Why Building Proactive Agents Today Is Painful

Maya opens by polling the audience: many have run Claude Code on a cron job, but almost none enjoyed maintaining that infrastructure 1:13. The three core pain points she identifies:

  1. Hosting — agents running locally die when the laptop closes; you must manage hosting, data persistence, and authentication yourself 3:14
  2. Triggering — wiring cron jobs or custom endpoints requires significant boilerplate beyond the prompt 3:40
  3. Observability — headless sessions have no mechanism to watch, steer, bound, or resume a running agent 4:03

Anthropic felt this pain internally and built routines to address all three 1:33.


What Routines Are and How They Work

Routines are a managed infrastructure feature inside Claude Code defined by four inputs: a prompt, one or more connected repos, available connectors, and a trigger 4:35. Claude Code handles hosting, session state, and connectivity 5:08.

Trigger types 9:39:

  • Schedule-based: e.g., every Monday at 10 a.m. 14:14
  • GitHub event-based: e.g., PR merge, issue opened, release cut 10:01
  • Custom webhook: post from any external system (e.g., a CD pipeline) to a provided endpoint with event payload as context 5:48

Steerability features 6:00: Routine sessions are fully interactive — a user can open the session in claude.ai, read Claude's live reasoning, send mid-session messages, or resume a past session 12:49. Maya demonstrates redirecting a running session mid-task by typing that the changes have already been made 17:34.


Real-World Example: Automated Documentation at Anthropic

Weekly PRs to Claude Code grew 200% since the start of the year 6:42, overwhelming the single engineer ("Sarah") responsible for documentation. She became an early adopter of routines to automate doc creation 7:11.

Setup via /schedule 7:36: Sarah typed /schedule in the Claude Code terminal with the prompt: "Once a week, review all new changes merged to main against our documentation repo and create a PR to update docs if you see any changes." Claude asked clarifying questions (timing, Slack notification preference) and generated detailed instructions for the routine 8:15.

Routine configuration shown in demo 14:00:

  • Connected repos: Claude Code source code + Claude Code docs repo
  • Schedule: every Monday at 10 a.m.
  • Connectors: GitHub, Slack
  • Instructions: Claude-generated from the original prompt

Event-triggered variant 15:21: A second routine triggers on GitHub issue creation. When a new issue is opened in the docs repo, Claude investigates whether it represents a documentation gap and, if so, opens a PR and pings a Slack channel. Maya demonstrates this live — creates an issue, refreshes routines view, sees a new run pick up immediately with the issue content passed as context 17:09.


Framework for Designing Any Routine

Maya distills routine design into three questions, illustrated with a deploy verifier example 18:17:

DecisionDeploy Verifier Example
TriggerCD pipeline posts to webhook after every deploy 18:50
ContextSource code repo + monitoring tools (DataDog/Grafana) + alerting via Slack/email/Twilio 19:07
SteeringClaude produces a go/no-go rollback recommendation; human reviews, then optionally delegates rollback authority to Claude over time as trust builds 19:51

Other suggested use cases 20:35:

  • On-call investigator: event-triggered triage of production incidents
  • Backlog prioritizer: weekly time-triggered scan of GitHub issues or Slack channels to surface and prioritize work for PMs

Maya's closing stance: "Proactive agents beat reactive agents" — the goal is an agent that reacts to problems and opens a PR itself, while the engineer focuses on domain and process expertise rather than infrastructure maintenance 21:10.