Published on , Aurélien Vandaële

Claude Code scheduled tasks: how I run agents every morning without watching them

A Claude Code Desktop scheduled task starts a new session at the set time, with a prompt written in advance. Nobody is there to answer: the prompt has to say everything, including when to do nothing. Each of my tasks follows the same plan (read, choose, do, check, publish or hold back, report in three lines), and the memory from one morning to the next lives in files, not in the session.

The problem: an agent alone, with nobody to ask

In a normal session, the agent hesitates and asks you. In a scheduled task, nobody is there. So it either guesses, or stalls on a permission prompt nobody will see. Both are bad for work that publishes a site or spends money.

Claude Code offers three ways to schedule: cloud tasks, which run even with your computer off but on a fresh clone of the repository; local tasks in the Desktop app, which have access to your files and tools; and /loop, which only lives as long as an open session. I use local tasks, because my morning work needs my repositories, my scripts and my MCP servers.

The method: a prompt that knows how to say no

A local task is a ~/.claude/scheduled-tasks/<name>/SKILL.md file: a header with name and description, then the prompt. The schedule, the folder and the active or paused state are not in that file, they are set in the app. Editing the file is enough for the next run to pick it up.

All my prompts share the same skeleton:

  • The context to read, in order. The project skill, the market doc, the app's exact labels, what is already published. The agent starts empty every morning.
  • The choice rule. Search Console data first; if it is empty, Google autocomplete; never a topic already covered.
  • The work, with its prohibitions. Only mention buttons that exist in the app, no invented figure, remove whatever cannot be verified.
  • Check, then publish, or hold back. npm run check then npm run build. A red check or an unverifiable fact: nothing is published, nothing broken is committed, and the report says so.
  • Tracking in a file. One line per publication in a Markdown table in the repository, with impressions at 14 and 28 days. It is the only memory between two mornings.
  • A report of three lines at most: what was done, why, what blocks.

The most important instruction is the one that allows failure. An agent told “publish a guide” will publish a guide. An agent told “if the check is red, publish nothing and say so” has an honest way out.

What runs on my machine

I wrote five daily tasks, set thirty minutes apart between 7 and 9 am: three write an SEO guide for my apps' websites, one manages the Apple Ads campaigns, one writes the article you are reading. On top of that comes a one-off task, written for a specific day in December, that checks an app is ready for a campaign and sends me a notification.

The ads task has run 25 times. Its prompt leaves it almost nothing to decide alone: it syncs, applies capped rules, adds negative keywords only when a term is clearly off topic, and writes a review when the date set in the strategy file arrives. Spending is only allowed within a strategy I have approved and dated, or through an agreement written in the prompt with its date, a daily budget and a monthly cap.

Memory goes through the repository's files. The ads strategy carries a “Next review” line with a date: the task reads it every morning and only runs the review on that day. For the blog, it is blog.md, one line per article.

What went wrong

  • The permission nobody sees. One morning in October, the ads run was supposed to create campaigns. The session's auto mode refused the command. Nothing was spent, and the report said so. That is the right outcome, but I drew a rule from it: new spending is decided in a conversation with me. The December reminder only checks and notifies me.
  • “Succeeded” does not mean “done”. Over 10 runs, the history of the Paraph guides task shows nothing but successes. Yet on November 10 and 12, it published nothing: the app's check was red, eleven purchase tests broken by a date frozen in the tests. The guardrail held, but only the report showed it. I read the reports, not the green dots.
  • The time is not guaranteed. A local task only runs while the app is open and the computer awake. On wake, Claude Code starts a single catch-up run for the most recent missed time. This morning, the tasks scheduled between 7 and 9 am only started late in the morning, almost at the same time. A prompt that says “publish yesterday's data” must compute the date, not assume it.

How to start

In the Code tab of the Desktop app, open Scheduled and create a task, or simply ask in a session: “create a task every morning at 9 that…”. Then:

  • Click Run now once and stay in front of it. Accept each permission prompt with “always allow”: later runs will skip most of those prompts. To write those rules yourself, see my permission list.
  • Write the hold-back condition first, the work second.
  • Give the task a tracking file in the repository, and ask it to update that file in the same commit as its work.
  • Require a short report, and read it.

The prompt does not replace guardrails enforced by the tool, such as the hooks that block an agent's shortcuts. It is when nobody is watching that they matter most.

Article written with the help of AI, from my daily practice and my projects.

The whole notebook