This lesson is being recorded

Every video of this course is being uploaded to my YouTube channel. Subscribe so you do not miss it.

Bruno AshfordBruno Ashford @brunoashfordSubscribe

Module 10 · Lesson 10.1 · 13 min

Scheduled Routines

Put a recurring task on a fixed schedule so it runs without you, using the option that fits your business.

Module 10
Agents That Work While You Sleep

Schedules, headless runs, hooks and one-word commands

Bruno Ashford
Bruno Ashford · Module 1001 / 12
The problem
A routine that depends on your memory is not a routine.
Bruno Ashford
Bruno Ashford · Module 1002 / 12
Lesson 10.1

Three ways to schedule

OptionRuns whereBest when
Cloud routine (/schedule)Anthropic cloudLaptop closed, sources are connectors or GitHub
Desktop scheduled taskYour computerYou use the Claude desktop app
launchd, cron, Task SchedulerYour computerFiles live locally, full control

Cloud routines are a research preview; check your plan's limits.

Bruno Ashford · Module 1003 / 12
Lesson 10.2

Headless, in one line

claude -p runs the work without the conversation.

  • Nobody is there to approve
  • Decide permissions in advance
  • dontAsk plus a short allowlist
  • Redirect output to a dated file
Bruno Ashford · Module 1004 / 12
Lesson 10.2

Safe defaults for unattended runs

  1. 1Read onlyStart with the Read tool
  2. 2dontAskAnything else is denied
  3. 3Right folderLoads your CLAUDE.md
  4. 4Never skip checksOnly in isolated containers
Bruno Ashford · Module 1005 / 12
Lesson 10.3
Instructions guide the agent. Hooks enforce the rules.
Bruno Ashford
Bruno Ashford · Module 1006 / 12
Lesson 10.3

Hooks you will actually use

EventWhen it runsUse it to
PreToolUseBefore an actionBlock risky commands
PostToolUseAfter an actionKeep an audit log
NotificationWhen Claude needs youGet a desktop alert
StopWhen Claude finishesRun a final check
Bruno Ashford · Module 1007 / 12
Lesson 10.4

One word, same result

Commands and skills are now the same thing.

  • Name becomes the slash command
  • $ARGUMENTS passes in the details
  • Manual-only for client-facing work
  • Share the .claude folder
Bruno Ashford · Module 1008 / 12
Lesson 10.5

The morning brief

  1. 1Yesterday in numbersSales, leads, cash
  2. 2RisksOverdue and at risk
  3. 3Needs youMessages only you can answer
  4. 4TodayMeetings and top three priorities
Bruno Ashford · Module 1009 / 12
Illustrative example, not research

One partner's mornings

50 to 12minutes to get oriented
6:45ambrief ready
1missed deadline caught in week one
Bruno Ashford · Module 1010 / 12
Project

Seven days in production

Trust is built with evidence, not hope.

  • One routine, scheduled
  • Hooks tested and firing
  • One log line per run
  • Improve the prompt on day seven
Bruno Ashford · Module 1011 / 12
Recap
The best automation is the work you find already done, checked and logged when you sit down.
Bruno Ashford
Bruno Ashford · Module 1012 / 12
01 / 12

Use ← → to move. The marker highlights text and the pencil draws on the slide; navigation locks while you annotate. Undo removes the last mark, Esc exits.

1Pick the routine and write its prompt as a file

Choose one skill that already works well when you run it by hand, such as the weekly ops check from Module 9. Save the full instructions in a prompt file, because a scheduled run cannot ask you follow-up questions. The prompt must say exactly what to read, what to produce, where to save it and what never to do.

Prompt for Claude
Write a self-contained prompt for our weekly operations check and save it as prompts/weekly-ops-check.md. It will run unattended, so include: which files to read, the rules file to apply, the exact output file name with today's date, and the rule that it must never send, delete or overwrite anything. End with: if any input file is missing or older than 3 days, write that clearly at the top of the report and stop.
2Option A: a cloud routine

If your files live in a GitHub repository and you use a claude.ai subscription login, you can create a cloud routine with /schedule inside Claude Code, or at claude.ai/code/routines. It runs even when your computer is off, can use your connectors, and each run appears as a session you can review. Routines are a research preview, so check your plan's limits.

Prompt for Claude
/schedule every Monday at 7:10am, run the weekly operations check in prompts/weekly-ops-check.md
3Option B: your Mac's scheduler (launchd)

If your files live on your Mac, wrap the headless command in a small script and let launchd run it. The recipe file in this module's materials has the complete script and the launchd file, ready to copy. First, find where claude is installed, because scheduled jobs do not load your normal terminal settings.

Terminal
command -v claude
4Option C: Windows Task Scheduler

On Windows, save the PowerShell script from the recipes file and register it with Task Scheduler. This one command creates a task that runs every weekday at 7:30am. Replace the path with your own.

Terminal
schtasks /create /tn "AI Weekly Ops Check" /tr "powershell.exe -NoProfile -ExecutionPolicy Bypass -File C:\ai\weekly-ops-check.ps1" /sc weekly /d MON /st 07:10
5Run it once by hand, then log every run

Always trigger the routine manually before trusting the schedule, and check the output file. Then add a line to the Routine Run Log for every run: date, routine, status, minutes saved and issues. This log is your evidence in Module 12 when you calculate ROI.

Look at the skills you built in the last modules: the ops check, the aging report, the monthly report, the dashboard. Every one of them still waits for you to remember to run it. And the week you are busiest is exactly the week you forget. A routine that depends on your memory is not a routine.

There are three ways to put Claude Code on a schedule. Cloud routines run on Anthropic's infrastructure even when your laptop is closed. The Claude desktop app can run local scheduled tasks on your machine. And your operating system's own scheduler (launchd or cron on Mac, Task Scheduler on Windows) can run a headless claude -p command at a fixed time. In this lesson you choose one and set up your first routine.

Key points

  • A routine that depends on your memory is not a routine.
  • Scheduled prompts must be fully self-contained; nobody is there to answer questions.
  • Cloud routines run with the laptop closed; local schedulers run where your files are.
  • Run it by hand first, then log every scheduled run.

Avoid

  • Scheduling a skill that has never worked cleanly by hand.
  • Using a relative path to claude that the scheduler cannot find.
  • Scheduling exactly on the hour for cloud routines, when a few minutes past starts more reliably.
  • Never opening the output, so a broken routine runs silently for weeks.
Real-world example: a roofing contractor

A roofing company owner in Texas scheduled two routines on the office Mac: a weekly job-costing check on Monday at 6am and a Friday afternoon aging report. The first Monday it ran, the report flagged a job where material costs had already reached 91 percent of the quote with a third of the work left. Before automation, that job would have been noticed at invoicing, three weeks later. He now reads both reports on his phone in the truck before the first site visit.

Bruno Ashford Subscribe