[00:00] (0.16s)
What if I told you that your Claude code
[00:02] (2.32s)
is probably working at 30% of its true
[00:04] (4.96s)
potential right now? Every time you ask
[00:06] (6.96s)
Claude to edit a component or fix a bug,
[00:09] (9.20s)
it's drowning in unnecessary
[00:10] (10.80s)
information, reading through thousands
[00:12] (12.56s)
of lines of code it doesn't need,
[00:14] (14.32s)
processing files that have nothing to do
[00:16] (16.16s)
with your request. This isn't just
[00:17] (17.76s)
slowing Claude down. It's actively
[00:19] (19.60s)
making it less accurate. when the
[00:21] (21.20s)
context window is cluttered with
[00:22] (22.80s)
irrelevant code. Claude has to work
[00:24] (24.64s)
harder to find what actually matters and
[00:26] (26.96s)
that leads to mistakes, missed
[00:28] (28.56s)
connections, and sub-optimal solutions.
[00:30] (30.56s)
But here's the thing, there's a
[00:31] (31.76s)
completely free way to make Claude laser
[00:33] (33.84s)
focused on exactly what it needs. And
[00:35] (35.76s)
I'm about to show you how. Before I tell
[00:37] (37.84s)
you how I'm going to optimize Claude
[00:39] (39.60s)
code, let me give you a quick intro on
[00:41] (41.60s)
how Claude code actually works and the
[00:43] (43.76s)
problem we're going to solve with this
[00:45] (45.28s)
tool I'm about to show you. As you can
[00:47] (47.12s)
see, I'm initializing Claude and I've
[00:49] (49.04s)
already made a prototype here, an HTML
[00:51] (51.44s)
prototype. When I tell it that I want to
[00:53] (53.44s)
make the HTML prototype better, it needs
[00:55] (55.92s)
to find ways to improve the design and
[00:58] (58.16s)
make it look nicer. When I give it this
[01:00] (60.16s)
message, since this is a new session, it
[01:02] (62.40s)
has no context of what's already in the
[01:04] (64.48s)
session. So, it's going to read through
[01:06] (66.16s)
everything. By doing that, it's not only
[01:08] (68.08s)
using up our tokens, but it's also
[01:10] (70.00s)
filling the context window with
[01:11] (71.76s)
potentially irrelevant information. When
[01:13] (73.76s)
the context window gets cluttered with
[01:15] (75.68s)
unnecessary data, it directly impacts
[01:18] (78.16s)
Claude's performance. It has to process
[01:20] (80.32s)
all that information even when most of
[01:22] (82.32s)
it isn't relevant to the current task.
[01:24] (84.24s)
This isn't just about hitting usage
[01:25] (85.92s)
limits. It's about efficiency and
[01:27] (87.76s)
accuracy. Another way Claw doesn't have
[01:29] (89.84s)
to read through all of this is if it
[01:31] (91.84s)
already knows the context of the
[01:33] (93.60s)
codebase, what's inside the code, and it
[01:35] (95.92s)
only targets the files that actually
[01:37] (97.92s)
contain the code it needs to edit. This
[01:40] (100.08s)
is a simple example because right now
[01:42] (102.16s)
there's only a single HTML file that
[01:44] (104.32s)
it's editing. But imagine if it were a
[01:46] (106.16s)
whole Nex.js project and I asked it to
[01:48] (108.48s)
edit a login component. It would have to
[01:50] (110.64s)
list the directory, read different
[01:52] (112.40s)
files, and figure out where the
[01:54] (114.00s)
component was that needed editing. Even
[01:56] (116.08s)
that component example is simple. What
[01:58] (118.16s)
if there were a random error and it had
[02:00] (120.16s)
to check every single file because it
[02:02] (122.08s)
didn't know how the codebase was
[02:03] (123.60s)
structured, what context it had, or what
[02:05] (125.76s)
was inside it. Not only would this
[02:07] (127.44s)
consume tokens, but it would also
[02:09] (129.28s)
degrade performance as claude tries to
[02:11] (131.36s)
maintain context of all these files
[02:13] (133.44s)
simultaneously. You might say that we
[02:15] (135.28s)
could improve this by using the
[02:16] (136.80s)
claude.md, which is basically the
[02:18] (138.88s)
codebase documentation. And yes, you'd
[02:20] (140.88s)
be right. If you wrote out everything
[02:22] (142.56s)
about the codebase inside the claw.md,
[02:25] (145.04s)
then claude wouldn't have to read
[02:26] (146.56s)
everything and you'd save some tokens.
[02:28] (148.56s)
But still, it has to read through the
[02:30] (150.24s)
entire markdown file, and that's still
[02:32] (152.24s)
filling up the context window with
[02:34] (154.00s)
potentially unnecessary information.
[02:36] (156.00s)
There are different types of searches.
[02:37] (157.52s)
One is textual search where a model like
[02:39] (159.76s)
Claude searches through the text it's
[02:41] (161.52s)
been given like the text in the
[02:42] (162.96s)
claude.md file. Then there's semantic
[02:45] (165.52s)
search which is much faster, more
[02:47] (167.36s)
accurate and most importantly only
[02:49] (169.44s)
returns the relevant pieces of
[02:51] (171.12s)
information. The context 7 MCP uses
[02:53] (173.76s)
semantic search and it gives you
[02:55] (175.44s)
up-to-date documentation for all the
[02:57] (177.28s)
libraries you see right here. The reason
[02:59] (179.04s)
tools like context 7 are so effective is
[03:01] (181.44s)
because they use this semantic search
[03:03] (183.36s)
approach. For example, if I tell it that
[03:05] (185.44s)
I need to implement a feature from
[03:06] (186.96s)
Nex.js, it first finds the Nex.js
[03:09] (189.36s)
library. Then when it needs to get the
[03:11] (191.36s)
library docs, whatever issue I'm facing
[03:13] (193.52s)
with Nex.js, it doesn't search through
[03:15] (195.52s)
the entire documentation. It uses
[03:17] (197.52s)
semantic search to get only the relevant
[03:19] (199.84s)
pieces of information that it needs.
[03:21] (201.68s)
This becomes much faster and more
[03:23] (203.36s)
accurate. The agent only gets the
[03:25] (205.20s)
context it truly needs. It doesn't have
[03:27] (207.28s)
to wade through irrelevant information
[03:29] (209.36s)
to figure out what you're trying to
[03:31] (211.04s)
accomplish. This focused context window
[03:33] (213.36s)
dramatically improves Claude's
[03:35] (215.04s)
performance and accuracy. This is called
[03:36] (216.96s)
rag and this can be applied to your
[03:38] (218.72s)
codebase as well. Think of it this way.
[03:40] (220.64s)
What if Claude already knew everything
[03:42] (222.56s)
about your codebase and could use
[03:44] (224.48s)
semantic search instead of textual
[03:46] (226.48s)
search? Whether your codebase is 100,000
[03:49] (229.04s)
lines or larger? What if Claude could
[03:51] (231.12s)
automatically find exactly what it needs
[03:53] (233.44s)
and pull only the most relevant pieces
[03:55] (235.52s)
of information into the context window?
[03:57] (237.84s)
That is what the Serena MCP does. It
[04:00] (240.32s)
knows everything about your code and
[04:02] (242.16s)
uses semantic search. So, it's much
[04:04] (244.24s)
faster and more performant. By keeping
[04:06] (246.24s)
the context window lean and relevant,
[04:08] (248.40s)
Claude can work more efficiently and
[04:10] (250.40s)
provide better results. It's honestly
[04:12] (252.32s)
been a gamecher. Since it's an MCP
[04:14] (254.96s)
server, it's not only constrained to
[04:16] (256.88s)
claude code. It can also be used with
[04:18] (258.88s)
other MCP clients like Cursor or
[04:21] (261.12s)
Windsurf. Personally, I like Claude code
[04:23] (263.52s)
because the models there aren't
[04:25] (265.20s)
restricted to a limited token window.
[04:27] (267.28s)
they get their full context windows
[04:29] (269.12s)
inside clawed code. This is opposed to
[04:31] (271.20s)
cursor where it's limited to 120,000
[04:34] (274.16s)
instead of the full 200,000. Even if you
[04:36] (276.64s)
do use cursor, this is still an amazing
[04:38] (278.72s)
tool for you. The reason is because of
[04:40] (280.56s)
cursor switch to their new pricing model
[04:42] (282.64s)
where they now give you a set usage of
[04:44] (284.56s)
the model. After you've used up your
[04:46] (286.48s)
credits, you switch to a pay as you go
[04:48] (288.64s)
model and start paying instead of using
[04:50] (290.64s)
their included credits. Installing it is
[04:52] (292.72s)
pretty easy. You just have to scroll
[04:54] (294.40s)
down until you reach the claude code
[04:56] (296.40s)
section. And in there, you're going to
[04:58] (298.24s)
find these two commands. You'll copy the
[05:00] (300.40s)
second one and go back into your
[05:02] (302.00s)
terminal. You need to install it in
[05:03] (303.76s)
whichever directory you want to use this
[05:05] (305.68s)
MCP server because it's specific to the
[05:08] (308.00s)
directory. If you initialize a new
[05:09] (309.84s)
directory with cloud code inside it, the
[05:11] (311.92s)
MCP server won't be present there. So,
[05:14] (314.16s)
you have to install it in every
[05:15] (315.68s)
directory where you want to use cloud
[05:17] (317.44s)
code. After you do that, you just paste
[05:19] (319.44s)
the command and this will automatically
[05:21] (321.44s)
add the MCP server to Claude Code
[05:23] (323.76s)
settings for you. Then when you fire up
[05:25] (325.84s)
Claude Code and navigate to the MCP
[05:28] (328.08s)
section, you're going to see that now
[05:29] (329.76s)
the Serena MCP is connected with a check
[05:32] (332.24s)
mark that says the connection is valid.
[05:34] (334.24s)
Another thing that the author has
[05:35] (335.76s)
provided with Serena is this dashboard.
[05:38] (338.16s)
The dashboard provides logs for the MCP
[05:40] (340.72s)
server. In addition to logs, a feature
[05:42] (342.88s)
the author personally likes is the
[05:44] (344.96s)
ability to shut down the server for
[05:46] (346.88s)
proper cleanup. And the functionality
[05:48] (348.80s)
there is pretty great, too. For example,
[05:50] (350.80s)
when you're done with the MCP server,
[05:52] (352.88s)
you can just go to this web UI and press
[05:55] (355.12s)
the shutdown button and it'll shut it
[05:57] (357.12s)
down. If I navigate back, you can see
[05:59] (359.04s)
that now the Serena MCP appears with a
[06:01] (361.52s)
crossark, which means the connection is
[06:03] (363.36s)
now cut off. To initialize it again,
[06:05] (365.44s)
I'll just exit Claude Code and
[06:07] (367.28s)
reinitialize it in the same directory.
[06:09] (369.36s)
Whenever I launch Claude Code again
[06:11] (371.12s)
after exiting, it'll automatically
[06:13] (373.12s)
launch Serena and bring up its dashboard
[06:15] (375.28s)
as well and I'll be able to view it.
[06:17] (377.44s)
Before we go further into this MCP, I
[06:19] (379.84s)
want to show you another tool that I've
[06:21] (381.36s)
been using with Claude Code. This tool
[06:23] (383.20s)
has also helped me optimize my Claude
[06:25] (385.28s)
code usage in a really nice way. The
[06:27] (387.28s)
tool I'm talking about is the Claude
[06:28] (388.96s)
Code usage monitor. It lets you track
[06:31] (391.04s)
your Claude code usage. As you can see,
[06:32] (392.96s)
I'm on the Pro plan right now. The Pro
[06:34] (394.88s)
plan works in 5-hour windows, so your
[06:37] (397.04s)
limit resets every 5 hours. And the time
[06:39] (399.44s)
remaining in this reset is 2 hours and
[06:41] (401.68s)
53 minutes. We also have other trackers,
[06:44] (404.08s)
cost usage, token usage, and message
[06:46] (406.40s)
usage. As you can see here, I'm using
[06:48] (408.48s)
clawed code right now, which is why the
[06:50] (410.32s)
message usage is actively increasing.
[06:52] (412.32s)
There's also model distribution.
[06:53] (413.92s)
Currently, there are only two models
[06:55] (415.68s)
listed here. And since I'm on the pro
[06:57] (417.52s)
plan and not on the max plan, it's 100%
[07:00] (420.08s)
the sonnet model. This helps me track my
[07:02] (422.24s)
claw code usage. It helps me optimize
[07:04] (424.48s)
how I use it by showing the reset timer
[07:06] (426.64s)
and alerting me when I'm getting close
[07:08] (428.40s)
to my message limit. That way, I adjust
[07:10] (430.64s)
my usage depending on how many messages
[07:12] (432.72s)
I have left. Another important point is
[07:14] (434.80s)
that it's right here in my terminal in
[07:16] (436.96s)
another tab. I don't have to use those
[07:18] (438.88s)
UIs built on top of Claude Code like
[07:21] (441.20s)
Claudia or the Claude Code web UI, which
[07:23] (443.84s)
are good, but I prefer using it in my
[07:25] (445.92s)
terminal. It just suits me better.
[07:27] (447.84s)
Installing it is pretty easy as well.
[07:29] (449.68s)
I'll leave the GitHub link down below,
[07:31] (451.52s)
but it's just one command. You need to
[07:33] (453.36s)
have that installed on your system. And
[07:35] (455.28s)
after that, you just copy and paste the
[07:37] (457.12s)
command. It'll install it. In my case,
[07:39] (459.12s)
it's already installed, and I can just
[07:40] (460.88s)
launch it with this command, and the
[07:42] (462.40s)
Claude code monitor will appear right
[07:44] (464.16s)
here. I found that this usage monitor is
[07:46] (466.40s)
far better than others. For example,
[07:48] (468.24s)
there's CC usage as well. I've tried it,
[07:50] (470.40s)
but it wasn't tracking my messages and
[07:52] (472.24s)
usage correctly. But ever since I
[07:54] (474.08s)
switched over to this clawed code usage
[07:56] (476.16s)
monitor, it's been really nice. Over on
[07:58] (478.64s)
the AIS Discord community, we're hosting
[08:01] (481.04s)
our first ever hackathon from July 22nd
[08:03] (483.84s)
to July 28th. Submit your most
[08:06] (486.08s)
interesting builds and projects, and the
[08:07] (487.92s)
top five submissions will be featured in
[08:10] (490.00s)
one of our YouTube videos. You can join
[08:12] (492.00s)
by clicking the link in the pinned
[08:13] (493.60s)
comment below. And if you're enjoying
[08:15] (495.12s)
the content so far, make sure to hit
[08:17] (497.12s)
that subscribe button so you don't miss
[08:18] (498.88s)
what's coming next. Now, coming back to
[08:20] (500.80s)
the tool, the first thing you're going
[08:22] (502.16s)
to do is actually exit Claude Code so
[08:24] (504.48s)
you can initialize the indexing in your
[08:26] (506.48s)
own project. And for that, you basically
[08:28] (508.48s)
have two commands. We're going to use
[08:30] (510.16s)
the first command because we installed
[08:31] (511.92s)
the MCP server using UV. We're not
[08:34] (514.08s)
running it locally. So, just copy that
[08:36] (516.24s)
command, head back into the folder where
[08:38] (518.24s)
you've installed the MCP server, and run
[08:40] (520.48s)
it. You'll see that it indexes the
[08:42] (522.24s)
project. It also gives an error saying
[08:44] (524.16s)
that this command is deprecated and
[08:46] (526.08s)
suggests using another one instead, but
[08:48] (528.08s)
this one still works. It's only a matter
[08:49] (529.92s)
of time before they update the readme.
[08:51] (531.76s)
You can find this command in the GitHub
[08:53] (533.60s)
documentation, too. I'll link it down
[08:55] (535.44s)
below. Another important thing you need
[08:57] (537.20s)
to know is that indexing works only for
[08:59] (539.60s)
certain programming languages. So if you
[09:02] (542.08s)
only have HTML in your project, it
[09:04] (544.24s)
probably won't work. And honestly, you
[09:06] (546.32s)
won't even need it. But for other
[09:08] (548.00s)
applications like Nex.js using
[09:10] (550.16s)
TypeScript or the one I've initialized
[09:12] (552.24s)
in this folder, which is just a demo
[09:14] (554.24s)
Python app I created to test indexing,
[09:16] (556.88s)
it will work with those. Once it's been
[09:18] (558.72s)
indexed, you can just go ahead and type
[09:20] (560.80s)
out Claude. And before actually
[09:22] (562.56s)
continuing with Claude, you'll need to
[09:24] (564.40s)
give it some instructions. Basically
[09:26] (566.40s)
telling it how to properly use the MCP.
[09:29] (569.04s)
This gives Claude code the context it
[09:31] (571.12s)
needs to know how to interact with the
[09:32] (572.88s)
tool. And as you can see, it's read the
[09:34] (574.72s)
instructions and now it knows what tools
[09:36] (576.72s)
are available and how to use them. It
[09:38] (578.56s)
even picked up on some key principles on
[09:40] (580.64s)
how to apply them. So now whenever I'm
[09:42] (582.72s)
requesting edits, like in this task I
[09:44] (584.72s)
gave it, which involves both the Python
[09:46] (586.56s)
files and the UI, it's no longer going
[09:48] (588.72s)
to explore the entire codebase blindly.
[09:50] (590.88s)
it's actually going to use the tool,
[09:52] (592.80s)
fetch the appropriate data, and only
[09:54] (594.80s)
bring the specific parts it needs into
[09:56] (596.80s)
the context window. This focused
[09:58] (598.56s)
approach significantly improves
[10:00] (600.16s)
performance because Claude is working
[10:01] (601.84s)
with exactly what's relevant, not
[10:03] (603.84s)
wasting processing power on unnecessary
[10:06] (606.08s)
files. This way, you'll not only save
[10:08] (608.16s)
tokens, but also get much better
[10:10] (610.08s)
performance from Claude. The cleaner
[10:12] (612.00s)
context window means faster, more
[10:14] (614.00s)
accurate responses. And from my
[10:15] (615.84s)
experience, you can easily stay within
[10:17] (617.76s)
your message limit during your 5-hour
[10:19] (619.76s)
window while getting much more done.
[10:21] (621.76s)
That brings us to the end of this video.
[10:23] (623.76s)
If you'd like to support the channel and
[10:25] (625.60s)
help us keep making videos like this,
[10:27] (627.60s)
you can do so by using the super thanks
[10:29] (629.52s)
button below. As always, thank you for
[10:31] (631.76s)
watching and I'll see you in the next