Skip to content
ClaudeClaude

Build a proactive agent workflow with Claude Code

Routines turn Claude Code into a proactive teammate that reads your repo and opens a PR before you've opened your laptop. You'll see one built end to end, learn the trigger, context, and steering decisions behind any routine, and leave one /schedule command away from your first.

May 20, 202622mWatch on YouTube ↗

At a glance

WHAT IT’S REALLY ABOUT

Claude Code Routines automate proactive agents with triggers and context

  1. Routines let you launch remote Claude Code sessions by specifying a prompt, connected repos/connectors, and a trigger, while Claude Code handles hosting, state, and authentication.
  2. The feature addresses common proactive-agent pain points: where agents run, how they are triggered (cron/webhooks), and how humans can monitor or intervene in headless runs.
  3. Anthropic demonstrates an internal documentation workflow where a weekly routine diffs source changes against docs and automatically opens PRs, optionally notifying via Slack.
  4. Routines support both schedule-based triggers (e.g., weekly checks) and event-based triggers (native GitHub events or custom webhook posts with payload context).
  5. Quality and control come from steerable live sessions, output verification, and patterns like multi-agent “generator/critique” review (e.g., one routine writes a PR, another reviews it).

IDEAS WORTH REMEMBERING

5 ideas

Routines replace cron-and-infra glue with a managed agent runtime.

Instead of hosting your own long-running jobs, you define the prompt, repos, connectors, and trigger; Claude Code manages hosting, session state, and connector authentication.

Triggers determine when agents become proactive teammates.

You can run on a cadence (e.g., every Monday 10am) or on events (e.g., GitHub issue opened, release cut, PR label like “Need docs”), including custom events posted to a webhook.

Context is the ceiling on routine quality.

Giving access to the right repos and connectors (e.g., source + docs repos, Drive for style/briefs, Slack for notifications) strongly determines whether Claude can produce correct, on-brand changes.

Routines are not black boxes—you can watch and steer them live.

Each routine run is a normal Claude Code session you can open from web/CLI/desktop to inspect actions, ask follow-ups mid-run, redirect work, or stop the session.

Use multi-step controls to keep outputs “honest.”

Combine verification (e.g., rendering docs changes) with agent-on-agent review—one routine generates a docs PR and a second routine triggers on PR creation to leave critique comments before humans review.

WORDS WORTH SAVING

5 quotes

So we believe that coding agents shouldn't wait for you to press enter to get started.

Maya

Right now, Claude Code is a really powerful coding tool, but we wanna take Claude Code and turn it into a really powerful coding teammate.

Maya

Routines is a brand new feature inside of Claude Code. It's an automation where you can kick off a remote Claude Code session by only defining the prompt, what repos you wanna connect it to, what connectors it has available to work with, and a trigger. Claude Code handles the rest.

Maya

Every routine is really just a Claude Code session under the hood that you can open, you can watch, follow up on, steer, and resume, um, from web, CLI, and desktop.

Maya

Proactive agents, uh, beat reactive agents. We want Claude to go from a tool to a teammate.

Maya

Proactive vs reactive coding agentsRoutines as managed automation for Claude CodeSchedule-based triggers (/schedule)Event-based triggers (GitHub events, custom webhooks)Context via repos and connectors (GitHub, Slack, Drive)Interactive steering and resuming sessions (web/CLI/desktop)Agent-on-agent review (generator/critic pattern)

High quality AI-generated summary created from speaker-labeled transcript.

Get more out of YouTube videos.

High quality summaries for YouTube videos. Accurate transcripts to search & find moments. Powered by ChatGPT & Claude AI.