TIPS 12 · ROUTINE

It does it even while you sleep

The two routines I use: a summary of the night every morning at 7:30 and a check of the site every 5 minutes. With the texts to copy and where to set them up.

What it is and why it matters

A routine is a saved prompt that Claude Code runs on its own, at a set time or at regular intervals. You write it once, then it starts without you opening anything.

The problem it solves for me is simple. In the morning I open my computer and I don't know what happened overnight: how many people signed up, whether there were errors, whether the site went down. Looking it all up by hand takes time, and often I end up not doing it. With two routines, the answer is already waiting for me.

A routine can run in three different places. The choice depends on two things: how often it has to start and whether your computer can stay on.

  • In the cloud: it starts even with your computer off, but at most once an hour.
  • In the Claude desktop app, as a Local routine: it runs on your computer, even every few minutes, but only with the app open and the computer awake.
  • With /loop, inside a Claude Code session: it's the fastest way, but it only lives as long as that session stays open.

1. The 7:30 summary

I put this one in the cloud, so it starts at 7:30 even if the computer is off or closed in my backpack.

  1. In Claude Code, type /schedule (you need to be signed in with your claude.ai account), or go to claude.ai/code/routines and click New routine. With /schedule, Claude asks you the questions and saves the routine for you.
  2. Choose the project. It has to be on GitHub: every time it starts, the routine clones a fresh copy and doesn't see the files on your computer.
  3. For the schedule, pick every day at 7:30. You enter it in your own time zone, and it handles the conversion itself.
  4. Connect the database and the error logs as connectors. They're the links to outside services that you have on your claude.ai account.
  5. Paste the prompt below and replace [name] with the name of your app.
The prompt
Every morning, check my app [name] and tell me what happened since last night:
- how many people signed up (just the number, no personal data);
- the errors in the logs: how many, which ones, at what time, whether any of them repeats;
- a three-line summary: how the night went and what I look at first.
Don't change anything: read and write the summary.

In the prompt I only ask for the number of sign-ups, no names or emails. That's all I need to understand how the night went, and the summary stays saved: better that nobody's personal data ends up in it.

Where to find the summary

Every time it starts, the routine creates a new session alongside your others. You open it and find what it did and the summary. If it ever changed code, the work would go to a branch starting with claude/, not to your main branch, unless the prompt asks for something else.

Watch out for the green status in the list of runs: it means the session started and finished without technical problems, not that the task succeeded. The first few times, open the session and read it.

2. The check every 5 minutes

Cloud routines start at most once an hour. For a check every 5 minutes you need something that runs on your computer, and here you have two options. The prompt is the same for both:

The prompt
Open [site address] and check that it responds and that the page loads. Only write to me if something changes compared to the previous check: "the site is down" when it goes down, "it's back" when it comes back. If everything is the same as before, don't write anything.

Every 5 minutes means about 288 checks a day: keep it short. The prompt above does one thing only and writes only when something changes.

With /loop, in an open session

In the Claude Code session, type /loop 5m followed by the text. Every 5 minutes Claude runs it again in the same conversation, so it remembers how the site was at the previous check.

The limits: it only works while the session stays open and the computer is on. If you close the terminal, it stops. And after 7 days the loop stops by itself: it runs one last time and deletes itself. If you still need it, you start it again.

With the Claude desktop app, as a Local routine

  1. In the desktop app, in the Code tab, open Routines, click New routine and choose Local.
  2. Give it a name, choose the project folder and paste the same prompt.
  3. The ready-made schedules (Manual, Hourly, Daily, Weekdays, Weekly) don't include “every 5 minutes”. Choose Hourly and save, then in a session in the app ask Claude to run it every 5 minutes.
  4. Leave the app open and the computer awake. If the computer goes to sleep, the checks during that time are skipped.

One important difference: in the desktop app every check is a new session and knows nothing about the previous one. So it can't tell you “it's back”. At the end of the prompt, add this line, so it knows what changed:

The line
Save the result in site-status.txt and read it again at the next check

To stop the computer from going to sleep when it's idle, the app's settings have a Keep computer awake option. Closing the laptop lid, though, still puts it to sleep.

3. Before you let it run on its own

I test it by hand

The first time, I start it myself with Run now, the button you'll find both on claude.ai/code/routines and in the desktop app, and I watch what it does before letting it run on its own. In the desktop app the permission mode matters too: in Manual, a local routine stops at every permission request and stays stuck until you answer. On the first run I approve them right there by choosing “always allow”: after that, those tools run without asking.

I remove the connectors it doesn't need

When you create a cloud routine, all the connectors on your account are included by default. And during the run Claude can use every one of their tools, including the ones that write, without asking you anything. A routine that checks shouldn't be able to change anything: I keep only the database and the logs, and if the service allows it, I connect them read-only. The “Don't change anything” in the prompt helps, but the real limit is what the routine can touch.

I don't worry about the delay

A routine can start a few minutes after the scheduled time: that's normal. In the cloud it happens mostly if you pick an exact hour, like 7:00. In the desktop app every routine always starts with the same small delay of a few minutes. With /loop 5m, on the other hand, the check comes roughly every 5 minutes.

Common mistakes

  • Putting the 5-minute check in the cloud: the minimum there is one hour, so use /loop or a Local routine.
  • Leaving all the connectors included: remove the ones it doesn't need, because during the routine Claude uses them without asking.
  • Asking for the names and emails of new sign-ups: ask only for the number, you don't need personal data to understand how the night went.
  • Forgetting that in the desktop app every check starts from scratch: add the line that saves the result in site-status.txt.
  • Trusting the green status: open the session and read what it actually did.
  • Counting on a /loop after a week: it expires after 7 days, so make a note of when to restart it or switch to a Local routine.

Checklist

  • Project on GitHub
  • 7:30 summary set up as a cloud routine
  • Only the database and logs among the connectors
  • Only the number of sign-ups, no personal data
  • 5-minute check with /loop 5m or a Local routine
  • site-status.txt line added, if you use the desktop app
  • First run started by hand and read through

Frequently asked questions

Does the 7:30 summary run even if my computer is off?

Yes, if it's a cloud routine: it runs on Anthropic's servers, not on your computer. A Local routine and /loop, on the other hand, need the computer on.

I type /schedule and nothing happens. Why?

/schedule is only there if you signed in to Claude Code with your claude.ai account, not with an API key. You can still create the routine from the website, at claude.ai/code/routines, unless your organization has turned routines off.

Can the cloud routine change my code?

Yes: it runs on its own, without asking you for permission. If it changes something, it puts it on a branch starting with claude/. That's why in the prompt I tell it not to change anything, and I remove the connectors it doesn't need.

← All guides