Memuat
Memuat
Want to go deeper?
Join one of our courses or ask us directly on WhatsApp.
Picked from the software, topic, and level of “Claude from Zero to Expert Class #85: Scheduling Tasks to Run on Their Own”.
Other ways we can help with Claude.
Learn with a mentor
Scheduled AI & Machine Learning courses with live guidance and a certificate.

Midjourney Course: Create Stunning AI Images from Text
★ 4.9

DALL-E Course: Creating Professional AI Images from Text
★ 4.9

Stable Diffusion Course: AI Art from Beginner to Professional
★ 4.9
Have it built for you
No time to learn Claude? Our team can do the project for you.

AI Image Creation with Stable Diffusion — Unlimited Custom Visual Production
★ 4.9

AI Image & Video Creation with Leonardo AI — All-in-One Visuals for Business
★ 4.9

AI Image Creation with Midjourney — Cinematic AI Art for Business
★ 4.9
Get notified about new Claude classes
At most one email a week. Unfollow anytime with one click.
The full narration of this video. The current sentence is highlighted while the video plays; click any sentence to jump there.
Hi, and welcome to the final episode of the Automation with Claude Code session. We already have scripts for tidying files, merging data, and building reports. Now for the last step: making those scripts run on their own on a schedule, for example every Monday at seven in the morning, without us typing any command.
Not every task is a good fit for scheduling. The first condition: the task repeats on a fixed schedule, such as a sales summary every Monday morning or merging orders every night. Second, the rules are fixed. If a human decision is still needed along the way, such as choosing a supplier, the task isn't ready to run on its own. Third, the script has run successfully by hand at least three times. Don't schedule a script that was only finished today. Fourth, don't schedule tasks that send money or delete data. Tasks like that always need human approval every time they run. Let's understand the division of work. What wakes the task up is the computer's built-in scheduler: Task Scheduler on Windows, or cron on Mac and Linux. Both are already there; nothing to install. The scheduler runs a script that Claude wrote and that's already tested. Notice that Claude doesn't need to be open when the schedule runs. The script stands on its own. Every time it runs, the script writes a record to a log file: the start time, what it did, and whether it succeeded. And people still check the results and the log regularly. Automation without checking is just waiting for problems to arrive quietly.
Dewi wants the weekly sales summary to run on its own every Monday at seven in the morning, and asks Claude to prepare the script so it can run safely unattended. Claude explains four changes. The script must not ask anything, because nobody is there to answer at seven in the morning. Folder paths are written in full. Everything is recorded in a log. And if the branch files aren't complete, the script stops with a clear message. Claude adds logging and an upfront check to the summary script. Then it creates a small trigger file ending in bat. This is the file the scheduler will call. All it does is call Python with the full path and save the output to the log folder. Before registering it with the scheduler, the trigger file is tested by hand. The permission box is clear: create this week's summary. Dewi approves. The test works. There's a dated log file and a summary file for week forty-three. Let's read the log, because this is the file Dewi will check every Monday. The first line records the start time and the week being summarized. The second line: fifteen branch files found. If a branch hasn't sent its file yet, this is where you'll see it. The third line: totals match, a difference of zero rupiah. The total check from an earlier episode runs automatically too. The fourth line: the summary file was created. The last line is the most important: finished with no problems. Just by reading this last line, Dewi knows whether everything is fine.
Now we register the schedule. Dewi asks Claude to register the trigger file in Task Scheduler: every Monday at seven in the morning, with an easy-to-recognize name. This permission box is important to read carefully. The schtasks command is Windows' built-in tool for creating schedules. Check four things: the task name, the file to run, Monday, and seven o'clock. Everything is right, so Dewi chooses Yes. Windows reports that the schedule was created successfully. Don't wait until Monday to see the result. Claude runs the task once through the scheduler, to make sure everything works through the same path as the real schedule. Claude points out something that's often forgotten: the computer must be on and not in sleep mode at that time. In an office, that's usually the admin's computer or a small server that's always on. If you're more comfortable clicking, you can create the same schedule through the Task Scheduler window. Open it from the Start menu by typing Task Scheduler. Choose Create Basic Task, and give it a name and a short description so your coworkers know what it does. In the trigger section, choose weekly, Monday, seven in the morning. In the action section, choose start a program, then point it to the trigger file. Menu names may differ slightly depending on your Windows version, but the flow is the same.
Now an example on a Mac. Laras wants Sunset Coffee's orders merged automatically every night after the shop closes. Raka opens Claude Code on Laras's laptop. Claude suggests nine thirty at night, half an hour after closing. A cron schedule is written on one line: five time fields, then the command to run. Claude explains what it means in everyday language: minute thirty, hour twenty-one, and each asterisk means every day of the month, every month, and every day of the week. Ask for an explanation like this whenever you see a cron line. The permission box shows the command. The important part is in the description: add one schedule without removing existing ones. If the command would replace all schedules instead, decline it and ask Claude to fix it. Claude lists the schedules to make sure the line was recorded. Just like on Windows, the laptop must be on at that time. To keep it from being confusing, let's read three example cron lines. The first is Sunset Coffee's: every day at nine thirty at night. The second matches Dewi's schedule on Windows: minute zero, hour seven, and the number one in the last field means Monday. The third suits a monthly report: eight in the morning on the first of every month. You don't need to memorize the rules. Just ask Claude to write and explain them, then check the meaning before you approve.
Finally, safe habits for scheduled tasks. First, read the last line of the log every time you use the results. It takes ten seconds. Second, ask the script to leave an obvious sign when it fails, such as a file named FAILED in the output folder, so problems don't stay hidden inside the log. Third, review the schedule list once a month. Switch off schedules you no longer use, because a forgotten schedule can keep running for years. Fourth, and this is absolute: email or app passwords must never be written inside a script. If a script needs to send email, ask Claude to use the system's secret settings, then check that service's official documentation for how. Let's look at what this session produced. Dewi and Laras now have four work scripts: tidying files, merging Excel files, building reports, and merging CSVs. Two of them run on their own: the Monday morning summary at Dewi's office, and the nightly order merge at Sunset Coffee. About four hours are saved every month, not counting the copy-and-paste mistakes that no longer happen. The Claude Code screens in this video are simulations, so details on your screen may differ slightly.
We made scripts run on their own with Task Scheduler and cron, complete with a log, testing, and safety rules. The Automation with Claude Code session is complete. In the next episode we start the Advanced Claude Code session with Git: how to save a history of every change so we can always go back to a safe version. See you there!
Try these on your own after watching to lock in what you learned.
Type a question or keyword; we find the part of this episode that explains it and jump the video there.
Notes are saved with the current video time and are only visible to you.
Stuck on a step? Ask here; the instructor and other learners can answer.
No questions yet.

Cerdas Inovasi Digital Team
Software developers, BIM & 3D engineers, and AI practitioners
We build software, BIM models, games and AI automations for clients every day, and turn that hands-on work into step-by-step classes: every step is shown on screen and comes with a PDF guide you can keep.
See our clients →