WEBVTT

00:00:00.080 --> 00:00:04.000
Now,
before I'll continue working on this

00:00:04.040 --> 00:00:07.960
have to understand about the way Claude
works and what we can do

00:00:08.000 --> 00:00:11.940
to optimize it.
Let's say you wanna use Claude Code to

00:00:12.020 --> 00:00:15.940
check whether your current implementation
is in line with your

00:00:16.000 --> 00:00:19.259
expectations and the usage instructions by
the libraries you're

00:00:19.320 --> 00:00:23.070
using. For this project,
where we just implemented it

00:00:23.140 --> 00:00:26.340
and verified it ourselves,
this doesn't make too much sense.

00:00:26.360 --> 00:00:30.000
But of course, for bigger projects
or existing code bases, you

00:00:30.100 --> 00:00:32.320
absolutely might wanna do such a review.

00:00:32.380 --> 00:00:36.080
So I'm asking Claude Code to do that
and I again tell it to use web

00:00:36.160 --> 00:00:39.420
search or the Context7 MCP to look up the
docs.

00:00:39.430 --> 00:00:43.160
And I'll send it to it like this,
not in edit mode, not in

00:00:43.200 --> 00:00:45.960
plan mode,
because I just wanna get a reply.

00:00:46.040 --> 00:00:49.860
I just want it to analyze.
Now the important

00:00:49.870 --> 00:00:53.460
thing to understand here is that
when Claude

00:00:53.660 --> 00:00:57.500
Code goes to work, it will often use

00:00:57.640 --> 00:01:01.580
sub-agents. In this case for example,
the explore

00:01:01.820 --> 00:01:05.570
agent,
which is one of the agents built into

00:01:05.600 --> 00:01:09.210
You can tell that it's using
that because there are tasks happening

00:01:09.210 --> 00:01:13.130
here whilst we have another task running
here in the background, so

00:01:13.280 --> 00:01:16.720
to say. Because Claude Code can spin up

00:01:16.740 --> 00:01:20.540
sub-agents that do work whilst it
continues with other

00:01:20.660 --> 00:01:24.420
agents or the main agent that
is running on other work.

00:01:24.480 --> 00:01:27.940
So it simultaneously looked up some
documentation with the

00:01:27.980 --> 00:01:31.920
Context7 MCP whilst the explore agent
is still

00:01:32.040 --> 00:01:35.760
exploring folders
and files in this project,

00:01:35.820 --> 00:01:39.170
task of this explore agent that's built
into Claude

00:01:39.220 --> 00:01:42.760
Code.
It's simply an agent that's optimized for

00:01:42.840 --> 00:01:45.940
reading and understanding files
and folders.

00:01:46.000 --> 00:01:49.780
So Claude Code will, out of the box,
delegate certain

00:01:49.820 --> 00:01:53.560
tasks to built-in sub-agents
and do certain work in

00:01:53.720 --> 00:01:56.840
parallel to speed it up
and to have dedicated

00:01:57.000 --> 00:02:00.840
experts for certain tasks. You'll see
that it still

00:02:00.920 --> 00:02:04.440
does quite a lot of work,
especially all that documentation look up

00:02:04.500 --> 00:02:07.320
here, step by step on the main agent.

00:02:07.360 --> 00:02:11.260
So every node you see here, every bullet,
that's

00:02:11.300 --> 00:02:15.280
essentially work done in the main agent,
and this explore task here

00:02:15.500 --> 00:02:19.420
is then done with help of a sub-agent,
as you saw when that was still

00:02:19.430 --> 00:02:23.280
running. You can also tell that it
was a sub-agent because it tells you

00:02:23.320 --> 00:02:26.500
how many tokens were consumed
and how long it took.

00:02:26.510 --> 00:02:30.300
And the important thing about sub-agents
is that they don't

00:02:30.360 --> 00:02:33.829
consume or pollute the context window of
the main agent.

00:02:33.900 --> 00:02:37.880
They have their own context window,
which of course, is another reason

00:02:37.900 --> 00:02:41.820
why this feature exists.
It allows Claude Code to split

00:02:41.880 --> 00:02:45.660
up complex work into smaller building
blocks and outsource

00:02:45.720 --> 00:02:49.220
them without putting everything into the
main context window.

00:02:49.280 --> 00:02:53.060
Instead it will just get the result of
this sub-agent, so a

00:02:53.180 --> 00:02:56.900
summary of its exploration work,
and load that into the main

00:02:57.000 --> 00:03:00.820
context window.
That's why this sub-agent feature,

00:03:00.860 --> 00:03:03.720
get for free out of the box,
is very useful.

00:03:03.740 --> 00:03:07.170
And here of course I can see
that a lot of things are great.

00:03:07.200 --> 00:03:10.800
What's not great is
that we got some missing components,

00:03:10.820 --> 00:03:14.780
we haven't worked on that yet.
But before we do that, let's build our

00:03:14.840 --> 00:03:17.320
own custom sub-agent.
