❝ Nico

Notes

How do I make Claude Code run something every morning?

There are three schedulers and only two of them can read the files on your Mac. The cron and LaunchAgent route, written out, with the flags an unattended run needs.

Three ways, and they are not interchangeable. /schedule creates a routine in the cloud, which cannot see your files. A Desktop scheduled task runs on your Mac and can. Or write the prompt into a shell script and have cron or a LaunchAgent start it with claude -p.

Which one to pick

One property decides it. A cloud routine runs whether or not your Mac is on, but it works in a fresh clone and has no access to your local files. Anything reading your receipts folder, your mailbox or a bank export has to run on the machine those files are on, and the machine has to be awake.

The cron route, step by step

  1. Prove the prompt works with nobody watching. claude -p "summarise today's new files in ~/Inbox" --allowedTools "Read". The -p flag (also --print) is non-interactive mode. Claude Code exits 0 on success and non-zero on failure, so a wrapper script can branch on it.
  2. Add --permission-prompts none. In a scheduled job nobody can answer a permission prompt. With this flag the run does not wait for an answer: anything that would prompt is denied, Claude is told nobody can approve it, and the run continues instead of hanging until you find it tomorrow.
  3. Decide about --bare before you use it. It skips discovery of hooks, skills, MCP servers, plugins and CLAUDE.md, which is what you want in a job that must behave identically every day. One catch worth knowing in advance: bare mode does not read your subscription login or the system keychain, so it needs ANTHROPIC_API_KEY in the environment.
  4. Wrap it in a script, with absolute paths. A scheduled job does not get your interactive shell's environment, so name the binary in full and send both streams to a log you can read later.
    #!/bin/zsh
    cd /Users/you/work/digest
    /usr/local/bin/claude -p "$(cat prompt.txt)" \
      --allowedTools "Read,Edit" --permission-prompts none \
      >> /Users/you/work/digest/log.txt 2>&1
  5. Install it. crontab -e, then 3 7 * * * /Users/you/work/digest/run.sh for 7:03 every morning. Or a LaunchAgent, for the reason below.
  6. Give the job a fixed output folder. If each run writes into the conversation, you have automated something that produces nothing you can open.

Why a LaunchAgent beats cron on a laptop

This is the one technical fact that changes the answer on a Mac, and it comes from man launchd.plist rather than from anyone's blog: "Unlike cron which skips job invocations when the computer is asleep, launchd will start the job the next time the computer wakes up. If multiple intervals transpire before the computer is woken, those events will be coalesced into one event upon wake from sleep."

So a 7am cron job on a laptop that was shut at 7am simply did not happen, silently, and you find out when you notice the log is thin. The same schedule as a LaunchAgent runs when you open the lid. If the job genuinely must fire at 7am, schedule the wake as well: sudo pmset repeat wakeorpoweron MTWRFSU 07:00:00.

What /loop is and is not for

Inside a session, /loop 30m check the deploy re-runs a prompt on an interval. It is the right tool for watching something for an hour and the wrong tool for a daily job: tasks only fire while the session is open and idle, recurring ones expire seven days after you create them, and the scheduler deliberately adds up to 30 minutes of jitter to a recurring fire time. A job scheduled for 0 9 * * * may run at 9:28.

The part no scheduler does

A schedule starts a prompt. It does not give the work a home — somewhere the output accumulates, a prompt you are not rewriting from memory, and a previous version to go back to when today's edit was wrong.

That is the part Nico keeps: one folder per tool outside any session, a data folder that survives every run, ten versions kept. Its showcased morning digest reads only what you told it to read and sends nothing outward.

← All notes