HomeVideos

Stop Fixing Your Claude Skills. Autoresearch Does It For You

Now Playing

Stop Fixing Your Claude Skills. Autoresearch Does It For You

Transcript

525 segments

0:00

I freaking love Claude code skills. I

0:02

think you do too, but sometimes they're

0:04

a little bit unreliable. I would say

0:06

about 70% of the time I run a skill, I

0:08

get an intended output, but 30% of the

0:11

time it's a bag of rocks. What I wanted

0:12

to do in this video is I wanted to show

0:14

you how to combine Claude code skills

0:16

with a new development in the AI space

0:18

called auto research to achieve

0:19

significantly higher reliability,

0:21

accuracy, and allow your skills to quite

0:23

literally improve themselves overnight.

0:25

So, I'll keep this as simple and as

0:26

straightforward as possible. First, I

0:28

need to show you where this idea of auto

0:30

research comes from. To make a long

0:32

story short, one of the former founding

0:34

members of OpenAI, and later head of AI

0:37

at Tesla, is called Andrej Karpathy,

0:39

released an auto research GitHub repo a

0:42

few days back. And what this does is

0:44

this allows a team of agents to

0:47

autonomously optimize some process. This

0:50

process, in his case, was the training

0:52

of another machine learning model called

0:54

nanoGPT, but in our case, it's going to

0:57

be our skill, and actually improving

0:59

that skill over time by making the

1:01

prompt better, better, and more

1:02

airtight. Now, you don't need to read

1:04

the whole repo. There are actually only

1:05

a couple things in here that I think are

1:06

important and immediately applicable to

1:08

the purposes of, you know, business or

1:09

improving skills.

1:11

And they are as follows. This repo is

1:13

deliberately kept small and only has

1:15

three files that matter. The first is

1:17

this file called prepared.py. The second

1:20

is a file called train.py, and the third

1:22

is program.md.

1:24

So, to make a long story short, this

1:25

prepared.py, this is like machine

1:26

learning specific stuff. So, we don't

1:28

actually need to worry about it. This is

1:29

something that is specific to uh

1:31

training a tokenizer and so on and so

1:33

forth. The stuff that actually matters

1:34

for us is train.py and program.md. And

1:38

so, I want you to pretend for a second

1:40

that this train.py is actually your

1:42

skill.md.

1:44

And then your program.md is just your

1:46

agent.

1:48

And basically, what we do is we're going

1:49

to provide a prompt to our agent in a

1:51

program.md. And the prompt is going to

1:53

say, "Hey, I want you to improve this

1:56

skill using the method discussed in auto

1:58

research. The way that you're going to

2:00

measure whether or not the skill is

2:02

fantastic or crappy is as follows. And

2:05

then we're just going to give it some

2:06

brief criteria, which in machine

2:08

learning terms is typically referred to

2:09

as an eval, and then in that way make

2:11

the skill better and better over time.

2:12

Now, just before I go any further, I

2:14

want you to know this is a pretty big

2:15

development. You don't just have to use

2:17

it for skills like I'm going to show you

2:18

here. And I want to make that clear in

2:20

this video just as I did in my last

2:22

video. You know, earlier this morning I

2:24

was a little bit bored and I was like,

2:26

"Hey, what can I use this cool auto

2:27

research library on?" And I realized

2:29

that I had this old app that I developed

2:31

many years ago, and I was just curious,

2:32

"Hey, how much faster could I make this

2:34

thing?" So, all I did was I took the

2:35

same repo that I just told you guys, and

2:37

then I said, "Hey, I want you to use the

2:38

same approach to make my website

2:40

faster." And over the course of about 67

2:43

different tests, this auto research

2:45

methodology took my load speed from

2:47

about 1,100 milliseconds literally down

2:49

to 67. This is sort of the same thing

2:52

that we're going to do with our skill.

2:54

It's just we're going to be re-

2:55

sponsible for developing the eval set,

2:57

which I'm going to cover in a few

2:58

moments. So, I mean, in our case we had

2:59

an 81.3% improvement in time. In your

3:02

case, it might be an 81.3% improvement

3:05

in accuracy. Who knows? Um but what's

3:07

really cool about this is not only will

3:09

you get the actual improvement itself,

3:10

you get a big list of changes that the

3:12

models will have tried to make in order

3:14

to improve your skill, which means,

3:16

since AI models are getting smarter, at

3:18

any point in time over the course of the

3:19

next few years, you can just take this

3:20

big list of things, just pass it on to

3:22

the next agent. You can take this big

3:24

list and pass it on to GPT-6 or Opus

3:27

5.0, and it'll be able to pick up where

3:29

its predecessors left off. I think this

3:31

is actually probably soon to be one of

3:32

the most important and valuable assets

3:35

of our time, just a bunch of research

3:36

data. But anyway, you don't care about

3:37

that, you care about how to make your

3:38

skills better. So, let me run you

3:40

through it. Uh in order for auto

3:41

research to work, you need three

3:43

ingredients. You need an objective

3:45

metric, okay? Now, that's a number that

3:47

you can measure. It's something that

3:48

doesn't feel faster or resonate more or

3:51

or whatever the heck

3:53

vibes the kids are talking about these

3:54

days. It's an actual number. So, in my

3:56

website example, it was a load time in

3:58

milliseconds.

3:59

I'm now running auto research on cold

4:01

email campaigns, so it's my reply rate.

4:03

In our case for skills, what this is

4:05

going to be is this is going to be

4:06

called our eval, or evaluation pass

4:09

rate. I'll show you guys how to make

4:10

that in a second. Next, you need some

4:12

form of measurement tool. This ideally

4:15

would be automated, reliable, there'd be

4:16

no human in the loop. For that website

4:18

example I just showed you guys, I used a

4:20

suite of website testing tools called

4:23

Lighthouse that Google provides out of

4:25

the box. That's how I figured out how

4:26

long it took to load the site. You know,

4:28

for my cold email a suite, I'm using API

4:30

analytics for Instantly. Now, for us,

4:32

what we're going to do is we're actually

4:33

going to have an agent write what's

4:34

called a test suite, which is just like

4:36

an order of operations saying, "Hey, I

4:38

want you to run the first evaluation,

4:39

and then run the second evaluation, then

4:41

run the third evaluation, and so on."

4:43

Finally, you obviously need something to

4:45

change, right? So, you know, in my

4:47

website example, that's the code

4:48

changes. My cold email example from

4:50

yesterday, that's the email copy itself.

4:52

In our case, it's just going to be the

4:53

skill instructions. Basically, it's

4:54

going to be the prompt, okay? It's going

4:56

to be the markdown file. And so, if you

4:58

think about it logically, what we're

4:58

going to be doing is just like in Andrej

5:01

Karpathy's auto research repo, is we're

5:02

going to be providing the skill as sort

5:04

of like our I don't know, our train.py

5:08

over here. And then we're going to be

5:09

providing the agent some high-level

5:10

instructions. We're just going to stick

5:12

that right over here in like the

5:13

program.md.

5:16

And then we're just going to have it

5:17

basically say, "Hey, every time you run

5:19

the skill, I want you to evaluate it

5:21

against a suite of tests that we

5:22

developed, and then tell me whether or

5:24

not it's better than what we did the

5:25

last time." And then in this way, I just

5:26

want you to get better and better and

5:27

better over time. And I want you to run

5:29

this every 5 minutes. And that takes me

5:31

to this concept of evals. Now, skills

5:33

are just prompts, right? And prompts are

5:35

inherently noisy. What I mean by that is

5:37

sometime you'll run a prompt and it'll

5:38

do X. Another time you'll run a prompt

5:41

and it'll do Y. And so, in order for us

5:43

to develop a standardized set or suite

5:45

of ways to improve the quality of our

5:47

skills over time. We can't just run them

5:49

once. What we have to do is we have to

5:51

run them many, many times, and then we

5:52

have to take the mode, which is the

5:54

frequency, and then the median, which is

5:56

kind of like the average of results. You

5:58

know, if I run 20 skills, and all of

6:00

them are tasked to generate me an image,

6:02

which is going to be what we're working

6:03

on today,

6:05

um you know, every single time there are

6:06

going to be some slight differences.

6:08

But, there are going to be things within

6:10

each diagram or every image that is

6:12

similar, and there also going to be some

6:13

things that are different. In the

6:15

reality, all machine learning and all AI

6:18

outputs are distributions of data. And

6:20

so, in order for us to control against

6:22

that and allow us to make iterations and

6:23

improvements on them, we just need to

6:25

run them many, many times. But, running

6:27

multiple times is not enough. We also

6:29

need to evaluate the outputs of our

6:31

skills according to some standard. You

6:34

know, it's kind of like testing back in

6:35

school. You could know everything there

6:38

is to know about astronomy, okay? But,

6:41

there's no way to assess your knowledge

6:42

unless we give you a test on it. And

6:44

those tests are going to be similar

6:46

sorts of questions asked in similar

6:48

sorts of ways. So, what you can think of

6:50

is what we're doing here is we're

6:51

basically benchmarking the performance

6:53

of our skills. And the best way to do

6:55

that is using binary yes or no, true or

6:57

false questions. So, as a really meta

7:00

example, today I want to show you how to

7:02

improve a skill that I call diagram

7:04

generator. If I scroll over here to the

7:07

right, you'll remember this diagram that

7:09

I showed you guys and used to mark up a

7:10

moment ago. Well, I actually used AI to

7:12

make that. And that's the skill that

7:14

today I want to improve successfully

7:16

over time with standardized evals and

7:18

auto research. Now, in our case, it's

7:21

hard for me just to look at it and say

7:22

whether it's good or bad, right? And so,

7:24

instead, I want to have a series of

7:26

standardized questions that I could ask

7:28

another agent to review it to tell me

7:31

whether or not this thing is good. And

7:32

realistically, I can't just say, "Hey,

7:35

you know, is the text legible?"

7:37

I can't just say, "Hey, you know, does

7:39

it look good?" I need to break it down a

7:41

lot more granular than that. Now, you

7:43

might be wondering, well, what the heck

7:44

does that look like for a diagram? In my

7:46

case, I have narrowed down four criteria

7:49

to make a high-quality diagram.

7:51

The first is, is all of the text in the

7:53

diagram legible and grammatically

7:55

correct? If so, odds are it's an okay

7:58

diagram. The second is, does it fit my

8:00

color palette, which is defined as

8:02

pastel colors, soft colors. I don't want

8:04

like super bright reds or oranges or

8:06

neon greens cuz I find that just looks

8:08

unprofessional and lame.

8:09

The third is, is it linear? Does it go

8:11

left to right or top to bottom? You

8:14

know, previously I was generating a lot

8:15

of images that just were all over the

8:17

place and I don't know, there was spread

8:19

out ball bubbles and bobbles and so on

8:21

and so forth, which just looked odd. And

8:23

then fourth, is it free of numbers,

8:25

ordinals, and ordering? In case you

8:26

didn't know, that basically is just the

8:27

presence of 1 2 3 4, which is kind of

8:29

meta cuz that's how I decided to number

8:31

this. But, the point is, if all of my

8:34

diagrams are free of all of these

8:36

things, odds are that's a good prompt.

8:38

You know, it does something that I want.

8:40

So, what I'm going to do is I'm going to

8:41

take this, give these requirements to my

8:44

agent. I'm going to ask it to create an

8:46

evaluation test set for me, and then I

8:48

can just run this thing on auto loop

8:49

over and over and over again till my

8:51

scale is fantastic. Okay, the first

8:52

thing you need to do is set up something

8:54

that allows you to communicate with

8:56

Claude Code. In my case, I'm doing this

8:58

in Antigravity, so I have an Antigravity

9:00

window set up with the Claude Code

9:02

extension inside of it. You guys could

9:04

do this in whatever way you want. Second

9:07

thing you need to do is grab the Andre

9:09

Carpi the auto research repo. So, I'm

9:11

going to go back over here.

9:13

And then I'm going to copy this link,

9:15

then I'm just going to feed this

9:17

directly into my agent and I'll say,

9:18

"Read this."

9:20

Next, we need our eval test suite, so

9:22

I'm going to go back to my Chrome

9:24

instance, then just grab these four,

9:27

then head over here.

9:29

And then fourth, third I should say, we

9:31

actually need to tell it what we want it

9:32

to do. So, I'm just going to use a voice

9:34

transcription tool called Whisper Flow,

9:36

and then just a language ask it to do

9:37

this.

9:38

Hey, I want you to use the auto research

9:41

convention in the above repo in order to

9:44

build out a self-improving skill system

9:47

for my diagram-generator

9:50

skill. The eval suite I'd like you to

9:53

run is the four constraints above.

9:57

What I want to occur is every 2 minutes,

10:00

I want you to generate 10 diagrams for a

10:03

specific function. Whatever those

10:05

functions are are okay. And then I want

10:07

you to pass them through this eval test

10:09

suite, rate how many of those made it,

10:12

and then alter and improve the prompt as

10:14

necessary to get it to the point where

10:16

it's knocking 10 out of 10s out of the

10:18

park. Okay, I'm then going to press

10:20

enter over here.

10:22

And this is going to feed everything

10:24

into, in my case, Opus 4.6.

10:27

It'll start by reading the auto research

10:29

repo, which is up here.

10:31

Then it's going to explore the diagram

10:33

generator skill.

10:34

You might be wondering what the diagram

10:35

generator skill is. Well, it's actually

10:37

really simple. It's basically just

10:39

generate clean hand-drawn style diagrams

10:41

from natural language descriptions. The

10:44

output should look like a whiteboard

10:45

sketch with pastel rounded rectangles,

10:48

simple line art icons, thin arrows, and

10:50

clean labels on a white background. The

10:53

way it works under the hood is we send

10:54

the request over to Nano Banana Pro 2,

10:57

and then we get these things that we can

10:58

paste onto my Excalidraw. My total cost

11:01

is about 2 cents per generation using

11:03

this super fast model. And that means,

11:06

you know, if we're going to run 10 every

11:07

single time, logically speaking, I'm

11:09

going to spend about 20 cents per test.

11:11

So, if within 50 tests I can get it to a

11:13

good place, I will have optimized the

11:15

skill for about $10. And just given how

11:17

much money my YouTube videos make me,

11:19

you know, a good banger video might make

11:20

me several hundred dollars in ad revenue

11:22

per day. Um obviously, this is like a

11:24

pretty positive return on investment for

11:26

me. So, I'm going to give it some time,

11:27

let it read everything it needs to read,

11:29

and then circle back when it's ready.

11:30

And just halfway through I decided to

11:32

clarify the scoring mechanism. So, what

11:35

I want as mentioned is I wanted to

11:36

generate 10 images. I have four

11:38

criteria, so that'll be a max score of

11:40

40.

11:41

Um that means that I'm going to generate

11:43

10, evaluate all 10 against the four

11:44

criteria, count the score out of 40,

11:47

make iterations the prompt, try again,

11:48

and then pick the winner. Um and I just

11:50

gave it that because I I realized after

11:52

I did the voice transcript I didn't

11:53

specifically mention I wanted to run 10

11:54

times. And it's now opening up a

11:57

real-time dashboard for me to show me

11:59

the results, which I think are really

12:01

cool. So, as you can see here we have

12:03

the first test already in with

12:05

legibility scores and total scores right

12:07

over here.

12:08

And it looks like another experiment

12:10

just concluded where we went from uh 32

12:12

up to 37. And it's just going to

12:15

continue making this prompt better and

12:16

better and better to adhere to my

12:18

specifications over time. I mean, in my

12:20

case we started with a 32 out of 40, so

12:22

that's pretty dang good already.

12:23

Realistically, I imagine this is only

12:25

going to take a few runs to get to where

12:26

we want to get it to.

12:28

But, that is the magic of auto research

12:30

because we're all going to have

12:31

different uh definitions of good. We're

12:33

all going to have different, you know,

12:34

constraints and eval test suites. So,

12:37

what might be 32 out of 40 for me might

12:38

have started for you at like a two out

12:40

of a 100. The one thing that matters is

12:42

just how much time you let it run on.

12:44

So, if it runs for, you know, a couple

12:46

of days, couple of weeks, couple of

12:48

months, you can imagine you could start

12:49

basically wherever the hell you want and

12:50

eventually it's going to be fantastic.

12:52

The core thing is just defining the

12:54

right set of evals, and my

12:55

recommendation is always just make them

12:57

simple yes or no answers, a good or bad.

13:00

And now it's just going on in the

13:01

background. You can see here it's

13:02

already done run one and run two. Did

13:04

these two inside of the thread just so

13:06

we could see how they go. Now everything

13:08

else is just occurring autonomously, 10

13:10

diagrams every two minutes, evaluating

13:12

via Claude Sonnet Vision, mutating the

13:14

prompt, and then just keeping the

13:15

winner. So, we can apply this to any

13:17

skill we have. I can apply this to my

13:19

proposal generator. I can apply this to

13:21

auto research itself. I can apply this

13:23

to my agent review. I can apply this to

13:25

my model chat. And, you know, I will.

13:27

I'm going to create a meta skill that

13:28

goes through and then performs a sort of

13:30

optimization for literally every skill

13:32

in my repo just to get it as close as I

13:34

can to perfect. And you can see that

13:36

it's actually taking my advice on the

13:37

second run, okay, as it's written here.

13:40

Um none of these letters or words or

13:42

anything like that are eligible. They're

13:43

no problems. It just finished up another

13:44

one, by the way.

13:45

Um it's linear, so it's left to right.

13:47

It's experimenting with a few different

13:48

styles here, but it does have those nice

13:50

pastel colors, like those cute icons,

13:52

and then ultimately those rounded

13:54

borders, which I like. And it's just

13:55

getting better and better and better.

13:56

This is probably one of the ones that

13:58

failed. It didn't spell authorization

13:59

right. Eventually, the runs get so good

14:01

that it's in this sort of hand-drawn

14:02

pastel

14:04

uh uh style, which is more or less

14:05

exactly what I want. And, you know, we

14:07

eventually hit 39 out of 40 on this

14:09

experiment, which I think is pretty

14:10

good. You know, for me to get 39 out of

14:12

40 sort of like equivalent to me getting

14:14

97.5% on a test. I'm fine with 97.5%.

14:18

Some quick tips on the evals, um you

14:21

know, yes or no is the simplest way to

14:22

pitch it. Does this diagram contain X,

14:25

Y, and Z? Only two possible answers

14:27

there. You can try implementing some

14:29

sort of scoring or scaling, like a

14:31

Likert scale. You know, evaluate this

14:33

out of seven for X, Y, and Z. In my

14:35

experience, not so good just because

14:37

you're compounding probabilities here.

14:39

The more variability you give the model

14:40

at every step along the chain, the more

14:42

like variable it gets in total. Imagine

14:45

like a little cone, right? It starts

14:46

over here really, really narrow, but

14:48

then the more variability, the more we

14:50

compound out until eventually my my my

14:52

answer, you know, my out of 40 could be

14:55

at 39 out of 40 or it could be a two out

14:56

of 40. So, um yeah, go binary wherever

15:00

possible. Also, don't go so concrete and

15:03

so like narrow that the model starts

15:05

optimizing for silly things. Like I've

15:07

seen a lot of people say stuff like,

15:08

"Hey, make sure this is under X words.

15:10

Make sure this doesn't include these

15:12

symbols or these characters." That's

15:14

pretty That's pretty stringent, I would

15:16

say. And um you know, if you give the

15:17

model way too many of these evals, what

15:19

it'll eventually we is it'll just like

15:21

find a way to parrot every single one of

15:23

the evaluation points back to you. So,

15:25

even if the actual quality of the thing

15:27

is not very good, it'll technically say,

15:29

"Passes the test and it's good to go."

15:31

That's sort of like a student who, you

15:32

know, doesn't really understand the

15:33

material, but then still gets 100% on

15:35

the test. And that's that. I'm going to

15:37

give you guys access to this down below.

15:38

No email, no gatekeeping whatsoever.

15:40

Feel free to take this and then use this

15:42

for your own skills. And I'm going to

15:43

get to employing this on the rest of my

15:45

own. Hopefully, you guys learned how to

15:47

optimize your own skills using auto

15:49

research. As mentioned, there are a

15:51

million things that you can apply auto

15:52

research to. It's not just your skills,

15:55

nor is it just your prompts. You can use

15:57

auto research for your websites, for

15:58

your landing pages, for split testing

16:00

titles, thumbnails, emails, literally

16:02

whatever the heck you want. I'm sure a

16:04

lot of people in the ecosystem are

16:05

figuring out better and more powerful

16:07

ways to do so over time. If you guys

16:09

like this sort of thing, but maybe were

16:10

a little bit lost in the actual Claude

16:12

portions, definitely check out my full

16:14

4-hour Claude code course below. I cover

16:17

everything, including skills, but also

16:20

how the interface works from start to

16:22

finish. Aside from that, leave me a

16:24

comment down below with whatever you'd

16:25

like to see in the next video. I read

16:27

every one and I'll catch all y'all in

16:29

the next. Thank you very much for your

16:31

time.

Interactive Summary

This video explores how to leverage the 'auto research' framework, introduced by Andrej Karpathy, to automate the optimization of AI-powered coding skills. By implementing a system of objective, binary 'evals' (evaluation criteria) and an automated feedback loop, developers can iteratively improve their prompts and agents. The author demonstrates this process by refining a 'diagram generator' skill, showing how the system autonomously tests, evaluates, and mutates prompts to reach high performance levels. This methodology is presented as a versatile approach that can be applied to various tasks, from website optimization to email campaign improvements.

Suggested questions

4 ready-made prompts