Nate Herk | AI Automation · Youtube · 09:43

Claude Code Scheduled Tasks: The 24/7 AI Employee

A 9-minute demo showing how native cron sessions turn any Claude Code skill into a self-healing, self-improving background agent.

Posted
March 7th 2026
2 months ago
Duration
09:43
Format
Tutorial
educational
Channel
NH
Nate Herk | AI Automation
§ 01 · The Hook

The bait, then the rug-pull.

A clock graphic, a deadpan punchline, and a feature that actually delivers: Claude Code can now run your skills on a schedule while you sleep, with no babysitting required.

§ · Chapters

Where the time goes.

00:00 – 00:42

01 · Hook & Feature Announcement

Cold open frames scheduled tasks as a 24/7 AI employee. Two setup paths introduced: Schedule tab UI and /schedule slash command.

00:42 – 01:16

02 · Creating a Task in the UI

Live demo of the New Scheduled Task form: name, description, prompt, model, folder, frequency. Morning coffee task shown active at 6:09 AM daily.

01:16 – 01:42

03 · Scheduled Tasks: Prompt on a Cron

Illustrated flow: Cron Fires, Session Starts, Gets Tools, Runs & Closes. Establishes this is a full agent session, not a triggered function.

01:42 – 02:23

04 · Script vs Agent

Side-by-side comparison diagram. Cron Script: fixed steps, no context, no recovery. Claude Code Agent: codebase, reasoning, skills, MCP tools, self-healing loop.

02:23 – 03:11

05 · Morning Coffee Demo

Live conversion of an existing skill into a scheduled daily task using a single natural language prompt. Task live in under 60 seconds.

03:11 – 03:42

06 · Skills Discovery

Demo showing Claude listing all available project skills on request, illustrating how any skill becomes a candidate for weekly automation.

03:42 – 04:12

07 · The One Gotcha: Machine Must Be Awake

Illustrated slide: if the laptop is asleep the task is skipped, but on wake the app checks 7 days back and catches up. Time-sensitive tasks may not recover cleanly.

04:12 – 05:08

08 · What Scheduled Tasks Cannot Do

Four-quadrant slide: No Git Push, No Destructive Ops, No Shared Memory by default, Needs Your Keys. Recommendation to do a manual test run first.

05:08 – 06:08

09 · Self-Improving Loop: Three Layers

Illustrated three-layer diagram: fix scripts on error, rewrite own prompt when improvements are found, maintain a run log for memory across stateless sessions.

06:08 – 07:06

10 · The Lean Strategy: One File Per Task

Live Claude conversation showing the recommended run-log pattern. One overwritten markdown file per task, not an append log. Prompt structure: Pre-Flight, Main Task, Post-Run.

07:06 – 07:57

11 · Notifications, Hooks & External Alerts

Desktop app notification diagram. Audio hook demo. Recommendation to add a ClickUp/messaging step at the end of each task prompt for external notification.

08:11 – 09:02

12 · Create vs Edit vs Run: Architecture

Three-section diagram showing the desktop app creates and runs tasks, the file system stores editable task files, and VS Code can edit but not create or trigger crons.

09:02 – 09:43

13 · CTA & Close

Outro linking to a project setup video. Standard like/subscribe ask.

§ · Storyboard

Visual structure at a glance.

hook
title card
schedule UI
cron flow diagram
script vs agent
self-healing loop
one gotcha
what it cannot do
self-improving layers
lean strategy
desktop app loop
create vs edit vs run
outro
§ · Frameworks

Named ideas worth stealing.

05:08 model

Self-Improving Task Loop

  1. Layer 1: Fix Scripts (Error to Edit Code to Fixed)
  2. Layer 2: Update Prompt (Old Prompt to Rewrites Itself to New Prompt)
  3. Layer 3: Log as Memory (Last Log to Learns Each Run to New Log)

Three-layer architecture that lets a scheduled task improve over time without human intervention: fix broken code on error, rewrite the prompt when improvements are found, maintain a run log so the next stateless session has context.

Steal for Any long-running background automation that needs to stay reliable without regular manual tuning.
06:08 model

Pre-Flight / Main Task / Post-Run Prompt Structure

  1. Pre-Flight (30s): Read run-log.md, fix known issues before starting
  2. Main Task: Execute the actual skill or automation
  3. Post-Run (30s): Overwrite run-log.md with status, issues, state for next run

Three-phase prompt structure that gives each stateless scheduled task session a lightweight memory without bloating context.

Steal for Structuring any Claude Code skill that will run repeatedly or autonomously over time.
01:42 model

Script vs Agent Decision

  1. Cron Script: deterministic, fixed path, no recovery, no context
  2. Claude Code Agent: full codebase access, MCP tools, reasoning, self-healing, can rewrite itself

Framework for deciding when to use a traditional cron script vs a Claude Code scheduled agent based on need for error recovery, dynamic reasoning, and self-improvement.

Steal for Any automation planning session where you are deciding how much resilience and adaptability you need vs how much predictability you need.
§ · Quotables

Lines you could clip.

01:03
"This is not a deterministic workflow. And that is the huge unlock."
The key reframe of the entire video in one sentence. → TikTok hook
02:20
"You are no longer the bottleneck, and these skills and workflows can actually get better and better over time automatically."
Strong payoff line with clear emotional resonance. → IG reel cold open
06:32
"If you run an automation a thousand times, then you might have a thousand append logs."
Vivid concrete consequence that makes the one-file pattern immediately obvious. → newsletter pull-quote
05:08
"The only bridge between runs is files on disk."
Tight, quotable, captures the stateless architecture in 9 words. → newsletter pull-quote
§ · CTA Breakdown

How they asked for the click.

09:02 next-video
"What you need to do now is go learn how to set up your project and create your own executive assistant."

Clean end-of-video link to prerequisite setup video. No hard sell. Appropriate given the tutorial format.

§ 04 · The Script

Word for word.

HOOK opening / re-engagementCTA the pitch
00:00HOOKCloud Code is now a twenty four seven AI employee, which means that it is always Cloud Code o'clock, and that might be the nerdiest thing I've ever said. Anthropic has finally done it and launched scheduled tasks natively for Cloud Code, which means every single process, every single skill, everything you've been building and using inside of Claude Code just got 10 times more powerful.
00:19HOOKAnd they literally could not be easier to set up. So in today's video, I'm gonna show you exactly how they work and tell you everything important that you need to know about them. Let's not waste any time and get straight into it.
00:27HOOKSo here I am in Claude Code in the Claude desktop app. Now right now, you do need to be using the desktop app in order to access these scheduled tasks. Now this scheduled task feature came out about a week or two ago in Claude Cowork.
00:39HOOKAs you can see, it's basically the exact same thing. You could create scheduled automations. But now they finally brought it to Cloud Code, and there's a few ways that you can set them up.
00:46The first way is you'd go over here to the schedule tab, and you just click on it, and you can see right here, run tasks on a schedule or whenever you need them, type slash schedule in any existing session to set one up. So those are the two ways. You can either click right here, new task.
00:59You can give a name, a description, give it a prompt. You can choose the model you want it to run on. You can choose the mode to run on, and you can also select the folder.
01:06And then finally, you just say, hey. I want this to run every hour, every day, every week. At this time, boom.
01:12You now have a scheduled automation. So that cron would basically fire off, the session would start up, and then the agent would read the prompt, it would go through your files, it would work in your project, do whatever it needed to do, and then after it's done, it would just stop. And the huge unlock here, which is so exciting to me, is that this isn't a deterministic workflow.
01:29And so there's some good there and there's some bad there, but the good news is that you can completely control it. And what I mean by that is if you've been following some other Cloud Code videos I've done in the past, we build either like a Python script or a TypeScript, and that is the actual automation, and that is deterministic
01:42logic code. Meaning that will always happen step one, step two, step three. If there's an error, it can't fix itself.
01:48It just errors and then we get notified. But this isn't just a Python script. This is ClaudeCode agent running the same exact way it runs when you talk to it.
01:56And that's why this is so exciting because agentic workflows are self healing, and they can read everything in your entire project and use all your tools. So as you guys know, you tell it to go do something and it starts trying. If it runs into an error, it doesn't just come back and say, I tried.
02:09It says, okay. Here's the error. Let me try three other things.
02:12And then after I see which one of those three other things work best, I'm gonna update myself so that I never run into that error again. So now you are no longer the bottleneck, and these skills and these workflows can actually get better and better over time automatically. The other important thing to remember here is if you do want it to be more deterministic and you want more control, you can do that.
02:29Because you could literally have it just execute a script and that's the whole scheduled task, and it just is completely deterministic that way. So how do you go ahead and start creating some scheduled tasks? Well, here you can see one I have is called morning coffee.
02:40So I've showed this one off before in a few other videos. But, basically, every single morning, I would open up my Cloud Code, and I would say, hey. Run morning coffee, which would help me plan my day.
02:48It would look at my commitments. It would look at the projects and help me catch up on what the team is up to. But now this can actually just run automatically at 6AM every morning.
02:56And literally all that I did to set this up was I said, take a look at my morning coffee skill. I would like to turn this into a scheduled task that goes off every morning at 6AM. Help me get this set up.
03:04It read the skill. It complimented me on the skill, and then it asked me one question about it. Then And a minute later, my skill that I run every morning is now automated.
03:11And if you've never used Cloud Code in the desktop app, don't worry. It's super easy. You can basically pull in, you know, a GitHub repo or a different folder, and you can be working in the exact same project that you're used to.
03:20So right here in the new session, I just asked it, what skills do you have in this project? And it came back and said, hey. Here are all the active skills.
03:26We've got content creation. We've got research and intelligence. We've got visual diagrams, operations, and meta.
03:31And now any of these skills, I could just say, okay. Cool. Turn that into a weekly automation.
03:36Alright. So there are a few limitations though. The first major gotcha is the fact that your laptop has to be on or your computer has to be on, and the desktop app has to be open.
03:44So if you turn off your computer, that automation will not run. And the good news is let's say you had a task for 7AM and you wake up at eight, you turn on your computer, Cloud Code would actually check back seven days and see any scheduled task that it missed and then would catch up and it would run those. Obviously, that's not perfect because some of those may be time sensitive, but it is cool that it has that ability.
04:02Now what are some other things to think about? Well, the first one is that this thing is now running without your supervision. And ideally, it's not gonna stop to ask you questions because then what's the point of having it automated?
04:12So that means you want to be looking at your permissions to make sure that it can't actually go off the rails and do anything, like maybe make a major change to your GitHub repository or go off and delete things. And you can take care of that by changing your local settings in that project, which you could just say, hey.
04:26I wanna make sure that you never delete things. How can I put this in your settings? You know, deny a bash command that does any deletes or removes, and it will help you figure that out.
04:34I've got a video coming about this. I will tag that right up here once that is live on YouTube. These are also stateless.
04:40So basically, every time that you run one of these, it's going to throw it in in a new session. So right here, I did a test run of my morning coffee. Here's the actual task itself.
04:48And then when I open this up, I will be able to see every run. And every run is going to be fresh, and it's not going to have context of what happened on the previous run. And the other thing, of course, is that if you didn't put in an API key or if there's literally something that it can't do because it needs your permission, it's gonna stop.
05:01So what I'd recommend is as soon as you create a new task, just run it manually and make sure that it can go through all of the steps without oversight. Otherwise, what's gonna happen is it's gonna pause and it's gonna ask you for permissions to do this and permissions to do that. Now sometimes it's a good thing that they're stateless and that they don't have shared memory, but sometimes you might want them to.
05:18And that would be kind of part of this whole self improving thing. So here's how I imagine the self improving loop working. So first of all is fixing the actual script.
05:27So you can have in there the fact that if it errors, edit your own code and make sure you're fixed. The second layer is the prompt. So if you realize that there's an opportunity to improve this prompt, rewrite it, and now you have a new prompt.
05:38And then the third one is potentially having a log for memory. Whether that means every single run, you put some sort of, like, status of what that run did, or maybe you just have a file that you overwrite so that every time when the new agent wakes up, it can look at the log and say, hey. This is what the previous agent just did.
05:52Now I need to run. So there's lots of ways that you can kind of tweak these scheduled tasks to fit your use cases better. And once again, because they have the context of everything in that project, they're gonna be super powerful.
06:02They can look at any file that you want them to. So that's what my brain immediately went to, but I wanted to see what Claude Co. Thought.
06:08So I asked it what it thought the most optimal strategy was to make these improve and make sure they have the right context. So what it thought of was a lean strategy where you have one file per task. So basically, every single time the agent runs, it would overwrite this file with information like, here's the last run, here's how long it lasted, here's what happened, here's what I did, here are known issues, and things like that.
06:29And this is better than an append log in some scenarios because like I said earlier, if you run an automation a thousand times, then you might have a thousand append logs. But then what's cool is the actual structure of your prompt.
06:39So when you're creating a new task right here, the way that you prompt it, you could basically say, okay. Before you actually do your job, go ahead and read this file, which is basically the last run.
06:49And then you do your main task, and then after you're done with the task, overwrite that file with any current issues or status or anything that you found that might help the next agent. So obviously, I'm gonna be playing around with different structures of having context shared between these different, you know, tasks, but that's just something that I thought would be really, really cool.
07:05So another thing I wanted to talk about is because this is in the desktop app and because this is running on a schedule, how do you want to get notified that that scheduled task has been done? So the desktop app does have notifications, but they're not super great. At least it wasn't making any noise and it wasn't capturing my attention.
07:20It's cool that everything gets organized over here, so as you have more tasks, you can see them all and it's organized. But what you can do is you can add a hook so that every time you actually get a sound. So what I did is I set up a hook so that every time a ClaudeCode session finishes, I get a notification.
07:34So listen to this.
07:38So that was like kind of the default Windows little sound. You can change that. But But that's really helpful because I could be working and I could forget that a scheduled task might go off and then I get that noise.
07:46But the other thing I would recommend is in the prompt of the actual skill itself, maybe just at the bottom say, hey. Once this is done, just shoot me a ClickUp message and say that this happened. And that's probably what I'm gonna set up for all my scheduled tasks.
07:58And if you're curious about setting up hooks, literally just say to Cloud Code, set up a hook. I want you to play a sound every time you finish talking to me, and it will do it in, a minute. And the last thing I was curious about is
08:08the fact that we're limited to the desktop app. Now Anthropic is shipping like crazy, so I'm sure in a week or two that this is gonna be open in the terminal and in the IDE extensions and stuff like that too. But for the moment, it's only desktop app.
08:22And basically why is because all of the actual, like, cron logic and that kind of metadata lives in the desktop app even though the actual files live in your computer. They live somewhere where terminal or your Versus Code, Cloud Code could actually see it. So I was interested in that, and I said, are you able to see my scheduled task for morning coffee?
08:40It runs at 06:09, and here's where it lives because it lives kind of in this global folder path right here. And it can see it. Right?
08:47Because it just exists as a file. But what it can't do is it can't create new scheduled tasks because it can't actually touch the cron that the desktop app of Cloud Code sets up.
08:57CTABut what it could do is it could edit it. So it could improve it. It could make changes,
09:02CTAbut it can't create them or, like, run them. Now that's actually not a huge deal to me right now because I usually work in Versus Code, but I can just have the desktop app open, and I can just leave it open in the background while I've got my computer on, and all of my scheduled tasks will still be running. And so now that Cloud Code is so powerful on its own, it can actually, like, do things in the browser as well.
09:20CTAI truly think we're getting to that point where you can automate anything. So I'm gonna go ahead and stop talking. What you need to do now is go learn how to set up your project and create your own executive assistant to become way more productive and start to schedule some stuff.
09:31CTAGo ahead and watch this video right up here. So, hopefully, I'll see you guys over there, but that is gonna do it for today. So I appreciate you guys making it to the end.
09:37CTAAnd if you enjoyed the video or you learned something new, please give it a like. It helps me out a ton, and I'll see you on the next one. Thanks, everyone.
— full transcript
§ 05 · For Joe

Automation that fixes itself while you sleep.

WHAT TO LEARN

The shift from cron scripts to agent sessions is the difference between automation that stops when something breaks and automation that diagnoses the problem, fixes its own code, and runs correctly the next time.

  • Scheduled tasks run a full Claude Code agent, not a script, so error recovery, tool access, and self-modification are all in play from the first run.
  • The stateless design is intentional: each session starts clean to prevent context bloat, but requires an explicit on-disk memory pattern to accumulate improvement over time.
  • One overwritten log file per task, not an append log, keeps context short enough to fit in a session without degrading over hundreds of runs.
  • The three-layer self-improvement loop means fix code on error, rewrite the prompt when improvements are spotted, and update the run log each time, so a well-structured task gets more reliable the longer it runs unsupervised.
  • The desktop-app-only constraint is architectural, not a polish gap: the cron scheduling mechanism lives in the app, not in files any process can trigger.
  • Always run a new task manually before leaving it on schedule to flush permission prompts that would otherwise silently pause an unattended run.
  • Any existing Claude Code skill becomes a scheduled automation with one sentence of natural language instruction, making the activation cost near zero once the skill exists.
§ 06 · Frame Gallery

Visual moments.