Now, before I'll continue working on this
have to understand about the way Claude works and what we can do
to optimize it. Let's say you wanna use Claude Code to
check whether your current implementation is in line with your
expectations and the usage instructions by the libraries you're
using. For this project, where we just implemented it
and verified it ourselves, this doesn't make too much sense.
But of course, for bigger projects or existing code bases, you
absolutely might wanna do such a review.
So I'm asking Claude Code to do that and I again tell it to use web
search or the Context7 MCP to look up the docs.
And I'll send it to it like this, not in edit mode, not in
plan mode, because I just wanna get a reply.
I just want it to analyze. Now the important
thing to understand here is that when Claude
Code goes to work, it will often use
sub-agents. In this case for example, the explore
agent, which is one of the agents built into
You can tell that it's using that because there are tasks happening
here whilst we have another task running here in the background, so
to say. Because Claude Code can spin up
sub-agents that do work whilst it continues with other
agents or the main agent that is running on other work.
So it simultaneously looked up some documentation with the
Context7 MCP whilst the explore agent is still
exploring folders and files in this project,
task of this explore agent that's built into Claude
Code. It's simply an agent that's optimized for
reading and understanding files and folders.
So Claude Code will, out of the box, delegate certain
tasks to built-in sub-agents and do certain work in
parallel to speed it up and to have dedicated
experts for certain tasks. You'll see that it still
does quite a lot of work, especially all that documentation look up
here, step by step on the main agent.
So every node you see here, every bullet, that's
essentially work done in the main agent, and this explore task here
is then done with help of a sub-agent, as you saw when that was still
running. You can also tell that it was a sub-agent because it tells you
how many tokens were consumed and how long it took.
And the important thing about sub-agents is that they don't
consume or pollute the context window of the main agent.
They have their own context window, which of course, is another reason
why this feature exists. It allows Claude Code to split
up complex work into smaller building blocks and outsource
them without putting everything into the main context window.
Instead it will just get the result of this sub-agent, so a
summary of its exploration work, and load that into the main
context window. That's why this sub-agent feature,
get for free out of the box, is very useful.
And here of course I can see that a lot of things are great.
What's not great is that we got some missing components,
we haven't worked on that yet. But before we do that, let's build our
own custom sub-agent.