[00:00] (0.00s)
So last week, Entropic released Cloud
[00:01] (1.76s)
Routines. But as always with Entropic,
[00:04] (4.08s)
with huge power comes huge token usage.
[00:06] (6.72s)
After using cloud routines for a week,
[00:08] (8.64s)
I've collected five tips. So using them
[00:11] (11.28s)
won't make you broke. Let's start with
[00:13] (13.28s)
what is cloud routines and create our
[00:15] (15.44s)
first routine. If you already created
[00:17] (17.44s)
one, you can skip this part. So what is
[00:19] (19.52s)
a cloud routine? A routine is a save
[00:21] (21.76s)
cloud code configuration, a prompt
[00:24] (24.32s)
repository, and the set of connectors.
[00:26] (26.80s)
We'll see what is connector in a second.
[00:29] (29.60s)
packed once and run automatically.
[00:31] (31.68s)
Routines execute on a propics manage
[00:33] (33.68s)
cloud. This part is important for the
[00:35] (35.92s)
rest of the video. So they keep working
[00:38] (38.08s)
when your laptop is closed and routines
[00:40] (40.96s)
are available on all the paid
[00:42] (42.88s)
subscription of cloud pro max team and
[00:47] (47.36s)
enterprise. A connector allows you to
[00:49] (49.84s)
communicate with your routine via
[00:51] (51.92s)
external applications. There are two
[00:54] (54.16s)
types of connectors builtin connectors
[00:57] (57.04s)
and MCPs. Let's mention the popular
[00:59] (59.76s)
connectors. We have GitHub, Slack, Jira,
[01:03] (63.52s)
Google Drive, Notion, Gmail, and Canva.
[01:07] (67.76s)
For example, we can create a routine
[01:09] (69.28s)
that fetches our Gmail account, and when
[01:11] (71.60s)
we receive one type of email, the prompt
[01:14] (74.56s)
is executed. After we get a response,
[01:17] (77.52s)
the response will be sent to our Slack.
[01:20] (80.40s)
Connectors allows us to control the
[01:22] (82.48s)
input and the output of the routine.
[01:24] (84.80s)
There are three ways to trigger a
[01:26] (86.16s)
routine. The first one is scheduled
[01:28] (88.64s)
which means we're going to run on
[01:30] (90.16s)
recurring cadence for example hourly,
[01:33] (93.12s)
nightly or weekly. The second way is via
[01:36] (96.08s)
API. Claude will receive HTTP request
[01:39] (99.36s)
with a barrier token and this will
[01:41] (101.76s)
execute the routine. And the last one is
[01:44] (104.16s)
via GitHub. As we saw, GitHub is an
[01:47] (107.04s)
built-in connector and you can track
[01:50] (110.08s)
some of the events in GitHub and trigger
[01:52] (112.40s)
routines automatically. So let's create
[01:54] (114.64s)
our first routine. You can create cloud
[01:56] (116.80s)
routine both from cloud code and from
[01:59] (119.20s)
the claude website. This is the website
[02:02] (122.16s)
of claude. I'll put a link for this
[02:04] (124.24s)
website in the description. Let's say I
[02:06] (126.24s)
want to create a weekly routine to find
[02:08] (128.24s)
competitors for one of my projects
[02:10] (130.64s)
alldevs.com. This project contains daily
[02:13] (133.60s)
developer tools and it's free so you can
[02:15] (135.76s)
use it as well. So to create a routine
[02:17] (137.84s)
we need to click on this button. Now we
[02:20] (140.00s)
need to give our routine a name and
[02:22] (142.32s)
instructions. instructions is the prompt
[02:24] (144.80s)
we want claude to execute when this
[02:26] (146.96s)
routine will be triggered. Let's call it
[02:31] (151.12s)
needs.com
[02:33] (153.84s)
competitor research
[02:37] (157.84s)
and I want to execute this prompt.
[02:40] (160.40s)
Search the web for competitors of
[02:42] (162.24s)
alldevnits.com.
[02:43] (163.84s)
Tell me which tools they have and what
[02:45] (165.84s)
is missing from my site. The output
[02:48] (168.48s)
should be in a table format. name of the
[02:51] (171.20s)
competitor, URL, tool, and missing
[02:54] (174.00s)
features. After that, we need to choose
[02:56] (176.16s)
the model. I'm going to use set 4.6.
[02:59] (179.92s)
We're going to talk about which model to
[03:02] (182.16s)
choose in a second. I want this routine
[03:04] (184.24s)
to be triggered on a daily basis. So,
[03:06] (186.40s)
I'm not going to choose GitHub event or
[03:08] (188.48s)
API. I'll go with schedule. And here I
[03:12] (192.24s)
have weekly. Let's set it to 9 on
[03:15] (195.52s)
Monday. For our example, I don't need
[03:17] (197.76s)
any connectors. I can just create. So,
[03:20] (200.96s)
let's click here. So, this is my
[03:22] (202.88s)
routine. You can see that this routine
[03:24] (204.80s)
is active and it runs every Monday on
[03:28] (208.00s)
9:00 a.m. And this is the prompt. Let's
[03:30] (210.96s)
execute this routine and see what we
[03:32] (212.72s)
get. We click here run now.
[03:37] (217.52s)
That's great. We can see that the
[03:39] (219.12s)
execution was completed. So, let's click
[03:44] (224.64s)
Here at the top we can see that it did a
[03:47] (227.12s)
lot of web searches and after that it
[03:50] (230.32s)
provided the output that I wanted
[03:52] (232.96s)
competitor URL tools they have and what
[03:56] (236.16s)
is missing from alldev needs.com
[03:59] (239.20s)
you can see that I have a long list and
[04:02] (242.16s)
this is great as we mentioned we can
[04:04] (244.48s)
also manage our routines via cloud code
[04:06] (246.96s)
we need to use the schedule command the
[04:09] (249.76s)
schedule command allows you to create
[04:11] (251.84s)
update list or run schedule remote agent
[04:14] (254.64s)
s on the chron schedule or once a
[04:17] (257.12s)
specific time. So let's click on it.
[04:19] (259.68s)
First of all, I want to see the routines
[04:21] (261.84s)
we already have. So let's click on list.
[04:24] (264.96s)
We have the routine we created
[04:26] (266.64s)
alldees.com competitor research. We have
[04:29] (269.44s)
another routine. We can also create a
[04:31] (271.52s)
routine with this option. We can update
[04:34] (274.48s)
the routine and we can also trigger from
[04:37] (277.20s)
cloud code. By the way, I forgot to
[04:39] (279.28s)
introduce myself. I help developers turn
[04:41] (281.52s)
AI into real workflows. So sub and like
[04:44] (284.24s)
it really helps me provide more value
[04:45] (285.92s)
for you. But what about the token usage
[04:48] (288.24s)
of cloud routines? Routine usage tokens
[04:51] (291.52s)
like the interactive sessions do. They
[04:53] (293.84s)
also have a daily execution limit. For
[04:56] (296.64s)
example, with the prop plan, you have
[04:58] (298.64s)
five executions a day. But what can you
[05:01] (301.04s)
do about it? Let's take one routine and
[05:03] (303.68s)
apply the following tips to make sure it
[05:06] (306.00s)
won't eat up your old tokens. So let's
[05:08] (308.40s)
edit this routine.
[05:10] (310.64s)
The first tip is to make sure we're
[05:12] (312.48s)
choosing the right task for a routine.
[05:14] (314.64s)
When we think about a task, we want it
[05:17] (317.36s)
to be lean. We want the model to have
[05:20] (320.00s)
the right context and to have all the
[05:22] (322.56s)
info it needs in this prompt. We want to
[05:25] (325.60s)
do something like a big refactor or
[05:28] (328.00s)
create a major feature for our
[05:30] (330.16s)
application because this will consume
[05:32] (332.64s)
all the tokens and the context this
[05:35] (335.44s)
model will have is not enough. So what
[05:37] (337.68s)
is a good task for a routine? We want a
[05:39] (339.92s)
straightforward task without any
[05:42] (342.08s)
permission issues or any questions.
[05:44] (344.72s)
These are examples of routines that
[05:46] (346.48s)
Anthropic suggested. We have summaries
[05:48] (348.96s)
of calendars, emails, messages, health
[05:52] (352.16s)
check, PR review, release notes,
[05:56] (356.16s)
dependency update and so on. What you
[05:59] (359.36s)
can see that is common with these tasks
[06:01] (361.52s)
that these are very lean and simple. The
[06:04] (364.08s)
second tip is to have a clear output.
[06:06] (366.56s)
For example, with this prompt, create a
[06:08] (368.80s)
competitor research, it's not clear. The
[06:11] (371.44s)
model will have to guess what the output
[06:14] (374.16s)
should be. So using an exact output for
[06:17] (377.60s)
like this one, the output should be in a
[06:20] (380.24s)
table format and the attributes I want
[06:22] (382.96s)
is much better. The next tip is to pick
[06:25] (385.36s)
the right model. I'll never go with
[06:27] (387.36s)
oppus. I'll use set and haiku. As you
[06:30] (390.32s)
know, with a few executions of oppus,
[06:32] (392.64s)
you can consume all your weekly limit.
[06:35] (395.68s)
So I'm going to use set for these tasks.
[06:39] (399.04s)
And if you think the task you wanted to
[06:41] (401.36s)
execute is way bigger for set 4.6, don't
[06:45] (405.68s)
use it as a routine. The next tip is to
[06:48] (408.32s)
always test the routine you created.
[06:50] (410.80s)
Don't expect it to run smoothly on the
[06:53] (413.36s)
first time. Run it, test it, and make
[06:56] (416.16s)
sure the output you receive is what you
[06:58] (418.56s)
expect. And only after it passes this
[07:00] (420.96s)
test, you can use it on a recurring
[07:03] (423.52s)
basis. The last tip is critical. Never
[07:06] (426.56s)
expose routine to the internet. So you
[07:09] (429.04s)
don't have any control of the
[07:10] (430.40s)
executions. Don't create any end format
[07:13] (433.36s)
that will trigger a routine. That way
[07:15] (435.76s)
one user can consumes all your tokens
[07:18] (438.40s)
and you will be a victim to abuse. So
[07:21] (441.84s)
make sure the routines you create are
[07:24] (444.24s)
controlled and you know exactly when
[07:26] (446.32s)
they're going to run. Clo routines is
[07:28] (448.48s)
great, but if you want to save tokens,
[07:30] (450.64s)
you must know the advisor command.
[07:32] (452.96s)
Luckily, I created this video for