Ch 13: Cadence: GitHub, routines, /loop
Collection: Nate Herk: AIOS course ยท Creator: Nate Herk (@nateherk)
Original: raw source ยท demo-lab/research/nate-herk-course/transcript.txt @ 1:34:30 ยท 7,265 words ยท 20 sections
Content by Nate Herk (@nateherk). Chapter starts at 1:34:30. Auto-transcribed; names may be misheard.
Summary
- The difference here is that a local routine has to run with the desktop app open.
- You configure a routine once," which is basically like a prompt, and it can run on a schedule from an API call or in response to an event, and it runs on Anthropic's web infrastructure, so that's awesome.
- I'm not really going to dive into that right now, but what I wanted to tell you guys about that is I tried to basically move over this school wins engagement post or sorry, automation into a remote session.
- So if you have a massive project like a Herc2 project, for example, with tons of context and tons of stuff, Maybe you don't want to put that repo into the cloud to be a routine run, because there's a lot of text in that cloud that MD and in that whole GitHub that might not matter for this.
- All right, so as you guys just saw in the quick demo, we now have the ability to use loops, which means that we could say something like slash loop every five minutes, check on the deploy, Or we could just say that in natural language, which is awesome, because it invokes the loop skill, and then it creates that cron job right here in Claude Code.
Entities mentioned
Claude Code ยท GitHub ยท ClickUp ยท Slack ยท Skool ยท Anthropic ยท YouTube ยท AIOS ยท Python ยท Nate ยท Gmail ยท CLI ยท Google ยท OAuth ยท WAT ยท MCP ยท VS Code
Topics
Topic: api key ยท repo ยท github ยท Topic: scheduled tasks ยท routines ยท run ยท Topic: connect ยท routines ยท Topic: project ยท step
Key points by section
[1:34:30]
- So for example, I have a front-end design skill that is installed globally, so that whenever I'm anywhere, if I need to do front-end design, it just is able to use it.
- So Herc 2, and then we have .cloud, and then within .cloud we have skills, and then your skill, and then your MD, your references, whatever, and then maybe another skill.
- So the reason why you might wanna do this is if there's something very specific about you, your business, your workflows, that you want applied to every single project no matter what, maybe your company context, your company projects, your tone of voice, whatever, then you can install that globally instead.
- So now that you guys understand skills a little bit better and you're excited to start building some, the last piece of the four C's is cadence.
- Topic: Topic: project ยท step
[1:36:00]
- So in this example, we've got the AIS with our, you know, our read me, our cloud, we've got our references, we've got our dot cloud with our skills.
- And this is all being stored locally, meaning if you have one laptop that you're working on this with, and then you open up your second laptop, they will not sync.
- So GitHub is basically a place for you to upload your folders and files and basically your code base.
- So if you guys remember at the beginning of this video, when you cloned my repo, that's because I uploaded it there so anyone could go clone it.
- Topic: Topic: api key ยท repo ยท github
[1:37:30]
- with Claude Code on the cloud, or an Open Cloud agent, or a Hermes agent, or whatever of these other agent frameworks that you wanna use, a codecs even, you could plug that into any different AI harness.
- And you guys remember earlier, I mentioned that you could also use the desktop app of Claude, because in Claude, you have code, you have co-work, and you also have Claude chat, and you can use Claude code right here in the desktop app, and you can run your AIOS just fine.
- The difference here is that a local routine has to run with the desktop app open.
- But a cloud routine can run with your desktop app closed
- Topic: Topic: scheduled tasks ยท routines ยท run
[1:39:00]
- But on my plan, which is 200 bucks a month max plan, I can only have 15 remote cloud routines running per day.
- So for example, this is my school wins engagement scheduled task or routine.
- It dropped in this exact prompt, it ran the skill called wins engagement.
- I'm gonna go ahead and play a clip right here just to dive into the cloud routines a little bit more because I think that those are very important to understand.
- Topic: Topic: scheduled tasks ยท routines ยท run
[1:40:30]
- You configure a routine once," which is basically like a prompt, and it can run on a schedule from an API call or in response to an event, and it runs on Anthropic's web infrastructure, so that's awesome.
- So you can call a routine from an API, you can have GitHub events trigger it, or they can be scheduled, which are like the scheduled automations we already have, but now they run on the web.
- Or what I'm going to be showing you guys today is just doing it in the desktop app, because right here, if I go to my scheduled tasks, you can see that I've got some like these four that are local.
- But then you would configure your model, your repository, and your cloud environment.
- Topic: Topic: connect ยท routines
[1:42:00]
- So if you need to connect Slack or Gmail or, you know, know, whatever it is, you can connect them right here, but you can also just do your regular API endpoints with your API keys.
- So I'm gonna tell you guys the issues that I ran into and hopefully answer everything that you need to know so that you won't have to go into the comments and ask these common questions.
- So the way that this works is you need a GitHub repository to sync it to in order for this to actually run.
- But as you guys know, you don't push your secrets into GitHub because if you see here my Herc2 project,
- Topic: Topic: connect ยท routines
[1:43:30]
- this is my .env file with all of my API keys, and this is listed in the gitignore, which basically says, hey, when you push to GitHub, you don't include these files.
- So how do you get your API keys into this routine that runs on the web?
- You have the name of this cloud environment, you have the network access and you have environment variables.
- So right here is where I put in my YouTube API key, my clicker API key, any of the other API keys that I need to give this cloud environment access to.
- Topic: Topic: api key ยท repo ยท github
[1:45:00]
- So think of a scheduled task or a routine as you basically typing in a prompt and then someone coming in to your laptop and typing it in for you.
- What I tried to do is I did another one, which I wanted it to be able to use the YouTube data API in order to grab some YouTube comments for me and give me a little analysis in ClickUp or whatever.
- My YouTube API key is available as an environment variable, use it directly from the environment, don't look for a .env.
- So in this Herc2 project, when I normally run this, it grabs all my API keys from the .env and maybe it reads the clod.md and realizes that's where a lot of those live.
- Topic: Topic: scheduled tasks ยท routines ยท run
[1:46:30]
- And then another one that I do is I have some automations here, which basically opens up a browser using playwright CLI, and it does some stuff in my Skool community because there's no publicly accessible API.
- I'm not really going to dive into that right now, but what I wanted to tell you guys about that is I tried to basically move over this school wins engagement post or sorry, automation into a remote session.
- So I copied the exact same prompts that was in my regular scheduled task.
- So if I wanted to do an automation like this, I would have to use, um, an endpoint that takes authentication in the form of like actual cookies or a header or, you know, like an API key, because every single one of these runs is going to be stateless.
- Topic: Topic: scheduled tasks ยท routines ยท run
[1:48:00]
- You set the schedule, you add any connectors you might need, which would honestly be a little easier if you added just like a Slack connector, and then you can set your permissions here.
- So if I come over here to my settings, you can see if I go to my usage, we have our regular session limits, our model limits, but for additional features, we have daily included routine runs.
- So I could only have 15 automations running with routines per day because I'm on the max $200 a month plan.
- Like you define a routine, which is a prompt, you connect a GitHub repo, you can also trigger it by APIs or by a GitHub action, and then you can connect your connectors.
- Topic: Topic: connect ยท routines
[1:49:30]
- Because of the fact that this is working off of a cloned repo, it's going to read, and read the Cloud.md, that would be file automatically every time.
- So if you have a massive project like a Herc2 project, for example, with tons of context and tons of stuff, Maybe you don't want to put that repo into the cloud to be a routine run, because there's a lot of text in that cloud that MD and in that whole GitHub that might not matter for this.
- We have desktop scheduled tasks, and then we have something like just a slash loop command.
- No, for the routines because it works off of the GitHub repo and for the next two, yes, you have
- Topic: Topic: api key ยท repo ยท github
[1:51:00]
- Obviously your .env is git ignored unless you push it into the GitHub repo.
- You know, ultimately if you push it into a private repo, you're probably okay, but you wanna be really, really, really careful because then, you know, there's history there and if other people, you know, end up collaborating on it, you just don't wanna do that.
- So you wanna put your API keys in the environment variable, like I showed you guys earlier.
- You want to look at the network access, whether that is full or trusted or none or custom, and potentially some setup scripts.
- Topic: Topic: api key ยท repo ยท github
[1:52:30]
- Now, practical risk for private repos where you control the inputs is very low, but I definitely just wanted to at least acknowledge that.
- Because once again, everything is going to be running as you, so if you're not testing out these routines before you just kind of send them off every hour or you just have to be thinking about what could happen without permissions and stuff like that.
- So every one of these routines in the cloud runs on four VCPUs, 16 gigs of RAM, and 30 gigs of disk space.
- So once again, just be thinking about, Are you putting an absolutely massive GitHub repo up into the cloud right now to run?
- Topic: Topic: api key ยท repo ยท github
[1:54:00]
- I have a skill that I wanted to run, I give it the order of operations, but something more like this YouTube comments one, this is not what you'd wanna put in there unless you were defining a skill to just let it run.
- Because once again, this is supposed to be a one-shot prompt, so you wanted to make sure it gets it right on the first try.
- If you know when I talk about the WAT framework where we have workflows and agents and tools, when we actually push those automations to the cloud and it's just sort of a Python script, we're losing the agentic piece.
- And if you configure it the right way, it will be able to sort of like leave a memory trail and it can leave like, you know, updates even though each run is stateless, you can still have them kind of continuously get better.
- Topic: Topic: api key ยท repo ยท github
[1:55:30]
- You could maybe even have it at the end of every single routine, say, hey, if this does fail, just shoot me a Slack message to let me know, things like that.
- And then you just watch it, watch it go through its order of operations and you can inject and you can help it correct itself.
- Claude Code can now remind you to do things, check on things practically for you and work for days straight without you ever touching it or needing to give any input.
- It goes ahead and uses a cron create tool to set this reminder.
- Topic: Topic: connect ยท routines
[1:57:00]
- So just shot off this one that says every 10 minutes, check my click up to see if there's any new developments on our project.
- It's using the loop skill, as you can see, which is a new built-in skill, and it creates a cron for every single 10 minutes.
- All right, so as you guys just saw in the quick demo, we now have the ability to use loops, which means that we could say something like slash loop every five minutes, check on the deploy, Or we could just say that in natural language, which is awesome, because it invokes the loop skill, and then it creates that cron job right here in Claude Code.
- So this is available in your terminal, in Claude Code Desktop app, in VS Code extensions, wherever.
- Topic: Topic: api key ยท repo ยท github
[1:58:30]
- So if I leave this session up, every 10 minutes it would check everything right here, which means that it's able to continuously read through what happened in the past one and it continuously sees what we're doing.
- And of course you could use actual slash commands to invoke both the loop and the skill, or you could just say every 20 minutes, run my review PR skill.
- So whether that's, hey, at 4.30 remind me I have to go do this, or every hour remind me to just stand up and look away from my screen for five minutes, it can do that.
- Cool, so what that's gonna do is it's going to use the cron create tool, and it's going to create that basically schedule to remind me, take out the garbage.
- Topic: Topic: scheduled tasks ยท routines ยท run
[2:00:00]
- So at this interval, which is just how cron works, it's basically going to shoot a prompt into this window that says remind Nate to take out the garbage.
- It's going to use a tool called cron list and it only can see the 1040 AM take out the garbage.
- The loop tool basically tells it how to set up cron jobs and how to use the cron create.
- And it might invoke the loop skill because we actually called it to, but looks like it didn't because it knows exactly what it needs to do already.
- Topic: Topic: api key ยท repo ยท github
[2:01:30]
- And one final thing to keep in mind is in VS code, if you close out of a tab and then you just open up that conversation again, that still will kill those cron's.
- And all of those can be invoked with natural language, which is awesome.
- And if you want anything longer than three days, then you would either just recreate that loop, or that probably indicates that you should just turn this into a legitimate scheduled task.
- Now, the other thing that you can do is if you want to completely disable scheduling, so maybe in your natural prompting, it's accidentally creating all these cron's you could go into your environment variables and just disable that and it would probably be able to help you figure that out.
- Topic: Topic: scheduled tasks ยท routines ยท run
[2:03:00]
- But obviously there's tons of things that you can do here with context management and reading different files in order to kind of Frankenstein your own fix there.
- So now that all the features have been explained and you've seen a demo, I think that probably you understand the difference between the loop and the scheduled tasks a bit better now.
- The scheduled tasks are disk stored, they're long-lived, they have catch-up, and these are like daily, weekly, monthly functions that can run indefinitely.
- Maybe by the time you watch this video, scheduled tasks are already out for the terminal and extensions as well.
- Topic: Topic: scheduled tasks ยท routines ยท run
Backlinks
AIOS ยท Anthropic ยท CLI ยท Claude Code ยท ClickUp ยท GitHub ยท Gmail ยท Google ยท MCP ยท Nate ยท OAuth ยท Python ยท Skool ยท Slack ยท VS Code ยท WAT ยท YouTube ยท Hot cache ยท Index ยท Topic: api key ยท repo ยท github ยท Topic: connect ยท routines ยท Topic: project ยท step ยท Topic: scheduled tasks ยท routines ยท run