00:00:00The Anthropic team have released a loop skill for Claude Code to run prompts at set intervals
00:00:04and people on the internet are going crazy, hooking it up to Discord or Telegram to communicate
00:00:10with their agent just like they would with OpenClaw, and some are even using it for Ralph
00:00:14Loops.
00:00:15But they're using it all wrong because the loop skill was not designed for that purpose.
00:00:19I mean, there is a reason they didn't call it schedule and call it loop.
00:00:23Hit subscribe and let's find out why.
00:00:29It's no secret that Claude is being used to write 100% of Claude Code because the team
00:00:34have been shipping features like crazy, but usually the hype level matches the usefulness
00:00:39of the feature.
00:00:40So Claude remote control, lots of hype because it's very useful.
00:00:43Async hooks less hype because they're less useful.
00:00:47But this is the first feature that has more hype around it than the usefulness of the actual
00:00:53feature.
00:00:54Before you get angry, let me explain.
00:00:56So here is the latest version of Claude Code running Sonnet, which I'm going to change
00:01:01to Haiku since the prompts I'm going to use don't require such a sophisticated model.
00:01:06So here I just have the loop, which takes an interval in minutes, hours or days.
00:01:10Note the minimum granularity is in minutes.
00:01:13So even though you can write seconds, Claude doesn't support them yet.
00:01:16And then it also takes a prompt, so I'm going to write, say hello.
00:01:20And if I hit enter, it uses the cron create skill to create a scheduled task.
00:01:25You can also set a specific time so I could do loop and here it said hello very quickly.
00:01:30I'll write a prompt of say hello again at 6.30 PM.
00:01:35And here Claude uses the local time for the machine you've installed Claude code on and
00:01:39not UTC.
00:01:40So keep that in mind.
00:01:41I'll set this to a daily recurring task and that's pretty much it.
00:01:45The prompt can contain anything you want.
00:01:47So skills like I could use this tweet skill to write me a tweet along the lines of Claude
00:01:52has an awesome new loop skill and I'll set that to run every three minutes.
00:01:56The prompt can also read a file, run MCP tools.
00:01:59Basically anything you can do with Claude code you can add to your prompt.
00:02:02And I could list the current cron jobs running with this prompt, which uses the cron list
00:02:07tool to list out the jobs.
00:02:09And I could delete a job by saying what the job does or by using the ID.
00:02:13There's also a jitter on the time of cron jobs to prevent multiple jobs at the same time hitting
00:02:17the anthropic API, which means an hourly job can fire anywhere between zero and six minutes
00:02:23on the hour.
00:02:24Now, yes, this is a really cool feature and people are saying it has replaced Open Claude
00:02:28for them because you can set it on an interval to pull messages from WhatsApp or Telegram
00:02:33and respond to them like a real AI assistant, which is what people were using Open Claude
00:02:37for doing.
00:02:38But there are two major issues with the loop feature that prevent it from being an Open
00:02:43Claude killer.
00:02:44First of all, the cron tasks auto expire after three days to prevent you from having long
00:02:49running tasks that you might have forgotten about.
00:02:51This could of course be really annoying if you've hooked the loop up to listen for telegram
00:02:55messages and go to it on the fourth day to find out it doesn't work.
00:02:59Now there is a way to run jobs forever inside Claude code without a plugin, but we'll talk
00:03:04about that later on in the video.
00:03:06The second issue is that cron tasks are stored in session memory and are not written to disk.
00:03:12So if I close this Claude code session, I'm going to clear my terminal and create a new
00:03:16one.
00:03:17Then if I ask it to list my scheduled tasks, you'll see that nothing has been scheduled,
00:03:21even though I scheduled two tasks in the previous session.
00:03:25This means if you wanted to close the session to update Claude or if you wanted to use the
00:03:29loop feature for a Ralph loop, it isn't really a good idea since you can't properly reset
00:03:34the session and have to rely on compaction to continue long running tasks.
00:03:39So what should you be using this feature for?
00:03:41Well, whenever you have to rerun a task manually in the same session, because something has
00:03:46changed, then you should be using a loop for that.
00:03:49For example, if you're checking the last 50 lines of a continuously updating log file
00:03:53for errors, seeing how many items are left in a job queue or checking if you have any
00:03:57new issues in your project.
00:03:59Now I'm sure the team will add more options to loop in the future, like setting a specific
00:04:03model for a task or changing the expiry time.
00:04:06But if you want a task to run forever in Claude code, you can kind of already technically do
00:04:11that without any plugins.
00:04:13You can do that in Claude for desktop by opening the sidebar if it isn't already and clicking
00:04:17on scheduled in the menu.
00:04:19Now if you don't see this scheduled option, you may have to update Claude for desktop.
00:04:23And here we can create a task, giving it a name, description and prompt.
00:04:27We can even change the model, set permissions and set frequency down here.
00:04:32This is exactly the same as if we were to write schedule inside the prompt section of Claude
00:04:36code desktop, but what's really interesting is that inside cowork, there is also a scheduled
00:04:42option.
00:04:43Now this is different from the scheduled option in Claude code, not only because the modal
00:04:47looks different and we have to click on more options to change the default model, but also
00:04:52because Claude cowork runs inside a sandboxed environment, whereas Claude code runs on your
00:04:59local machine.
00:05:00So if you schedule a task in Claude code, that's going to use your local file system.
00:05:05Whereas for Claude cowork, it's going to do it in a sandboxed environment, which is important
00:05:10so you know where to put your scheduled tasks.
00:05:12Now the benefit of adding a schedule task inside Claude desktop is of course the task will run
00:05:16forever as long as the computer is switched on and the Claude desktop app is opened.
00:05:22But if you're like me and would rather use Claude code in the terminal to schedule tasks,
00:05:26then you can use this plugin by Kenneth, which does look promising and I may try it out in
00:05:31the future if there's enough interest.
00:05:33Speaking of other promising things I haven't yet tried out, open AI released GPT 5.4 last
00:05:39week and people seem to be excited about it.
00:05:41If you want to know more, check out this video from James who goes through all the details.