Tech Update / Adventures with Claude Code #22

/loop and routines – Claude works on a schedule

"Check every few minutes whether the deployment has gone through." That used to mean checking again and again myself. Or a shell script with sleep and grep that gives up at the first unexpected log entry.

Claude Code can repeat tasks on its own, in the running session or with no computer at all.

🔁 /loop: repeating in the session

/loop 5m Check whether the staging deployment succeeded. Only report back on errors or when it's done.

Every five minutes Claude runs the task again. Units are s, m, h and d. Without an interval Claude picks the delay itself, between one minute and one hour, depending on how fast things change. Your own skill (part 3) works as the task too.

☁️ /schedule: routines in the cloud

For tasks that should run regularly even when my laptop is closed, there are routines. They run on Anthropic's infrastructure, with no local session at all. The trigger can be a schedule, a GitHub event or an HTTP call.

Typical uses for us: summarising new errors from the log every morning, checking for outdated dependencies once a week.

A word of caution:

Every run costs tokens, even when nothing has happened. A /loop every 30 seconds for hours on end shows up in your limits. A /loop only lives in the current session and ends after seven days at the latest. Routines are still in research preview, so test them well before relying on them.

My rule of thumb:

  • Waiting on something external while I'm at my desk? /loop.
  • Recurring task, independent of my machine? /schedule.
  • Always exactly the same, no judgement needed? A classic cron job with claude -p (part 13), or no AI at all.

← Back to overview