Build a SaaS with Claude: https://designcourse.com/app/course/claude-code-ai-saas (Take now)
-- Today, I'm going to set up my first Claude Routine to show you how it works and if it's something that's worth integrating into your own project. Not everything should be a routine, some tasks are best left for a simple CRON job. Do you need intelligence/decision making?
#claude #ai
- - - - - - - - - - - - - - - - - - - - - -
Subscribe for NEW VIDEOS!
Learn UI/UX: https://designcourse.com
My personal FB account: http://fb.com/logodesigner
Coursetro FB: http://fb.com/coursetro
Coursetro's Twitter: http://twitter.com/designcoursecom
Join my Discord! https://discord.gg/a27CKAF
^-Chat with me and others
- - - - - - - - - - - - - - - - - - - - - -
Who is Gary Simon? Well, I'm a full stack developer with 2+ decades experience and I teach people how to design and code. I've created around 100+ courses for big brands like LinkedIn, Lynda.com, Pluralsight and Envato Network.
Now, I focus all of my time and energy on this channel and my website Designcourse.com.
Come to my discord server or add me on social media and say Hi!
Оглавление (2 сегментов)
Segment 1 (00:00 - 05:00)
Claude has just released routines, which are really just glorified AI-infused cron jobs. And I'm going to show you my first time using and setting one up for a real use case for designcourse. com, my primary business. And we're going to see what this flow and this process looks like. So, there's a few different ways to set up a routine. You can do it through Claude AI right here in this UI. You can do it in the Claude code CLI, which is what I use when I code. And then also, you can use it in Claude desktop. Now, the first thing I did is I went into my project, opened up Claude, and I asked it, "Where can we use routines? Does it make sense anywhere to use routines in the context of my app? " But, you really have to be careful because it suggested some use cases that would just be way better to set up with cron jobs. So, when do you actually know when you should use a routine versus something like a cron job? Well, if it needs intelligence, like if you need decision-making, that's when you want to use a routine as opposed to a cron job. Now, what's really cool about routines is they don't use API billing, which we know is way more expensive. It uses your actual Claude subscription. So, a use case that I came up with that I want to test is I get a lot of spam email. email for sponsorships because of the size of my channel. Most of them are all junk. And so, what I want is a routine that would check maybe my email every 4 hours, and it's set up through Zoho Mail, which has an API endpoint that it can, you know, interface with. And it will go through all the latest emails received in the last 4 hours, if any, and it will discard any of the BS sponsorship requests that I get that don't have anything to do with my channel or my topic. And also, if somebody does submit an actual email that needs my attention, it will flag it. Then, it will send a text message with it. That way, I get notified, you know, not just through email, but through my actual phone text. And that way, I can really be on top of things. I think that would be a good use case for routines because it does require intelligence. Now, one of the fundamentals of routines is connectors, and there's a ton of different services that you can choose and interface and add to your routine. But, in this case, I'm going to be using Twilio API for the text messages. And there's no connector for it already in Claude that I found, at least. So, we're just going to hit it up the API endpoint directly with curl within the routine. All right, so here I am. We're going to set up here using claude. ai/code/routines/new. And I'm going to give it a name of 4-hour email notifier. And then, describe what Claude should do in each session. Okay. So, what I did is I hit up Claude code CLI. I told it exactly what I wanted to do and have it write the prompt for me. Here is the prompt. I'm not going to read through this, but you can kind of see how it constructs a system prompt to help it kind of filter through the sponsorship emails and the regular contact form emails, as well. Then, I'm going to click on schedule right here. And this is going to be hourly. All right, runs every hour. I want custom, and I'm not sure how to specify this, so I literally just pasted this as a screenshot to Claude code just now, and it told me to specify this for every 4 hours right there. Okay, so we're going to hit add trigger. Now, in order to actually add those environment variables, we edit the actual routine right here. And where it says default, we're going to click add environment. This is where they're going to be pasted. Don't paste it in the chat right here. You want to paste it in the environment variable section. So, I pasted it in, create environment. I'm going to hit run now, once more. Great, says all environment variables are set. All right, and it is done. Now, unfortunately, the whole sending me a text thing is not going to work until Twilio approves the phone number and my ability to send a text. That could take several days or weeks, even. Uh so, just as a temporary workaround, I had it use Zoho Mail to send me my personal email a summary of my business emails, and it worked. So, if I go over here, it called it Inbox Scout, but it's just giving me a summary of uh potential sponsorship here, Coursera, uh paid collab, blah blah, contact, no new website contact submissions in the last 4 hours. There we go. So, really, this would be in the form of a text message that I just get automatically, so I don't have to forget to check my email or anything. And there we go. That is one way to use routines here in Claude code. Now, the best way to use it isn't like trying to directly uh interface with APIs via curl or anything. It is to use, you know, the connectors that are in there. But, for my case, they didn't have Twilio. They also didn't have Zoho, so that's how I used it. So, anyhow, yeah, it makes sense to use routines, you know, because you kind of get that whole claw type setup. Um but, it has to make sense in terms of what your use case is. Do you need something that needs intelligence that, you know, you use AI to do stuff for you and make decisions? If so, and it's on a
Segment 2 (05:00 - 05:00)
recurring basis, then yeah, use routines. All right, everybody, I will see you all very soon. Definitely check out the top link here in the description for the follow-along Claude code course that I'm building now. It's very cool. I will see you soon. Bye.