Blog

Claude Code Routines: Automate Recurring Work Without Sitting at Your Laptop

Johannes Hayer
Johannes Hayer
·3 min read·en

You've had a Claude Code session where the task itself was dead simple — check something, review something, send something — and the only reason you were sitting there was to hit enter. That's the actual cost of most automation today: it's either a cron job you have to babysit, or you just keep doing it by hand because setting up the plumbing isn't worth it for a five-minute task.

Routines fix that. A Routine is a Claude Code job that runs on Anthropic's managed infrastructure — no server to maintain, no laptop that has to stay open — built from three parts: a trigger, a self-contained prompt, and connectors.

Triggers are the entry points: a schedule (hourly, nightly, weekly), an API call, or a GitHub event like a PR opening or closing. Combine as many as you want on one Routine.

The prompt is the routine itself, and it has to stand on its own. There's no back-and-forth here. Claude can't ask you a clarifying question mid-run, so write it like you're handing off to someone who can't reach you once you leave the room. Vague here means it breaks exactly when you're not around to fix it.

Connectors pull in context — Gmail, a repo, a calendar. This is what turns a routine from "run this exact prompt" into something that can actually check your inbox or your calendar before it acts.

Everything runs on Anthropic's managed infrastructure. A new server spins up, runs the session, and your own machine never has to be on.

In the video#

  • 00:00 — Why Routines exist: automate what you'd otherwise do manually
  • 00:25 — The three components: triggers, prompt, connectors
  • 02:26 — Live demo: building an "AI Clean Code Reviewer" routine in the browser
  • 04:13 — Running it manually and inspecting the live session
  • 05:43 — Managing routines from the Claude Code CLI (/routines)
  • 07:04 — Wrap-up

Building one: an AI Clean Code Reviewer#

In the video, I build a routine live at claude.ai/code/routines:

  • Name: AI Clean Code Reviewer
  • Task: "Analyze the repository for clean code principles and, on violations, flag me on my GitHub panel and show what's wrong."
  • Model: Sonnet 4.5
  • Repository: the repo behind my current course
  • Trigger: daily, 9am
  • Connectors: Gmail, calendar (I dropped Canvas for this one)
  • Extra instruction: "On violations, also notify me by email."

Hit Create, and the routine shows up in your list — with a manual "run now" button. Use it the first time. See how the routine actually behaves before you hand it a schedule and walk away.

Watching it run#

Under Runs, you get the live session on Anthropic's managed server, including which connectors got used. Under Calendar, you get a clean view of when every routine fires: my Anthropic News Digest at 8am, the Clean Code Reviewer, an Architecture Reviewer across different codebases. Any recurring task you can think of goes into a routine, and you get the schedule view for free.

Or just talk to it#

You don't need the browser at all. Open Claude Code, type /routines, and ask it to list your routines. From the CLI you get the same three things: list, create, edit. Two paths, one system underneath.

The actual point#

The interesting part isn't the UI. It's that the boring, recurring slice of your job — the stuff you forget, postpone, or do inconsistently — finally has somewhere to live that isn't another cron job you have to babysit. Write a precise prompt, wire up the right connectors, set a trigger, and it runs — with a full session log you can reopen and fix if it goes sideways.

Try it on one boring, recurring thing first. That's the fastest way to find out what a Routine can't do yet — more useful than a clean success.

AI engineering, weekly.

Join developers getting practical AI engineering in their inbox.