實際影片長度:18:57.000。原文、繁中、雙語可點擊句子跳轉影片。
0:00.000–0:00.960
In the past week or so, so
0:00.960–0:03.840
many people have been complaining about hitting their cloud code limit
0:03.840–0:08.540
insanely fast. Claims like one prompt that is about 1% of the limit is now around 10%.
0:08.540–0:10.364
You could go through X and find tons and
0:10.364–0:11.960
tons of threads about this topic.
0:12.300–0:13.883
Even on a $200 per month plan,
0:13.883–0:16.720
people are reaching the session limit way too fast.
0:17.120–0:20.360
And then we got this post from an Anthropic employee that basically said that they
0:20.360–0:23.184
are working on a little change with peak hours and
0:23.184–0:25.320
off-peak hours. But even after that,
0:25.400–0:27.671
some people were saying they were still hitting it really quick,
0:27.671–0:28.680
even during off-peak hours.
0:28.680–0:30.703
So anyways, I've been playing around a ton,
0:30.703–0:32.838
trying different things, doing research, an
0:32.838–0:34.749
d I have 18 token management hacks for you
0:34.749–0:36.716
guys that I've organized from tier 1 all th
0:36.716–0:39.020
e way up to tier 3 so they get more advanced as we go.
0:39.300–0:41.528
I'm very confident that by the end of this video,
0:41.528–0:43.756
you will feel like your Claude code usage has dou
0:43.756–0:45.260
bled, tripled, maybe even 5x'd.
0:45.500–0:47.820
So let's not waste any time and just get straight into the video.
0:48.080–0:50.814
So as I've been optimizing my own token management,
0:50.814–0:53.547
I think that what's really important to realize fir
0:53.547–0:55.200
st is how tokens actually work.
0:55.200–0:57.681
Because once you realize how Claude uses tokens,
0:57.681–0:59.980
it makes it very clear how you should actually
0:59.980–1:03.300
reverse engineer the way that you work in order to use less tokens.
1:03.720–1:07.076
So a token is the smallest unit of text that an AI model reads and
1:07.076–1:07.980
charges you for.
1:08.260–1:11.460
It's roughly one token is one word, but that's not explicitly true.
1:11.640–1:12.600
Kind of just a good baseline.
1:12.600–1:14.256
So every time that you send a message,
1:14.256–1:16.980
Claude rereads the entire conversation from the beginning,
1:17.380–1:19.540
and all of those are tokens that it's charging you for.
1:19.960–1:22.534
So message one, it will read it, then it will read its reply,
1:22.534–1:23.480
and then message two,
1:23.480–1:26.360
and then the reply all the way up to your latest prompt.
1:26.640–1:27.940
And it does that every single time.
1:28.220–1:30.300
And I think that alone is a huge light bulb moment
1:30.300–1:31.240
for a lot of people.
1:31.580–1:33.740
This means as you're having a conversation with Claude,
1:34.100–1:36.300
your cost is compounding, not just adding,
1:36.660–1:37.840
it's exponentially growing.
1:38.300–1:40.460
Meaning message one might cost 500 tokens,
1:40.840–1:42.560
message 30 costs 15,000
1:42.560–1:44.540
because it's rereading everything before it.
1:45.040–1:47.800
One developer actually tracked a 100 plus message chat
1:47.800–1:50.820
and found that 98.5% of all the tokens
1:50.820–1:54.160
were just spent rereading the old chat history in the session.
1:54.300–1:55.280
Like that's a huge waste.
1:55.700–1:57.420
Now, yes, the argument has to be made that,
1:57.680–1:58.688
well, it needs the context and
1:58.688–2:00.060
it needs to understand what we're doing,
2:00.200–2:02.480
but still 98.5% is crazy.
2:02.820–2:04.400
So take a quick look at this graphic here.
2:04.680–2:06.480
Along the x-axis, we have message number.
2:06.880–2:10.040
And as it increases, you can see that we have our per message cost
2:10.040–2:13.060
and our cumulative tokens increasing, but it's not linear.
2:13.300–2:16.560
It's basically each message is rereading all of the past ones
2:16.560–2:17.640
and it has to count that in.
2:17.640–2:19.120
So message one could be 500,
2:19.120–2:22.020
message 30 could be 15,500, which is 31 times more.
2:22.020–2:24.920
And then after 30 messages, you might already be at
2:24.920–2:27.440
almost a quarter million cumulative tokens. Now,
2:27.440–2:29.720
on top of all of your own messages, Claude will
2:29.720–2:32.020
also reload your Claude.md, your MCP servers,
2:32.020–2:34.320
your system prompts, your skills, your files,
2:34.440–2:37.298
on every single turn. And this is invisible overhead,
2:37.298–2:39.140
but it is constantly dripping into
2:39.140–2:40.489
your context and your tokens. And
2:40.489–2:42.560
a really important thing to realize is that bloated
2:42.560–2:44.932
context doesn't just cost you more money, but it also
2:44.932–2:46.980
produces worse output. So you're paying more
2:46.980–2:50.149
and you're getting less. There's this phenomenon called lost in the middle,
2:50.149–2:51.040
which basically says
2:51.040–2:54.550
that models are paying the most intention in the beginning of your session and
2:54.550–2:55.360
kind of at the end.
2:55.460–2:57.684
So all that stuff in the middle of your session,
2:57.684–3:00.080
kind of in this dip, is getting ignored. All right,
3:00.120–3:03.320
so now that we kind of understand a little bit more about how Cloud Code works and how tokens
3:03.320–3:04.919
work, let's move into the hacks.
3:04.919–3:07.820
We're going to start here with tier one hacks. These are the
3:07.820–3:09.517
ones that are going to be super easy to implement and
3:09.517–3:10.820
everyone should be able to understand.
3:11.280–3:12.640
So we've got nine of these.
3:13.000–3:14.940
Number one is to start fresh conversations.
3:15.580–3:18.120
Use slash clear between unrelated tasks.
3:18.540–3:21.800
Don't carry context about topic A into a conversation about topic B.
3:22.440–3:27.340
So every single message in a long chat is exponentially more expensive than the same message in a fresh chat.
3:27.340–3:31.640
So this one habit is the number one thing that extends your session life.
3:31.780–3:34.140
And it's pretty obvious based on what we just talked about.
3:34.420–3:35.580
So that's why this was number one.
3:36.220–3:39.440
Okay, number two is to disconnect MCP servers.
3:39.440–3:44.580
Every single connected MCP server loads all of its tool definitions into your context on every message.
3:45.000–3:49.680
This is another source of completely invisible tokens that might just be eating up and eating away.
3:50.020–3:53.820
So one server alone might be something like 18,000 tokens per message.
3:54.140–3:56.320
So run MCP at the start of each session and
3:56.320–3:58.500
disconnect the ones that you don't need.
3:58.900–4:01.480
And better yet, if you're able to find CLIs for something,
4:01.580–4:02.403
so for example,
4:02.403–4:06.200
rather than having the Google Workspace or Google Calendar MCP server,
4:06.200–4:09.356
which eats a lot of tokens, just use the Google Workspace CLI.
4:09.356–4:10.780
It's faster, it's cheaper,
4:11.300–4:16.480
and I think the future is moving towards having our agents use CLIs rather than MCPs.
4:17.120–4:20.035
All right, number three, batch prompts into one message.
4:20.035–4:22.160
Three separate messages cost three times
4:22.160–4:24.268
what one combined message costs because
4:24.268–4:27.120
of the way the tokens work, right? Instead of summarize
4:27.120–4:30.142
this as one message and then now extract the issues,
4:30.142–4:32.180
now suggest a fix, send it all in one
4:32.180–4:34.464
prompt. If clogged something slightly wrong,
4:34.464–4:37.100
edit your original message and regenerate instead of
4:37.100–4:39.057
sending a full follow-up correction.
4:39.057–4:42.360
Follow-ups stack onto history permanently while edits replace
4:42.360–4:43.758
the bad exchange entirely.
4:43.758–4:47.100
Now I will say there is an argument to be made here that potentially
4:47.100–4:49.874
doing it this way where you're doing task one,
4:49.874–4:52.940
task two, then task three might actually be better
4:52.940–4:55.553
output quality. I think it depends on the actual use case.
4:55.553–4:57.240
Basically the idea would be if you can
4:57.240–4:58.815
give AI one specific task at a time,
4:58.815–5:01.640
it's going to do better because it's more specialized and it's
5:01.640–5:04.451
more focused. But this is definitely something that you should be aware of.
5:04.451–5:05.120
Okay, number four
5:05.120–5:07.457
is to use plan mode before any real task.
5:07.457–5:10.360
This lets Claude map out the approach, ask you the
5:10.360–5:11.318
right questions, and
5:11.318–5:14.300
it prevents the single biggest source of token waste, which is just
5:14.300–5:16.455
having Claude go down the wrong path, writing code,
5:16.455–5:18.460
and then basically everything that it just did,
5:18.720–5:20.693
you have to basically like scrap and redo.
5:20.693–5:23.060
It's just a huge waste of time and tokens. So you can
5:23.060–5:25.009
add something like this to your Claude.md.
5:25.009–5:27.500
Do not make any changes until you have 95% confidence in
5:27.500–5:30.158
what you need to build, ask me follow-up questions until
5:30.158–5:32.080
you reach that confidence level. This is
5:32.080–5:34.345
something that I'm putting into all of my Cloud.
5:34.345–5:36.440
nmds when I am having it help me build things.
5:36.740–5:39.636
Number five, we have run slash context and slash cost.
5:39.636–5:41.760
Slash context shows you exactly what's
5:41.760–5:44.492
eating your tokens right now. So your conversation history,
5:44.492–5:46.260
your MCP overhead, loaded files, stuff
5:46.260–5:49.534
like that. And slash cost shows your actual token usage and
5:49.534–5:51.940
estimated spend for that current session.
5:52.600–5:54.704
Most people have no idea where their tokens are going,
5:54.704–5:56.340
and these two commands make the invisible
5:56.340–6:00.182
visible. Because if you don't actually know that you're bleeding because
6:00.182–6:01.360
of MCPs, then how would
6:01.360–6:03.762
you be able to fix that? So when you run slash context,
6:03.762–6:05.400
this is what it will look like. It'll
6:05.400–6:08.762
basically give you a screenshot of how many tokens you're at,
6:08.762–6:10.740
what is the cap, and it will estimate
6:10.740–6:12.641
based on the different categories. And
6:12.641–6:15.060
what I did here is this was ran in a completely fresh
6:15.060–6:18.118
session, no chats. So what that tells me is, okay,
6:18.118–6:21.400
before I even talk to Claude, I'm already down 51,000
6:21.400–6:23.901
tokens because of things like the system prompt,
6:23.901–6:26.280
the system tools, my custom agents, my skills,
6:26.340–6:29.344
memory files. And here I've actually cleared out all the MCPs.
6:29.344–6:31.020
So there wasn't anything in there,
6:31.020–6:32.489
but those can, like I said,
6:32.489–6:36.160
completely blow up your tokens right from the get go. Okay. Number
6:36.160–6:37.633
six is to set up a status line.
6:37.633–6:40.640
This kind of goes hand in hand with having more visibility.
6:40.860–6:42.618
You only actually see this in your terminal though.
6:42.618–6:43.640
So you will have to do it there.
6:44.240–6:46.307
And it basically lets you see what's going on. So
6:46.307–6:47.960
right here, you can see in my terminal,
6:47.960–6:50.844
I've got this set up so that I can see the model I'm using.
6:50.844–6:52.600
I can see a visual kind of progress
6:52.600–6:54.774
bar of my usage. And then
6:54.774–6:56.730
I can see 5% of my whole
6:56.730–7:00.860
1 million context window. And I can see 52,000
7:00.860–7:03.270
tokens out of 1000,000, which is a million. And
7:03.270–7:05.680
just to clarify, this isn't my session, like my
7:05.680–7:06.948
five hour session.
7:06.948–7:08.137
This is basically
7:08.137–7:12.020
just indicating that I'm 5% of the way or 52k out of 1000k. So
7:12.020–7:14.308
all you have to do is in cloud code in the terminal,
7:14.308–7:16.540
do slash status line and explain that you want to
7:16.540–7:19.420
replicate this setup. Number seven is just super simple,
7:19.420–7:21.460
but keep your dashboard open. Same thing
7:21.460–7:24.927
with visibility. You might run into issues with your limit and
7:24.927–7:26.660
just get hit out of nowhere. But
7:26.660–7:28.633
if you have it pulled up next to you or you have it ready so
7:28.633–7:29.920
that you can switch into that tab and
7:29.920–7:31.505
check every 20, 40 minutes, then
7:31.505–7:34.440
you're going to be able to pace yourself a little bit better.
7:34.840–7:39.420
You could even set up automation to basically check in on it every 30 minutes and send you
7:39.420–7:42.716
a text or a Slack message and say, hey, by the way,
7:42.716–7:44.940
you're getting near your usage.
7:45.480–7:48.263
All right. So number eight, we have be smart with pasting.
7:48.263–7:50.060
Before you drop a document or a file or
7:50.060–7:51.986
something large, just ask yourself,
7:51.986–7:54.160
does Claude need to read this whole thing?
7:54.420–7:56.651
Sometimes it does, sometimes it needs that full context,
7:56.651–7:57.720
but sometimes it just needs
7:57.720–7:58.980
one section or one page.
7:59.300–8:00.000
So if the bug...
8:00.000–8:00.980
So if the bug is in one function,
8:01.100–8:02.280
then paste just that function.
8:02.420–8:04.380
Or if it just needs the context of one little paragraph,
8:04.580–8:05.240
just paste that.
8:05.600–8:07.180
Claude needs to be precise about what it reads,
8:07.180–8:09.580
but you also need to be precise about what you feed it.
8:09.940–8:11.420
And number nine, our last tier one hack
8:11.420–8:14.140
is to actually watch Claude code work.
8:14.140–8:16.460
Don't just fire off a prompt and walk away or switch tabs.
8:16.880–8:19.380
Watch what Claude is doing, especially on longer tasks.
8:19.780–8:21.720
And this is because if you actually sit and watch it,
8:21.920–8:24.000
sometimes you'll realize it's going down the wrong path.
8:24.260–8:25.760
Sometimes it gets stuck in its own loops,
8:26.260–8:27.900
rereads the same files, things like that.
8:28.200–8:29.680
So if it's doing that,
8:30.080–8:31.800
you might as well just stop it right there.
8:32.060–8:33.300
Kind of the same idea as plan mode.
8:33.380–8:35.020
Why would you let it go down the wrong path,
8:35.120–8:37.140
waste all your tokens, and then just have to scrap it all?
8:37.440–8:40.180
In a bad loop, 80% of the tokens are being used,
8:40.580–8:42.480
producing zero value.
8:42.480–8:44.724
So if you're able to just watch your session run until
8:44.724–8:46.969
you know it's going down the right path, it could save
8:46.969–8:48.040
you thousands of tokens.
8:48.520–8:49.904
All right, let's kick it up a little bit.
8:49.904–8:51.120
Let's move into our tier two hacks.
8:51.460–8:53.420
And for these ones, we have five of them.
8:53.780–8:56.740
So number one is to keep your Claude.md file lean.
8:57.260–8:58.816
Place it in your project root,
8:58.816–9:01.180
whether that is globally or in local project.
9:01.740–9:05.420
Claude auto reads it at the start of every single chat as system context.
9:05.620–9:07.180
So keep it under 200 lines.
9:07.180–9:09.733
include things like your tech stack, your coding conventions,
9:09.733–9:10.600
your build commands,
9:10.880–9:13.820
the 95% confidence rule, only the most important things.
9:13.820–9:15.780
And you need to treat this like an index
9:15.780–9:17.665
route to where more data lives. And
9:17.665–9:20.460
it's a complete mindset shift. This file basically
9:20.460–9:23.149
just tells cloud code, where is everything that it needs and
9:23.149–9:24.440
what to do every single time.
9:24.440–9:26.140
So it can point to files that are huge, but
9:26.140–9:28.240
that way it just says, okay, I don't need this right
9:28.240–9:30.668
now, but if I do need this, I know exactly where to look.
9:30.668–9:32.340
And because it knows exactly where to
9:32.340–9:34.841
look, it's not going to waste time or tokens searching through and
9:34.841–9:35.660
reading other files.
9:35.660–9:37.780
It's just able to grab it right there by the file name.
9:38.120–9:39.440
And the reason I say this is a mindset shift
9:39.440–9:41.240
because you should be doing this with other things,
9:41.300–9:43.220
not just your Cloud.md, with your skills
9:43.220–9:46.260
or with your master reference guide sheets.
9:46.580–9:48.720
I saw someone talking about how they created an index
9:48.720–9:49.720
that's super, super lean,
9:50.020–9:52.080
and it shows Cloud Code exactly where to go
9:52.080–9:53.560
in the Cloud Code documentation.
9:53.880–9:56.500
So if it needs help with something related to Cloud Code,
9:56.560–9:58.440
it doesn't have to search through the whole database.
9:58.440–10:00.280
It can just say, okay, here's my index file.
10:00.380–10:02.120
I know exactly which URL to look up at.
10:02.300–10:02.860
Super simple.
10:03.240–10:05.040
You wanna keep this lean and trim it all the time.
10:05.040–10:07.617
It's always a work in progress because every single chat,
10:07.617–10:09.120
not just like your session, every
10:09.120–10:12.412
single message, cloud.md gets read. So if your cloud.
10:12.412–10:14.900
md file is a thousand lines, every single
10:14.900–10:17.068
time you shoot off a message, even if you just say hi,
10:17.068–10:18.580
the whole thing's going to get read.
10:18.920–10:21.768
Okay, number two here is to be surgical with file references.
10:21.768–10:23.220
Don't just say something like,
10:23.340–10:25.200
here's my whole repo, go find the bug.
10:25.200–10:27.540
Say something more like, check the verify user
10:27.540–10:31.090
function inside the auth.js file. Or you can also
10:31.090–10:34.120
use at file name to point at specific files
10:34.120–10:36.860
instead of once again, letting Claude explore freely.
10:37.160–10:39.200
The whole idea of being specific and routing.
10:39.580–10:40.260
All right, so number three,
10:40.360–10:43.420
I'm saying to compact at around 60% capacity.
10:43.920–10:45.760
Auto-compact triggers at like 95%,
10:45.760–10:48.280
by which point your context is already pretty degraded.
10:48.540–10:50.740
So run slash context to check your capacity percentage,
10:50.860–10:52.460
or you should have the status line set up.
10:52.740–10:55.380
And at about 60%, just run the slash compact
10:55.380–10:56.860
with specific instructions
10:56.860–10:58.360
on what it should actually be preserving.
10:58.740–11:00.280
After three to four compacts in a row,
11:00.460–11:01.980
the quality does start to degrade.
11:02.080–11:04.100
So at that point, once you've done three or four,
11:04.120–11:06.517
just get a session summary slash clear,
11:06.517–11:09.640
give the session summary back, and then keep going.
11:10.100–11:13.341
All right, so number four, short breaks are actually costing you.
11:13.341–11:14.460
Cloud Code uses prompt
11:14.460–11:17.462
training to avoid reprocessing unchanged context,
11:17.462–11:20.260
but the cache has a five-minute timeout. So if you
11:20.260–11:23.071
step away and you come back and it's been longer than five minutes,
11:23.071–11:24.400
your next message reprocesses
11:24.400–11:26.399
everything from scratch at full cost. And
11:26.399–11:28.740
that is why some people feel like their usage just
11:28.740–11:30.720
randomly spikes if they might have, you know,
11:30.720–11:32.700
stepped away and came back. So if you're going
11:32.700–11:37.120
to do that, just consider doing a slash compact or a slash clear before you step away. All right,
11:37.140–11:39.524
number five, command output bloat. When
11:39.524–11:42.820
Claude runs shell commands, the full output enters your
11:42.820–11:47.362
context window. So if you have a command that it comes back with 200 commits or,
11:47.362–11:48.480
you know, just tons
11:48.480–11:53.120
and tons of data, then all of that is tokens that get sent to your model.
11:53.120–11:54.640
So really the takeaway
11:54.640–11:57.194
here is to be intentional about what you let Claude run.
11:57.194–11:58.860
If you know in a certain project that
11:58.860–12:00.660
that doesn't need to use certain commands,
12:00.660–12:02.740
then you can go ahead and in that project,
12:02.740–12:04.800
deny those permissions.
12:04.800–12:06.880
And this is another one that seems like it's invisible
12:06.880–12:10.040
because when it runs like a bash or certain commands,
12:10.040–12:11.940
it basically just has like one line
12:11.940–12:13.600
and you don't actually see all the tokens
12:13.600–12:16.040
that it has sent there.
12:16.040–12:18.080
All right, so sitting here editing this video
12:18.080–12:19.060
and there's just one more thing
12:19.060–12:21.020
that I wanted to get off my chest
12:21.020–12:23.720
and it's basically about hitting your limit.
12:23.720–12:26.100
And the goal of this video and your goal should be
12:26.100–12:28.640
to optimize so that you don't hit your limit,
12:28.640–12:31.529
But I don't think that you should associate hitting your limit with like,
12:31.529–12:33.140
it shouldn't be a negative connotation.
12:33.520–12:37.036
Because ultimately, if you're doing a lot of these hacks and
12:37.036–12:39.920
you are not just like being wasteful with tokens,
12:40.340–12:42.880
then hitting your limit is actually a good thing if you think about it.
12:42.880–12:45.860
Because it means that you are using this tool so much.
12:45.900–12:47.080
And I think that's what you want to be.
12:47.140–12:51.474
I think you want to be a power user of this tool to the point where it's like,
12:51.474–12:52.540
got to wait again.
12:52.540–12:53.980
And, you know, waiting sucks.
12:53.980–12:56.940
but people that are using it so much
12:56.940–12:59.000
are going to be so much more productive
12:59.000–13:00.300
and so much farther ahead
13:00.300–13:02.660
than people who are never hitting their limits,
13:02.860–13:05.280
not getting their money's worth
13:05.280–13:09.000
and not truly getting the leverage
13:09.000–13:09.800
that you are now getting.
13:09.920–13:12.520
So anyways, quick little raw rant there,
13:12.640–13:14.900
but I think it's an important mindset shift to have,
13:14.960–13:16.480
just something to think about.
13:17.000–13:18.940
All right, so we're moving on to tier three now.
13:19.060–13:20.960
I hope you guys feel like you already have a lot of things
13:20.960–13:21.620
that you wanna implement
13:21.620–13:24.520
and these ones are getting a little crazier as well.
13:24.660–13:25.720
So we've got four of these here
13:25.720–13:27.060
and I've got a few bonus ones also,
13:27.360–13:28.940
but number one is to pick the right model.
13:29.320–13:31.500
So Sonnet for your default, most coding work,
13:31.960–13:34.420
Haiku for sub-agents, formatting, simple tasks,
13:34.760–13:36.260
Opus for deep architectural planning
13:36.260–13:37.940
and only when Sonnet wasn't enough,
13:38.240–13:39.860
try to keep this under 20% of usage
13:39.860–13:42.460
or unless you just really, really need it for that project.
13:42.720–13:44.920
Now, a little tip here is when you have a huge code base
13:44.920–13:46.780
and you wanna do certain things like maybe a review,
13:47.280–13:48.920
then try bringing in Codex.
13:49.240–13:50.420
There is an official plugin now
13:50.420–13:51.480
and I made a video about this.
13:51.480–13:53.552
I'll tag that right up here. But you could basically have,
13:53.552–13:54.760
you know, Opus and Sonnet working
13:54.760–13:57.390
together to build you, you know, a project or a code base.
13:57.390–13:59.180
And then you could just bring in codecs
13:59.180–14:01.132
to actually review everything. And
14:01.132–14:04.060
that way you're saving yourself on the Claude tokens.
14:04.480–14:07.272
The next one, number two here is the cost of sub agents.
14:07.272–14:09.320
Agent workflows use roughly seven to 10
14:09.320–14:12.188
times more tokens than a standard single agent session.
14:12.188–14:14.080
Now, why is that? Because they wake up
14:14.080–14:17.203
with their own full context and it's a separate instance.
14:17.203–14:18.960
So they basically have to reload
14:18.960–14:21.137
everything when you start up the new session.
14:21.137–14:23.200
All of those files, all of the system tools,
14:23.320–14:25.599
like everything like that. Now what you can do though,
14:25.599–14:27.220
which is helpful, is to delegate to sub
14:27.220–14:28.497
agents for one-off tasks,
14:28.497–14:29.715
especially if you want th
14:29.715–14:31.920
at one-off task to use haiku. So maybe you need
14:31.920–14:33.240
to process a lot of information,
14:33.240–14:35.880
or maybe you need to do a ton of research and get just like a summary
14:35.880–14:40.022
back. Now yes, tokens are still tokens no matter what at the end of the day,
14:40.022–14:41.040
but if you can make
14:41.040–14:46.260
80% of your tokens a cheaper model rather than 80% of your tokens an expensive model, then you're
14:46.260–14:48.617
going to be saving money. And then of course,
14:48.617–14:51.420
agent teams are cool. Sometimes I really do actually
14:51.420–14:54.458
like them and it helps me get more higher quality outputs,
14:54.458–14:56.420
but they're very, very expensive. So
14:56.420–14:59.351
try to use them very sparingly. All right. So
14:59.351–15:02.440
number three is to understand peak hours. So we
15:02.440–15:03.835
just talked about at the beginning,
15:03.835–15:06.160
how they've adjusted how fast your five hour session window
15:06.160–15:09.390
drains based on demand during the peak hours,
15:09.390–15:12.620
which are 8am to 2pm Eastern time on weekdays,
15:12.620–15:14.160
but off-peak this is when
15:14.160–15:17.900
your usage is kind of either normal or it lasts a little longer
15:17.900–15:20.092
and these are afternoons evenings weekends so
15:20.092–15:22.340
if you actually think about this strategically
15:22.340–15:26.980
maybe you want to make sure that you're running big refactors or multi-agent sessions or big
15:26.980–15:29.479
projects during off-peak hours only otherwise
15:29.479–15:32.040
you're going to you know drain right through that
15:32.040–15:35.681
peak session and on top of this we'll call this a little hack 3.
15:35.681–15:37.180
5 which is the one i kind of
15:37.180–15:40.130
alluded to earlier when i said hey just keep open your clot account so
15:40.130–15:41.320
you can see your usage at all
15:41.320–15:42.990
times. If you're near a reset and
15:42.990–15:46.020
you have room left in your allocation, then go heavy. Try to
15:46.020–15:47.858
hit that usage limit before it resets.
15:47.858–15:50.500
Get your money's worth. Let your agents go loose at that
15:50.500–15:53.586
point. And on the other side, if you're getting near your limit,
15:53.586–15:55.100
but you still have lots of time,
15:55.400–15:56.220
then step away.
15:56.570–15:58.627
This is your time to take a break, take a walk,
15:58.627–16:00.350
make some lunch, come back with a full
16:00.350–16:03.464
budget instead of burning the last 5% on something small and
16:03.464–16:05.270
getting stuck mid-task and having
16:05.270–16:06.439
to just kind of, you know,
16:06.439–16:08.610
lose that flow state that you might've been in.
16:08.610–16:12.035
Okay, number four, your system's constitution,
16:12.035–16:15.210
which is claw.md. This should contain stable
16:15.210–16:17.773
decisions, architecture rules, and progress summaries.
16:17.773–16:19.290
Think of it like the source of truth
16:19.290–16:21.561
that makes every prompt shorter and shorter.
16:21.561–16:24.490
Save decisions, not conversations. Every architectural
16:24.490–16:27.677
call that you store there is a paragraph that you never have to type again.
16:27.677–16:28.670
So this builds on top of
16:28.670–16:31.246
the way that you were thinking about it back in tier one.
16:31.246–16:33.150
You can add rules in there that basically
16:33.150–16:36.919
tell it, hey, I want you to help me make sure I'm being smart about tokens.
16:36.919–16:38.050
Use subagents for any
16:38.050–16:39.398
exploration or research.
16:39.398–16:42.830
If a task needs three plus files or multi-file analysis, spawn a sub
16:42.830–16:44.988
agent and only return summarized insights.
16:44.988–16:47.730
Spawn that sub agent in Haiku. And here's a little prompt
16:47.730–16:49.890
that I have at the bottom of mycloud.md. And
16:49.890–16:52.170
I will say before I read this out, you have to be
16:52.170–16:53.452
careful because when
16:53.452–16:54.592
you make a file like
16:54.592–16:57.870
this kind of self-learning or self-evolving, you have
16:57.870–16:59.304
to check on it frequently because
16:59.304–17:02.070
you don't want it to accidentally get too bloated. But here I said
17:02.070–17:04.435
applied learning. When something fails repeatedly,
17:04.435–17:06.590
when Nate has to re-explain, or when a workaround
17:06.590–17:08.957
is found for a platform tool or limitation,
17:08.957–17:11.850
add a one-line bullet here. Keep each bullet under 15
17:11.850–17:12.892
words, no explanations,
17:12.892–17:13.835
only add things that wi
17:13.835–17:15.870
ll save time in future sessions. And then it's got
17:15.870–17:19.398
some bullets. Now, I'm not saying this is the most optimal prompt,
17:19.398–17:21.130
but I think this sort of system of
17:21.130–17:23.308
having your Cloud.MD actually learn and
17:23.308–17:26.510
continuously think about how it can save you time and tokens
17:26.510–17:28.509
is a good idea to play with. All right. So
17:28.509–17:30.810
I know that we just went through a ton of stuff.
17:31.010–17:35.470
This whole slide deck will be available for download for free in my FreeSchool community.
17:35.470–17:37.352
the link for that will be down in the description.
17:37.352–17:39.050
But right now, what you should go do are these
17:39.050–17:41.820
things. Go run slash context, see what it looks like.
17:41.820–17:44.150
Go to some of your active sessions, run slash
17:44.150–17:46.417
cost. Status line, make sure it's showing your model,
17:46.417–17:48.130
your context percentage, and your token
17:48.130–17:50.794
count. Make sure you pull up your cloud usage dashboard so
17:50.794–17:52.570
you can see your remaining allocation
17:52.570–17:56.547
and what time it resets. Disconnect unused MCP servers.
17:56.547–17:59.170
Start complex tasks in plan mode. Use
17:59.170–18:02.650
slash clear when you're switching to an unrelated task.
18:02.650–18:05.390
Manually compact at 60% context. Batch your
18:05.390–18:07.846
multi-step instructions into single messages and
18:07.846–18:10.130
schedule heavy sessions for off-peak hours and
18:10.130–18:12.541
really just be mindful about the actual timing. So
18:12.541–18:14.550
I wanted to kind of leave you guys with one,
18:14.710–18:15.887
maybe two messages.
18:15.887–18:16.925
The first thing is
18:16.925–18:19.970
just the idea that there is a balance between quality
18:19.970–18:22.893
and cost. And so that's kind of a game that you have to play a little bit.
18:22.893–18:23.750
And sometimes you do
18:23.750–18:24.897
have to go for the higher quality,
18:24.897–18:27.110
which ultimately is going to cost you more money. And that's just
18:27.110–18:30.120
the way it works. But the other thing is just to keep it simple and
18:30.120–18:31.370
think about what we talked
18:31.370–18:33.031
about at the beginning of this video,
18:33.031–18:35.710
how tokens actually work, how Claude Code actually charges
18:35.710–18:37.438
you. Most people don't need a bigger plan.
18:37.438–18:39.710
They need to stop resending their entire conversation
18:39.710–18:42.067
history 30 times when you could just send it,
18:42.067–18:44.870
you know, five times. It's not a limits problem. It's
18:44.870–18:46.631
a context hygiene problem. But anyways,
18:46.631–18:48.910
that is going to do it for this one. If you guys enjoyed
18:48.910–18:50.780
or learned something new, please give it a like.
18:50.780–18:52.650
It helps me out a ton. And as always, I appreciate
18:52.650–18:54.312
you guys making it to the end of the video.
18:54.312–18:56.170
I'll see you on the next one. Thanks everyone.
0:00.000–0:00.960
過去一週左右,
0:00.960–0:03.840
許多人抱怨他們的雲端代碼用量限制
0:03.840–0:08.540
被超快地觸發。有人表示,原本只佔限制約1%的單一提示,現在卻佔到了10%左右。
0:08.540–0:10.364
你可以在X上搜尋,找到大量
0:10.364–0:11.960
關於這個主題的討論串。
0:12.300–0:13.883
即使是每月200美元的方案,
0:13.883–0:16.720
人們也過快達到了會話限制。
0:17.120–0:20.360
接著,我們看到Anthropic員工的一篇貼文,基本上表示他們
0:20.360–0:23.184
正在針對尖峰時段和
0:23.184–0:25.320
離峰時段進行一些調整。但即使如此,
0:25.400–0:27.671
仍有人表示他們依然很快觸發限制,
0:27.671–0:28.680
即使在離峰時段也是如此。
0:28.680–0:30.703
總之,我最近花了很多時間
0:30.703–0:32.838
嘗試各種方法、進行研究,
0:32.838–0:34.749
我為你們整理了18個Token管理技巧
0:34.749–0:36.716
我將這些技巧從第1級到
0:36.716–0:39.020
第3級進行分級,以便隨著講解逐漸深入。
0:39.300–0:41.528
我非常有信心,看完這段影片後,
0:41.528–0:43.756
你會覺得你的Claude代碼用量已經
0:43.756–0:45.260
翻倍、三倍,甚至可能達到5倍。
0:45.500–0:47.820
所以我們別浪費時間,直接進入影片內容。
0:48.080–0:50.814
在我優化自己的Token管理過程中,
0:50.814–0:53.547
我認為首先要了解的重點
0:53.547–0:55.200
是Token的運作方式。
0:55.200–0:57.681
因為一旦你了解Claude如何使用Token,
0:57.681–0:59.980
你就會很清楚該如何
0:59.980–1:03.300
反向工程你的工作方式,以減少Token的使用。
1:03.720–1:07.076
Token是AI模型讀取並
1:07.076–1:07.980
向你收費的最小文字單位。
1:08.260–1:11.460
大約一個Token等於一個單詞,但這並非絕對準確。
1:11.640–1:12.600
這只是一個大致的基準。
1:12.600–1:14.256
因此,每次你發送訊息時,
1:14.256–1:16.980
Claude都會從頭開始重新閱讀整個對話,
1:17.380–1:19.540
而這些都會被計入向你收費的Token。
1:19.960–1:22.534
所以第一則訊息,它會讀取,然後讀取它的回覆,
1:22.534–1:23.480
接著是第二則訊息,
1:23.480–1:26.360
然後是回覆,一直到你的最新提示。
1:26.640–1:27.940
而且它每次都會這樣做。
1:28.220–1:30.300
我認為這本身就是一個讓很多人恍然大悟的關鍵時刻
1:30.300–1:31.240
對許多人來說。
1:31.580–1:33.740
這意味著當你與 Claude 進行對話時,
1:34.100–1:36.300
你的成本是複利累積,而不只是單純相加,
1:36.660–1:37.840
它是呈指數級增長。
1:38.300–1:40.460
這意味著第一則訊息可能花費 500 個 token,
1:40.840–1:42.560
第 30 則訊息則花費 15,000 個
1:42.560–1:44.540
因為它會重新閱讀之前的所有內容。
1:45.040–1:47.800
有一位開發者實際上追蹤了一個超過 100 則訊息的聊天,
1:47.800–1:50.820
發現所有 token 中有 98.5%
1:50.820–1:54.160
只是花在重新閱讀會話中的舊聊天記錄。
1:54.300–1:55.280
就像這樣,這是一大筆浪費。
1:55.700–1:57.420
現在,是的,必須提出這樣的論點,
1:57.680–1:58.688
好吧,它需要上下文,
1:58.688–2:00.060
並且它需要理解我們在做什么,
2:00.200–2:02.480
但即便如此,98.5% 仍然很誇張。
2:02.820–2:04.400
所以讓我們快速看一下這裡的圖表。
2:04.680–2:06.480
在 x 軸上,我們有訊息編號。
2:06.880–2:10.040
隨著編號增加,你可以看到每則訊息的成本
2:10.040–2:13.060
以及我們的累計 token 都在增加,但這不是線性的。
2:13.300–2:16.560
基本上,每則訊息都會重新閱讀所有過去的訊息
2:16.560–2:17.640
並且必須將這些計算在內。
2:17.640–2:19.120
所以第一則訊息可能是 500,
2:19.120–2:22.020
第 30 則訊息可能是 15,500,這多了 31 倍。
2:22.020–2:24.920
然後在 30 則訊息之後,你可能已經達到
2:24.920–2:27.440
近 25 萬的累計 token。現在,
2:27.440–2:29.720
除了你自己的訊息之外,Claude 還會
2:29.720–2:32.020
重新載入你的 Claude.md、你的 MCP 伺服器、
2:32.020–2:34.320
你的系統提示、你的技能、你的檔案,
2:34.440–2:37.298
在每一次對話輪次中。這是隱形的開銷,
2:37.298–2:39.140
但它不斷地滲透進
2:39.140–2:40.489
你的上下文和 token。而且
2:40.489–2:42.560
一個非常重要的認知是,膨脹的
2:42.560–2:44.932
上下文不僅會讓你花費更多金錢,還會
2:44.932–2:46.980
產生更差的輸出。所以你花得更多
2:46.980–2:50.149
卻得到更少。有一個稱為「迷失在中間」的現象,
2:50.149–2:51.040
這基本上表示
2:51.040–2:54.550
模型在會話的開始和
2:54.550–2:55.360
結尾處會投入最多的注意力。
2:55.460–2:57.684
所以會話中間的所有內容,
2:57.684–3:00.080
也就是這個低谷部分,會被忽略。好的,
3:00.120–3:03.320
所以現在我們對 Claude Code 如何運作以及 token
3:03.320–3:04.919
工作,讓我們進入技巧部分。
3:04.919–3:07.820
我們將從第一層技巧開始。這些是
3:07.820–3:09.517
非常容易實作且
3:09.517–3:10.820
每個人都能理解的技巧。
3:11.280–3:12.640
總共有九個。
3:13.000–3:14.940
第一點是開始全新的對話。
3:15.580–3:18.120
在不相關的任務之間使用 /clear 指令。
3:18.540–3:21.800
不要將關於主題 A 的上下文帶入關於主題 B 的對話中。
3:22.440–3:27.340
因此,長對話中的每一則訊息,其成本都比全新對話中的相同訊息呈指數級增加。
3:27.340–3:31.640
所以這個習慣是延長對話會話生命周期的最重要因素。
3:31.780–3:34.140
基於我們剛才討論的內容,這相當明顯。
3:34.420–3:35.580
這就是為什麼它排在第一位。
3:36.220–3:39.440
好的,第二點是斷開 MCP 伺服器連線。
3:39.440–3:44.580
每個已連線的 MCP 伺服器都會在每則訊息時,將其所有工具定義載入到您的上下文中。
3:45.000–3:49.680
這是另一個完全隱形的 token 來源,可能會不斷消耗您的資源。
3:50.020–3:53.820
僅一個伺服器,每則訊息可能就高達 18,000 個 token。
3:54.140–3:56.320
因此,在每個會話開始時執行 MCP,
3:56.320–3:58.500
並斷開您不需要的伺服器。
3:58.900–4:01.480
更好的是,如果您能找到相關的 CLI,
4:01.580–4:02.403
例如,
4:02.403–4:06.200
與其使用消耗大量 token 的 Google Workspace 或 Google Calendar MCP 伺服器,
4:06.200–4:09.356
不如直接使用 Google Workspace CLI。
4:09.356–4:10.780
它更快、更便宜,
4:11.300–4:16.480
而且我認為未來趨勢是讓我們的代理程式使用 CLI 而非 MCP。
4:17.120–4:20.035
好的,第三點,將提示批量合併為一則訊息。
4:20.035–4:22.160
三則單獨的訊息成本是
4:22.160–4:24.268
一則合併訊息的三倍,因為
4:24.268–4:27.120
token 的工作方式如此,對吧?與其將「總結」
4:27.120–4:30.142
作為一則訊息,然後再「提取問題」,
4:30.142–4:32.180
接著「建議修復方案」,請將所有內容
4:32.180–4:34.464
在一則提示中發送。如果出錯了,
4:34.464–4:37.100
請編輯您的原始訊息並重新生成,而不是
4:37.100–4:39.057
發送完整的後續修正訊息。
4:39.057–4:42.360
後續訊息會永久堆疊在歷史記錄中,而編輯則會完全替換
4:42.360–4:43.758
錯誤的交換內容。
4:43.758–4:47.100
現在我要說,這裡有一個論點認為,潛在地
4:47.100–4:49.874
以這種方式執行,即先執行任務一,
4:49.874–4:52.940
任務二,然後任務三,實際上可能會產生更好的
4:52.940–4:55.553
輸出品質。我認為這取決於實際的使用案例。
4:55.553–4:57.240
基本上,想法是如果您能
4:57.240–4:58.815
一次只給 AI 一個特定任務,
4:58.815–5:01.640
它的表現會更好,因為它更專業且更
5:01.640–5:04.451
專注。但這絕對是你應該要注意的事。
5:04.451–5:05.120
好的,第四點
5:05.120–5:07.457
是在進行任何實際任務前,使用 plan 模式。
5:07.457–5:10.360
這讓 Claude 能規劃方法、向你提出
5:10.360–5:11.318
正確的問題,並且
5:11.318–5:14.300
防止最大的 token 浪費來源,也就是
5:14.300–5:16.455
讓 Claude 走錯方向、寫程式碼,
5:16.455–5:18.460
然後基本上它剛才所做的
5:18.720–5:20.693
一切,你都得捨棄並重新來過。
5:20.693–5:23.060
這純粹是時間和 token 的巨大浪費。所以你可以
5:23.060–5:25.009
在 Claude.md 中加入類似這樣的內容。
5:25.009–5:27.500
在你對
5:27.500–5:30.158
要建構的內容有 95% 的信心之前,不要進行任何變更,請向我提出後續問題,直到
5:30.158–5:32.080
達到該信心水準。這是我
5:32.080–5:34.345
在我讓 Claude
5:34.345–5:36.440
協助我建構事物時,放入所有 Claude.md 中的內容。
5:36.740–5:39.636
第五點,我們執行 /context 和 /cost。
5:39.636–5:41.760
/context 會顯示你目前
5:41.760–5:44.492
哪些部分正在消耗 token。例如你的對話歷史、
5:44.492–5:46.260
MCP 的額外開銷、載入的檔案等
5:46.260–5:49.534
這類東西。而 /cost 則顯示你實際的 token 使用量和
5:49.534–5:51.940
目前這個工作階段的預估花費。
5:52.600–5:54.704
大多數人根本不知道他們的 token 用在哪裡,
5:54.704–5:56.340
而這兩個指令讓不可見
5:56.340–6:00.182
變得可見。因為如果你實際上不知道因為
6:00.182–6:01.360
MCP 而在流失 token,那你怎麼
6:01.360–6:03.762
能修復這個問題呢?所以當你執行 /context 時,
6:03.762–6:05.400
它看起來會像這樣。它會
6:05.400–6:08.762
基本上給你一張截圖,顯示你目前的 token 數量、
6:08.762–6:10.740
上限是多少,並根據不同類別進行
6:10.740–6:12.641
預估。而我這裡做的操作是在一個全新的
6:12.641–6:15.060
工作階段中執行,沒有任何聊天記錄。所以這告訴我,好吧,
6:15.060–6:18.118
在我甚至還沒跟 Claude 對話之前,我就已經因為系統提示、
6:18.118–6:21.400
系統工具、我的自訂代理、我的技能、
6:21.400–6:23.901
記憶檔案等原因,損失了 51,000
6:23.901–6:26.280
個 token。而這裡我實際上已經清除了所有 MCP。
6:26.340–6:29.344
所以裡面沒有任何東西,
6:29.344–6:31.020
所以裡面沒有任何東西,
6:31.020–6:32.489
但就像我說的,這些可能會
6:32.489–6:36.160
直接讓你的 token 用量瞬間爆表。好的,第六點是設定狀態列。
6:36.160–6:37.633
這與提高可見度息息相關。
6:37.633–6:40.640
不過你只能在終端機裡看到這個。
6:40.860–6:42.618
所以你必須在那裡進行設定。
6:42.618–6:43.640
它基本上讓你了解當前的狀況。所以
6:44.240–6:46.307
在這裡,你可以在我的終端機中看到,
6:46.307–6:47.960
我已經設定好了,這樣我就能知道正在使用的模型。
6:47.960–6:50.844
我可以看到一個視覺化的使用進度
6:50.844–6:52.600
條。然後
6:52.600–6:54.774
我可以看到我整個
6:54.774–6:56.730
一百萬上下文視窗的 5%。我可以看到一百萬中的五萬二千
6:56.730–7:00.860
個 token。為了澄清,這並不是我的會話,也就是我
7:00.860–7:03.270
五個小時的會話。
7:03.270–7:05.680
這基本上
7:05.680–7:06.948
只是表示我完成了 5%,或者是一百萬中的五萬二千。所以
7:06.948–7:08.137
你只需要在終端機的 Cloud Code 中,
7:08.137–7:12.020
輸入 /status line 並說明你想要
7:12.020–7:14.308
複製這個設定。第七點非常簡單,
7:14.308–7:16.540
但請保持儀表板開啟。這同樣是為了
7:16.540–7:19.420
可見度。你可能會遇到限制問題,
7:19.420–7:21.460
然後突然被中斷。但是
7:21.460–7:24.927
如果你把它放在旁邊,或者準備好以便
7:24.927–7:26.660
切換到該標籤頁,
7:26.660–7:28.633
每 20 或 40 分鐘檢查一次,
7:28.633–7:29.920
你就能更好地控制自己的使用節奏。
7:29.920–7:31.505
你甚至可以設定自動化,基本上每 30 分鐘檢查一次,並發送
7:31.505–7:34.440
簡訊或 Slack 訊息給你,說:嘿,順便提一下,
7:34.840–7:39.420
你快要達到使用上限了。
7:39.420–7:42.716
好的,所以第八點,我們要有智慧地進行貼上。
7:42.716–7:44.940
在你貼上文件、檔案或
7:45.480–7:48.263
大型內容之前,先問問自己,
7:48.263–7:50.060
Claude 是否需要讀取整個內容?
7:50.060–7:51.986
有時確實需要,有時它需要完整的上下文,
7:51.986–7:54.160
但有時它只需要
7:54.420–7:56.651
其中一個部分或一頁。
7:56.651–7:57.720
所以如果錯誤...
7:57.720–7:58.980
所以如果錯誤發生在某個函數中,
7:59.300–8:00.000
所以如果這個錯誤……
8:00.000–8:00.980
所以如果這個錯誤出現在某個函式中,
8:01.100–8:02.280
就只貼上該函式。
8:02.420–8:04.380
或者如果只需要一個小段落的上下文,
8:04.580–8:05.240
就只貼上那段內容。
8:05.600–8:07.180
Claude 需要精確知道它讀取什麼,
8:07.180–8:09.580
但你也需要精確知道要提供給它什麼。
8:09.940–8:11.420
第九點,也是我們第一個層級的最後一個技巧
8:11.420–8:14.140
是實際觀看 Claude 編碼的過程。
8:14.140–8:16.460
不要只是發出提示就離開或切換分頁。
8:16.880–8:19.380
觀看 Claude 在做什麼,特別是在較長的任务中。
8:19.780–8:21.720
這是因為如果你實際坐下來觀看它,
8:21.920–8:24.000
有時你會發現它正走向錯誤的方向。
8:24.260–8:25.760
有時它會陷入自己的循環,
8:26.260–8:27.900
重複讀取相同的檔案,諸如此類。
8:28.200–8:29.680
所以如果它正在這樣做,
8:30.080–8:31.800
你不如就在此時停止它。
8:32.060–8:33.300
這與計劃模式的概念相似。
8:33.380–8:35.020
為什麼要讓它走向錯誤的方向,
8:35.120–8:37.140
浪費所有權杖,然後不得不全部捨棄?
8:37.440–8:40.180
在惡性循環中,80% 的權杖被使用,
8:40.580–8:42.480
卻產生零價值。
8:42.480–8:44.724
所以如果你能夠觀看你的會話運行,直到
8:44.724–8:46.969
你知道它正走向正確的方向,這可以節省
8:46.969–8:48.040
你數千個權杖。
8:48.520–8:49.904
好了,讓我們稍微提升一下。
8:49.904–8:51.120
讓我們進入第二個層級的技巧。
8:51.460–8:53.420
對於這些技巧,我們有五個。
8:53.780–8:56.740
所以第一點是保持你的 Claude.md 檔案精簡。
8:57.260–8:58.816
將其放在專案根目錄,
8:58.816–9:01.180
無論是全域還是本地專案。
9:01.740–9:05.420
Claude 會在每次對話開始時自動讀取它作為系統上下文。
9:05.620–9:07.180
所以請保持它在 200 行以下。
9:07.180–9:09.733
包含你的技術堆疊、編碼規範,
9:09.733–9:10.600
你的建構指令,
9:10.880–9:13.820
95% 信心規則,僅包含最重要的事項。
9:13.820–9:15.780
你需要將此視為一個索引
9:15.780–9:17.665
指向更多資料所在的路由。並且
9:17.665–9:20.460
這是一種完整的心態轉變。這個檔案基本上
9:20.460–9:23.149
只是告訴 Claude Code,它需要的一切在哪裡,以及
9:23.149–9:24.440
每次該做什麼。
9:24.440–9:26.140
所以它可以指向巨大的檔案,但
9:26.140–9:28.240
這樣做的好處是,它只會說:「好吧,我現在不需要這個,」
9:28.240–9:30.668
「但如果我之後需要,我也清楚知道該去哪裡找。」
9:30.668–9:32.340
而且因為它清楚知道該去哪裡
9:32.340–9:34.841
查找,它就不會浪費時間或 token 去搜尋和
9:34.841–9:35.660
閱讀其他檔案。
9:35.660–9:37.780
它只需透過檔案名稱就能直接取得該檔案。
9:38.120–9:39.440
我之所以說這是一種思維模式的轉變,
9:39.440–9:41.240
是因為你應該對其他事物也採取這種做法,
9:41.300–9:43.220
而不僅限於你的 Cloud.md,
9:43.220–9:46.260
或是你的技能說明或主要參考指南。
9:46.580–9:48.720
我看到有人提到,他們建立了一個
9:48.720–9:49.720
非常精簡的索引,
9:50.020–9:52.080
它能明確指出 Cloud Code 在
9:52.080–9:53.560
Cloud Code 文件中該前往何處。
9:53.880–9:56.500
因此,如果它需要有關 Cloud Code 的協助,
9:56.560–9:58.440
它就不必搜尋整個資料庫。
9:58.440–10:00.280
它只需說:「好吧,這裡是我的索引檔案。」
10:00.380–10:02.120
我清楚知道該查詢哪個 URL。
10:02.300–10:02.860
非常簡單。
10:03.240–10:05.040
你要保持精簡,並隨時進行修剪。
10:05.040–10:07.617
這始終是一個持續進行的過程,因為每一次對話,
10:07.617–10:09.120
不僅僅是整個工作階段,而是每一次
10:09.120–10:12.412
訊息,cloud.md 都會被讀取。所以如果你的 cloud.
10:12.412–10:14.900
md 檔案有一千行,每次你發送
10:14.900–10:17.068
訊息時,即使你只是說「嗨」,
10:17.068–10:18.580
整個檔案都會被讀取。
10:18.920–10:21.768
好的,第二點是要精確地引用檔案。
10:21.768–10:23.220
不要只是說:
10:23.340–10:25.200
「這裡是我的整個程式碼庫,去找出錯誤。」
10:25.200–10:27.540
應該說得更具體些,例如:「檢查 auth.js 檔案內的 verify user
10:27.540–10:31.090
函式。」或者你也可以
10:31.090–10:34.120
使用 @ 檔案名稱來指向特定檔案,
10:34.120–10:36.860
而不是再次讓 Claude 自由探索。
10:37.160–10:39.200
核心概念在於具體明確並進行路由指引。
10:39.580–10:40.260
好的,第三點,
10:40.360–10:43.420
我建議在容量達到約 60% 時進行壓縮。
10:43.920–10:45.760
自動壓縮會在約 95% 時觸發,
10:45.760–10:48.280
到那個時候,你的上下文資訊已經相當退化。
10:48.540–10:50.740
因此,請執行 /context 來檢查你的容量百分比,
10:50.860–10:52.460
或者你應該已經設定了狀態列。
10:52.740–10:55.380
大約在 60% 時,執行 /compact 指令
10:55.380–10:56.860
並附上具體指示
10:56.860–10:58.360
說明應該保留哪些內容。
10:58.740–11:00.280
連續進行三到四次 compact 後,
11:00.460–11:01.980
品質確實會開始下降。
11:02.080–11:04.100
因此在那個時候,當你已經完成了三或四次 compact 後,
11:04.120–11:06.517
只需執行 session summary / clear,
11:06.517–11:09.640
取得 session summary 後,繼續進行。
11:10.100–11:13.341
好的,第四點,短暫休息實際上會讓你付出代價。
11:13.341–11:14.460
Cloud Code 使用提示
11:14.460–11:17.462
訓練來避免重新處理未變更的上下文,
11:17.462–11:20.260
但快取有五分鐘的逾時設定。所以如果你
11:20.260–11:23.071
離開然後回來,且超過五分鐘,
11:23.071–11:24.400
你的下一則訊息會重新處理
11:24.400–11:26.399
一切,並產生完整費用。而且
11:26.399–11:28.740
這就是為什麼有些人覺得他們的用量會
11:28.740–11:30.720
隨機飆升,如果他們可能,你知道,
11:30.720–11:32.700
離開然後回來。所以如果你打算
11:32.700–11:37.120
那樣做,請考慮在離開前執行 /compact 或 /clear。好的,
11:37.140–11:39.524
第五點,指令輸出膨脹。當
11:39.524–11:42.820
Claude 執行 shell 指令時,完整輸出會進入你的
11:42.820–11:47.362
上下文視窗。所以如果你有一個指令回傳了 200 個提交,或,
11:47.362–11:48.480
你知道,只是大量的
11:48.480–11:53.120
數據,那麼所有這些都會變成發送給模型的 token。
11:53.120–11:54.640
所以這裡真正要帶走的重點
11:54.640–11:57.194
是要有意識地讓 Claude 執行什麼。
11:57.194–11:58.860
如果你知道在特定專案中
11:58.860–12:00.660
不需要使用某些指令,
12:00.660–12:02.740
那麼你可以在該專案中
12:02.740–12:04.800
拒絕那些權限。
12:04.800–12:06.880
這又是另一個看似隱形的問題,
12:06.880–12:10.040
因為當它執行 bash 或某些指令時,
12:10.040–12:11.940
它基本上只有一行
12:11.940–12:13.600
你實際上看不到它發送的所有 token。
12:13.600–12:16.040
好的,所以坐在这里編輯這部影片
12:16.040–12:18.080
還有一件事
12:18.080–12:19.060
我想說出來
12:19.060–12:21.020
基本上關於達到你的限制。
12:21.020–12:23.720
這部影片的目標和你的目標應該是
12:23.720–12:26.100
這段影片的目標以及你的目標應該是
12:26.100–12:28.640
進行優化,以避免觸發你的限制,
12:28.640–12:31.529
但我不認為你應該將觸及限制與
12:31.529–12:33.140
負面含義聯繫起來。
12:33.520–12:37.036
因為最終,如果你做了很多這些技巧
12:37.036–12:39.920
並且你不僅僅是浪費 token,
12:40.340–12:42.880
那麼從某種角度來看,觸及限制其實是一件好事。
12:42.880–12:45.860
因為這意味著你如此頻繁地使用這個工具。
12:45.900–12:47.080
我認為這就是你想要達到的狀態。
12:47.140–12:51.474
我認為你應該成為這個工具的進階用戶,直到出現
12:51.474–12:52.540
又要等待的情況。
12:52.540–12:53.980
而且,你知道,等待很糟糕。
12:53.980–12:56.940
但那些如此頻繁使用它的人
12:56.940–12:59.000
會變得更加高效
12:59.000–13:00.300
並且遠遠領先於
13:00.300–13:02.660
那些從未觸及限制的人,
13:02.860–13:05.280
沒有物超所值
13:05.280–13:09.000
也沒有真正獲得
13:09.000–13:09.800
你現在所獲得的優勢。
13:09.920–13:12.520
所以,總之,這裡有一段快速而真實的抱怨,
13:12.640–13:14.900
但我認為這是一個重要的心態轉變,
13:14.960–13:16.480
只是值得思考的事情。
13:17.000–13:18.940
好的,現在我們進入第三層。
13:19.060–13:20.960
我希望你們覺得已經有很多
13:20.960–13:21.620
想要實施的事情
13:21.620–13:24.520
而且這些技巧也變得越來越瘋狂。
13:24.660–13:25.720
所以這裡有四個這樣的技巧
13:25.720–13:27.060
我還有一些額外的技巧,
13:27.360–13:28.940
但第一點是選擇正確的模型。
13:29.320–13:31.500
所以,對於默認的大多數編碼工作使用 Sonnet,
13:31.960–13:34.420
對於子代理、格式化和簡單任務使用 Haiku,
13:34.760–13:36.260
對於深度架構規劃使用 Opus
13:36.260–13:37.940
並且只有在 Sonnet 不夠用的時候,
13:38.240–13:39.860
嘗試將這部分的使用量保持在 20% 以下
13:39.860–13:42.460
除非你確實非常需要它來完成那個項目。
13:42.720–13:44.920
現在,這裡有一個小技巧,當你有一個巨大的代碼庫
13:44.920–13:46.780
並且你想做一些特定的事情,比如審查,
13:47.280–13:48.920
那麼嘗試引入 Codex。
13:49.240–13:50.420
現在有一個官方插件
13:50.420–13:51.480
我為此做了一個視頻。
13:51.480–13:53.552
我會在這裡標註出來。但你基本上可以擁有,
13:53.552–13:54.760
你知道的,讓 Opus 和 Sonnet 一起運作
13:54.760–13:57.390
共同為你建構專案或程式碼庫。
13:57.390–13:59.180
然後你可以引入 codecs
13:59.180–14:01.132
來實際審查所有內容。並且
14:01.132–14:04.060
這樣做可以幫你節省 Claude 的 token 用量。
14:04.480–14:07.272
接下來,這裡的第二點是子代理人的成本。
14:07.272–14:09.320
代理人工作流程使用的 token 數量大約是標準單一代理人工作階段的七到十倍。
14:09.320–14:12.188
現在,為什麼會這樣?因為它們啟動時
14:12.188–14:14.080
會擁有自己完整的上下文,並且是一個獨立的實例。
14:14.080–14:17.203
所以它們基本上必須在
14:17.203–14:18.960
你啟動新工作階段時重新載入
14:18.960–14:21.137
所有內容。
14:21.137–14:23.200
所有那些檔案、所有系統工具,
14:23.320–14:25.599
像是這類的一切。現在你可以做的是,
14:25.599–14:27.220
這很有幫助,就是委派給子
14:27.220–14:28.497
代理人處理一次性任務,
14:28.497–14:29.715
特別是如果你希望那
14:29.715–14:31.920
個一次性任務使用 haiku。所以也許你需要
14:31.920–14:33.240
處理大量資訊,
14:33.240–14:35.880
或者也許你需要進行大量研究並只取得類似摘要
14:35.880–14:40.022
的回報。現在是的,token 終究還是 token,
14:40.022–14:41.040
但如果你能將
14:41.040–14:46.260
80% 的 token 用於較便宜的模型,而不是 80% 的 token 用於昂貴的模型,那麼你將
14:46.260–14:48.617
節省金錢。當然,
14:48.617–14:51.420
代理人團隊很酷。有時我確實真的
14:51.420–14:54.458
喜歡它們,它們能幫助我獲得更高品質的輸出,
14:54.458–14:56.420
但它們非常、非常昂貴。所以
14:56.420–14:59.351
請盡量謹慎使用。好的,所以
14:59.351–15:02.440
第三點是了解尖峰時段。所以我們
15:02.440–15:03.835
剛才在開始時談到,
15:03.835–15:06.160
他們如何根據尖峰時段的 Demand 調整你五小時工作階段視窗
15:06.160–15:09.390
的消耗速度,
15:09.390–15:12.620
尖峰時段是工作日的東部時間上午 8 點到下午 2 點,
15:12.620–15:14.160
但離峰時段是指
15:14.160–15:17.900
你的使用量屬於正常情況,或者持續時間稍長
15:17.900–15:20.092
的時段,這些是下午、晚上和週末,所以
15:20.092–15:22.340
如果你從策略角度思考這個問題,
15:22.340–15:26.980
也許你希望確保在離峰時段才執行大型重構或多代理人工作階段或大型
15:26.980–15:29.479
專案,否則
15:29.479–15:32.040
你會知道,你會迅速耗盡那個
15:32.040–15:35.681
高峰時段,此外,我們將這個小技巧稱為第 3.5 招。
15:35.681–15:37.180
這是我之前
15:37.180–15:40.130
暗示過的一點,我說嘿,保持你的 Claude 帳戶開啟,以便
15:40.130–15:41.320
隨時查看你的使用情況。如果你接近重置時間,
15:41.320–15:42.990
並且你的配額還有剩餘空間,那就放手大用。嘗試
15:42.990–15:46.020
在重置前達到使用上限。
15:46.020–15:47.858
物盡其用。讓你的代理人在那個
15:47.858–15:50.500
階段自由發揮。另一方面,如果你接近限制,
15:50.500–15:53.586
但還有大量時間,
15:53.586–15:55.100
那就退一步。
15:55.400–15:56.220
這是時候休息一下,散個步,
15:56.570–15:58.627
做點午餐,帶著滿額
15:58.627–16:00.350
預算回來,而不是為了小事情耗盡最後 5% 的額度,
16:00.350–16:03.464
導致任務中途卡住,並且
16:03.464–16:05.270
不得不讓你知曉,
16:05.270–16:06.439
失去你可能已經進入的心流狀態。
16:06.439–16:08.610
好的,第四點,你系統的憲法,
16:08.610–16:12.035
也就是 claw.md。這應該包含穩定
16:12.035–16:15.210
的決策、架構規則和進度摘要。
16:15.210–16:17.773
把它想像成讓每個提示詞越來越短的
16:17.773–16:19.290
事實來源。
16:19.290–16:21.561
儲存決策,而非對話。你在那裡儲存的每個架構
16:21.561–16:24.490
決策,都是你再也不需要輸入的一段文字。
16:24.490–16:27.677
所以這建立在
16:27.677–16:28.670
你在第一層級思考方式的基礎之上。
16:28.670–16:31.246
你可以在那裡添加規則,基本上
16:31.246–16:33.150
告訴它,嘿,我希望你幫助我確保我在智慧地使用 token。
16:33.150–16:36.919
對於任何
16:36.919–16:38.050
探索或研究,使用子代理。
16:38.050–16:39.398
如果任務需要三個以上檔案或多檔案分析,啟動子
16:39.398–16:42.830
代理,只回傳摘要後的洞察。
16:42.830–16:44.988
在 Haiku 中啟動該子代理。這裡有一個我放在 mycloud.md 底部的
16:44.988–16:47.730
小提示詞。並且
16:47.730–16:49.890
在我讀出這段話之前,我要說,你必須
16:49.890–16:52.170
小心,因為當
16:52.170–16:53.452
你建立像
16:53.452–16:54.592
這種自我學習或自我進化的檔案時,你必須
16:54.592–16:57.870
經常檢查它,因為
16:57.870–16:59.304
你不想讓它意外變得過於臃腫。但這裡我說
16:59.304–17:02.070
已應用的學習。
17:02.070–17:04.435
應用式學習。當某件事反覆失敗時,
17:04.435–17:06.590
當 Nate 必須重新解釋,或為平台工具或限制找到替代方案時,
17:06.590–17:08.957
在此新增一行項目符號。將每個項目符號保持在 15
17:08.957–17:11.850
字以內,不加解釋,
17:11.850–17:12.892
只新增那些能
17:12.892–17:13.835
節省未來工作時間的內容。接著它會有一些項目符號。現在,我不是說這是最佳提示,
17:13.835–17:15.870
但我認為這種讓 Cloud.MD 實際學習並
17:15.870–17:19.398
持續思考如何節省您時間與 token 的系統
17:19.398–17:21.130
是個值得嘗試的好主意。好吧。所以
17:21.130–17:23.308
我知道我們剛才討論了很多內容。
17:23.308–17:26.510
這份簡報將免費提供下載,地點在我的 FreeSchool 社群。
17:26.510–17:28.509
相關連結會在描述中提供。
17:28.509–17:30.810
但現在,你應該去做的這些
17:31.010–17:35.470
事情。執行 /context,看看它的樣子。
17:35.470–17:37.352
前往一些活躍的工作階段,執行 /
17:37.352–17:39.050
cost。狀態列,確保它顯示你的模型、
17:39.050–17:41.820
你的上下文百分比以及 token
17:41.820–17:44.150
數量。確保你開啟雲端使用儀表板,以便
17:44.150–17:46.417
查看剩餘配額
17:46.417–17:48.130
以及重置時間。斷開未使用的 MCP 伺服器。
17:48.130–17:50.794
在 plan 模式下啟動複雜任務。使用
17:50.794–17:52.570
/clear 當你切換到不相關的任務時。
17:52.570–17:56.547
在上下文達到 60% 時手動壓縮。將你的
17:56.547–17:59.170
多步驟指令合併為單一訊息,並
17:59.170–18:02.650
將繁重的工作排定在離峰時段,
18:02.650–18:05.390
實際上就是要留意真正的時機。所以
18:05.390–18:07.846
我想留給你們一、
18:07.846–18:10.130
或許兩條訊息。
18:10.130–18:12.541
第一件事是
18:12.541–18:14.550
關於品質與成本之間存在平衡的概念。
18:14.710–18:15.887
這是一種你需要稍微遊玩的遊戲。
18:15.887–18:16.925
有時你確實
18:16.925–18:19.970
需要追求更高品質,
18:19.970–18:22.893
這最終會花費你更多金錢。這只是
18:22.893–18:23.750
運作方式。但另一件事是保持簡單,
18:23.750–18:24.897
並思考我們在
18:24.897–18:27.110
這段影片開頭討論的,
18:27.110–18:30.120
它運作的方式。但另一件事就是保持簡單,並
18:30.120–18:31.370
思考我們在這段影片
18:31.370–18:33.031
一開始所討論的內容,
18:33.031–18:35.710
令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令
18:35.710–18:37.438
你。大多數人不需要更大的計畫。
18:37.438–18:39.710
他們需要停止重複發送整個對話
18:39.710–18:42.067
歷史記錄30次,而你只需發送
18:42.067–18:44.870
你知道的,五次。這不是限制問題。而是
18:44.870–18:46.631
上下文衛生問題。不過,
18:46.631–18:48.910
這集就到這裡。如果你們喜歡
18:48.910–18:50.780
或學到了新東西,請按讚。
18:50.780–18:52.650
這對我幫助很大。一如既往,我感謝
18:52.650–18:54.312
感謝你們看到影片的最後。
18:54.312–18:56.170
我們下一個影片見。謝謝大家。
0:00.000–0:00.960
In the past week or so, so
過去一週左右,
0:00.960–0:03.840
many people have been complaining about hitting their cloud code limit
許多人抱怨他們的雲端代碼用量限制
0:03.840–0:08.540
insanely fast. Claims like one prompt that is about 1% of the limit is now around 10%.
被超快地觸發。有人表示,原本只佔限制約1%的單一提示,現在卻佔到了10%左右。
0:08.540–0:10.364
You could go through X and find tons and
你可以在X上搜尋,找到大量
0:10.364–0:11.960
tons of threads about this topic.
關於這個主題的討論串。
0:12.300–0:13.883
Even on a $200 per month plan,
即使是每月200美元的方案,
0:13.883–0:16.720
people are reaching the session limit way too fast.
人們也過快達到了會話限制。
0:17.120–0:20.360
And then we got this post from an Anthropic employee that basically said that they
接著,我們看到Anthropic員工的一篇貼文,基本上表示他們
0:20.360–0:23.184
are working on a little change with peak hours and
正在針對尖峰時段和
0:23.184–0:25.320
off-peak hours. But even after that,
離峰時段進行一些調整。但即使如此,
0:25.400–0:27.671
some people were saying they were still hitting it really quick,
仍有人表示他們依然很快觸發限制,
0:27.671–0:28.680
even during off-peak hours.
即使在離峰時段也是如此。
0:28.680–0:30.703
So anyways, I've been playing around a ton,
總之,我最近花了很多時間
0:30.703–0:32.838
trying different things, doing research, an
嘗試各種方法、進行研究,
0:32.838–0:34.749
d I have 18 token management hacks for you
我為你們整理了18個Token管理技巧
0:34.749–0:36.716
guys that I've organized from tier 1 all th
我將這些技巧從第1級到
0:36.716–0:39.020
e way up to tier 3 so they get more advanced as we go.
第3級進行分級,以便隨著講解逐漸深入。
0:39.300–0:41.528
I'm very confident that by the end of this video,
我非常有信心,看完這段影片後,
0:41.528–0:43.756
you will feel like your Claude code usage has dou
你會覺得你的Claude代碼用量已經
0:43.756–0:45.260
bled, tripled, maybe even 5x'd.
翻倍、三倍,甚至可能達到5倍。
0:45.500–0:47.820
So let's not waste any time and just get straight into the video.
所以我們別浪費時間,直接進入影片內容。
0:48.080–0:50.814
So as I've been optimizing my own token management,
在我優化自己的Token管理過程中,
0:50.814–0:53.547
I think that what's really important to realize fir
我認為首先要了解的重點
0:53.547–0:55.200
st is how tokens actually work.
是Token的運作方式。
0:55.200–0:57.681
Because once you realize how Claude uses tokens,
因為一旦你了解Claude如何使用Token,
0:57.681–0:59.980
it makes it very clear how you should actually
你就會很清楚該如何
0:59.980–1:03.300
reverse engineer the way that you work in order to use less tokens.
反向工程你的工作方式,以減少Token的使用。
1:03.720–1:07.076
So a token is the smallest unit of text that an AI model reads and
Token是AI模型讀取並
1:07.076–1:07.980
charges you for.
向你收費的最小文字單位。
1:08.260–1:11.460
It's roughly one token is one word, but that's not explicitly true.
大約一個Token等於一個單詞,但這並非絕對準確。
1:11.640–1:12.600
Kind of just a good baseline.
這只是一個大致的基準。
1:12.600–1:14.256
So every time that you send a message,
因此,每次你發送訊息時,
1:14.256–1:16.980
Claude rereads the entire conversation from the beginning,
Claude都會從頭開始重新閱讀整個對話,
1:17.380–1:19.540
and all of those are tokens that it's charging you for.
而這些都會被計入向你收費的Token。
1:19.960–1:22.534
So message one, it will read it, then it will read its reply,
所以第一則訊息,它會讀取,然後讀取它的回覆,
1:22.534–1:23.480
and then message two,
接著是第二則訊息,
1:23.480–1:26.360
and then the reply all the way up to your latest prompt.
然後是回覆,一直到你的最新提示。
1:26.640–1:27.940
And it does that every single time.
而且它每次都會這樣做。
1:28.220–1:30.300
And I think that alone is a huge light bulb moment
我認為這本身就是一個讓很多人恍然大悟的關鍵時刻
1:30.300–1:31.240
for a lot of people.
對許多人來說。
1:31.580–1:33.740
This means as you're having a conversation with Claude,
這意味著當你與 Claude 進行對話時,
1:34.100–1:36.300
your cost is compounding, not just adding,
你的成本是複利累積,而不只是單純相加,
1:36.660–1:37.840
it's exponentially growing.
它是呈指數級增長。
1:38.300–1:40.460
Meaning message one might cost 500 tokens,
這意味著第一則訊息可能花費 500 個 token,
1:40.840–1:42.560
message 30 costs 15,000
第 30 則訊息則花費 15,000 個
1:42.560–1:44.540
because it's rereading everything before it.
因為它會重新閱讀之前的所有內容。
1:45.040–1:47.800
One developer actually tracked a 100 plus message chat
有一位開發者實際上追蹤了一個超過 100 則訊息的聊天,
1:47.800–1:50.820
and found that 98.5% of all the tokens
發現所有 token 中有 98.5%
1:50.820–1:54.160
were just spent rereading the old chat history in the session.
只是花在重新閱讀會話中的舊聊天記錄。
1:54.300–1:55.280
Like that's a huge waste.
就像這樣,這是一大筆浪費。
1:55.700–1:57.420
Now, yes, the argument has to be made that,
現在,是的,必須提出這樣的論點,
1:57.680–1:58.688
well, it needs the context and
好吧,它需要上下文,
1:58.688–2:00.060
it needs to understand what we're doing,
並且它需要理解我們在做什么,
2:00.200–2:02.480
but still 98.5% is crazy.
但即便如此,98.5% 仍然很誇張。
2:02.820–2:04.400
So take a quick look at this graphic here.
所以讓我們快速看一下這裡的圖表。
2:04.680–2:06.480
Along the x-axis, we have message number.
在 x 軸上,我們有訊息編號。
2:06.880–2:10.040
And as it increases, you can see that we have our per message cost
隨著編號增加,你可以看到每則訊息的成本
2:10.040–2:13.060
and our cumulative tokens increasing, but it's not linear.
以及我們的累計 token 都在增加,但這不是線性的。
2:13.300–2:16.560
It's basically each message is rereading all of the past ones
基本上,每則訊息都會重新閱讀所有過去的訊息
2:16.560–2:17.640
and it has to count that in.
並且必須將這些計算在內。
2:17.640–2:19.120
So message one could be 500,
所以第一則訊息可能是 500,
2:19.120–2:22.020
message 30 could be 15,500, which is 31 times more.
第 30 則訊息可能是 15,500,這多了 31 倍。
2:22.020–2:24.920
And then after 30 messages, you might already be at
然後在 30 則訊息之後,你可能已經達到
2:24.920–2:27.440
almost a quarter million cumulative tokens. Now,
近 25 萬的累計 token。現在,
2:27.440–2:29.720
on top of all of your own messages, Claude will
除了你自己的訊息之外,Claude 還會
2:29.720–2:32.020
also reload your Claude.md, your MCP servers,
重新載入你的 Claude.md、你的 MCP 伺服器、
2:32.020–2:34.320
your system prompts, your skills, your files,
你的系統提示、你的技能、你的檔案,
2:34.440–2:37.298
on every single turn. And this is invisible overhead,
在每一次對話輪次中。這是隱形的開銷,
2:37.298–2:39.140
but it is constantly dripping into
但它不斷地滲透進
2:39.140–2:40.489
your context and your tokens. And
你的上下文和 token。而且
2:40.489–2:42.560
a really important thing to realize is that bloated
一個非常重要的認知是,膨脹的
2:42.560–2:44.932
context doesn't just cost you more money, but it also
上下文不僅會讓你花費更多金錢,還會
2:44.932–2:46.980
produces worse output. So you're paying more
產生更差的輸出。所以你花得更多
2:46.980–2:50.149
and you're getting less. There's this phenomenon called lost in the middle,
卻得到更少。有一個稱為「迷失在中間」的現象,
2:50.149–2:51.040
which basically says
這基本上表示
2:51.040–2:54.550
that models are paying the most intention in the beginning of your session and
模型在會話的開始和
2:54.550–2:55.360
kind of at the end.
結尾處會投入最多的注意力。
2:55.460–2:57.684
So all that stuff in the middle of your session,
所以會話中間的所有內容,
2:57.684–3:00.080
kind of in this dip, is getting ignored. All right,
也就是這個低谷部分,會被忽略。好的,
3:00.120–3:03.320
so now that we kind of understand a little bit more about how Cloud Code works and how tokens
所以現在我們對 Claude Code 如何運作以及 token
3:03.320–3:04.919
work, let's move into the hacks.
工作,讓我們進入技巧部分。
3:04.919–3:07.820
We're going to start here with tier one hacks. These are the
我們將從第一層技巧開始。這些是
3:07.820–3:09.517
ones that are going to be super easy to implement and
非常容易實作且
3:09.517–3:10.820
everyone should be able to understand.
每個人都能理解的技巧。
3:11.280–3:12.640
So we've got nine of these.
總共有九個。
3:13.000–3:14.940
Number one is to start fresh conversations.
第一點是開始全新的對話。
3:15.580–3:18.120
Use slash clear between unrelated tasks.
在不相關的任務之間使用 /clear 指令。
3:18.540–3:21.800
Don't carry context about topic A into a conversation about topic B.
不要將關於主題 A 的上下文帶入關於主題 B 的對話中。
3:22.440–3:27.340
So every single message in a long chat is exponentially more expensive than the same message in a fresh chat.
因此,長對話中的每一則訊息,其成本都比全新對話中的相同訊息呈指數級增加。
3:27.340–3:31.640
So this one habit is the number one thing that extends your session life.
所以這個習慣是延長對話會話生命周期的最重要因素。
3:31.780–3:34.140
And it's pretty obvious based on what we just talked about.
基於我們剛才討論的內容,這相當明顯。
3:34.420–3:35.580
So that's why this was number one.
這就是為什麼它排在第一位。
3:36.220–3:39.440
Okay, number two is to disconnect MCP servers.
好的,第二點是斷開 MCP 伺服器連線。
3:39.440–3:44.580
Every single connected MCP server loads all of its tool definitions into your context on every message.
每個已連線的 MCP 伺服器都會在每則訊息時,將其所有工具定義載入到您的上下文中。
3:45.000–3:49.680
This is another source of completely invisible tokens that might just be eating up and eating away.
這是另一個完全隱形的 token 來源,可能會不斷消耗您的資源。
3:50.020–3:53.820
So one server alone might be something like 18,000 tokens per message.
僅一個伺服器,每則訊息可能就高達 18,000 個 token。
3:54.140–3:56.320
So run MCP at the start of each session and
因此,在每個會話開始時執行 MCP,
3:56.320–3:58.500
disconnect the ones that you don't need.
並斷開您不需要的伺服器。
3:58.900–4:01.480
And better yet, if you're able to find CLIs for something,
更好的是,如果您能找到相關的 CLI,
4:01.580–4:02.403
so for example,
例如,
4:02.403–4:06.200
rather than having the Google Workspace or Google Calendar MCP server,
與其使用消耗大量 token 的 Google Workspace 或 Google Calendar MCP 伺服器,
4:06.200–4:09.356
which eats a lot of tokens, just use the Google Workspace CLI.
不如直接使用 Google Workspace CLI。
4:09.356–4:10.780
It's faster, it's cheaper,
它更快、更便宜,
4:11.300–4:16.480
and I think the future is moving towards having our agents use CLIs rather than MCPs.
而且我認為未來趨勢是讓我們的代理程式使用 CLI 而非 MCP。
4:17.120–4:20.035
All right, number three, batch prompts into one message.
好的,第三點,將提示批量合併為一則訊息。
4:20.035–4:22.160
Three separate messages cost three times
三則單獨的訊息成本是
4:22.160–4:24.268
what one combined message costs because
一則合併訊息的三倍,因為
4:24.268–4:27.120
of the way the tokens work, right? Instead of summarize
token 的工作方式如此,對吧?與其將「總結」
4:27.120–4:30.142
this as one message and then now extract the issues,
作為一則訊息,然後再「提取問題」,
4:30.142–4:32.180
now suggest a fix, send it all in one
接著「建議修復方案」,請將所有內容
4:32.180–4:34.464
prompt. If clogged something slightly wrong,
在一則提示中發送。如果出錯了,
4:34.464–4:37.100
edit your original message and regenerate instead of
請編輯您的原始訊息並重新生成,而不是
4:37.100–4:39.057
sending a full follow-up correction.
發送完整的後續修正訊息。
4:39.057–4:42.360
Follow-ups stack onto history permanently while edits replace
後續訊息會永久堆疊在歷史記錄中,而編輯則會完全替換
4:42.360–4:43.758
the bad exchange entirely.
錯誤的交換內容。
4:43.758–4:47.100
Now I will say there is an argument to be made here that potentially
現在我要說,這裡有一個論點認為,潛在地
4:47.100–4:49.874
doing it this way where you're doing task one,
以這種方式執行,即先執行任務一,
4:49.874–4:52.940
task two, then task three might actually be better
任務二,然後任務三,實際上可能會產生更好的
4:52.940–4:55.553
output quality. I think it depends on the actual use case.
輸出品質。我認為這取決於實際的使用案例。
4:55.553–4:57.240
Basically the idea would be if you can
基本上,想法是如果您能
4:57.240–4:58.815
give AI one specific task at a time,
一次只給 AI 一個特定任務,
4:58.815–5:01.640
it's going to do better because it's more specialized and it's
它的表現會更好,因為它更專業且更
5:01.640–5:04.451
more focused. But this is definitely something that you should be aware of.
專注。但這絕對是你應該要注意的事。
5:04.451–5:05.120
Okay, number four
好的,第四點
5:05.120–5:07.457
is to use plan mode before any real task.
是在進行任何實際任務前,使用 plan 模式。
5:07.457–5:10.360
This lets Claude map out the approach, ask you the
這讓 Claude 能規劃方法、向你提出
5:10.360–5:11.318
right questions, and
正確的問題,並且
5:11.318–5:14.300
it prevents the single biggest source of token waste, which is just
防止最大的 token 浪費來源,也就是
5:14.300–5:16.455
having Claude go down the wrong path, writing code,
讓 Claude 走錯方向、寫程式碼,
5:16.455–5:18.460
and then basically everything that it just did,
然後基本上它剛才所做的
5:18.720–5:20.693
you have to basically like scrap and redo.
一切,你都得捨棄並重新來過。
5:20.693–5:23.060
It's just a huge waste of time and tokens. So you can
這純粹是時間和 token 的巨大浪費。所以你可以
5:23.060–5:25.009
add something like this to your Claude.md.
在 Claude.md 中加入類似這樣的內容。
5:25.009–5:27.500
Do not make any changes until you have 95% confidence in
在你對
5:27.500–5:30.158
what you need to build, ask me follow-up questions until
要建構的內容有 95% 的信心之前,不要進行任何變更,請向我提出後續問題,直到
5:30.158–5:32.080
you reach that confidence level. This is
達到該信心水準。這是我
5:32.080–5:34.345
something that I'm putting into all of my Cloud.
在我讓 Claude
5:34.345–5:36.440
nmds when I am having it help me build things.
協助我建構事物時,放入所有 Claude.md 中的內容。
5:36.740–5:39.636
Number five, we have run slash context and slash cost.
第五點,我們執行 /context 和 /cost。
5:39.636–5:41.760
Slash context shows you exactly what's
/context 會顯示你目前
5:41.760–5:44.492
eating your tokens right now. So your conversation history,
哪些部分正在消耗 token。例如你的對話歷史、
5:44.492–5:46.260
your MCP overhead, loaded files, stuff
MCP 的額外開銷、載入的檔案等
5:46.260–5:49.534
like that. And slash cost shows your actual token usage and
這類東西。而 /cost 則顯示你實際的 token 使用量和
5:49.534–5:51.940
estimated spend for that current session.
目前這個工作階段的預估花費。
5:52.600–5:54.704
Most people have no idea where their tokens are going,
大多數人根本不知道他們的 token 用在哪裡,
5:54.704–5:56.340
and these two commands make the invisible
而這兩個指令讓不可見
5:56.340–6:00.182
visible. Because if you don't actually know that you're bleeding because
變得可見。因為如果你實際上不知道因為
6:00.182–6:01.360
of MCPs, then how would
MCP 而在流失 token,那你怎麼
6:01.360–6:03.762
you be able to fix that? So when you run slash context,
能修復這個問題呢?所以當你執行 /context 時,
6:03.762–6:05.400
this is what it will look like. It'll
它看起來會像這樣。它會
6:05.400–6:08.762
basically give you a screenshot of how many tokens you're at,
基本上給你一張截圖,顯示你目前的 token 數量、
6:08.762–6:10.740
what is the cap, and it will estimate
上限是多少,並根據不同類別進行
6:10.740–6:12.641
based on the different categories. And
預估。而我這裡做的操作是在一個全新的
6:12.641–6:15.060
what I did here is this was ran in a completely fresh
工作階段中執行,沒有任何聊天記錄。所以這告訴我,好吧,
6:15.060–6:18.118
session, no chats. So what that tells me is, okay,
在我甚至還沒跟 Claude 對話之前,我就已經因為系統提示、
6:18.118–6:21.400
before I even talk to Claude, I'm already down 51,000
系統工具、我的自訂代理、我的技能、
6:21.400–6:23.901
tokens because of things like the system prompt,
記憶檔案等原因,損失了 51,000
6:23.901–6:26.280
the system tools, my custom agents, my skills,
個 token。而這裡我實際上已經清除了所有 MCP。
6:26.340–6:29.344
memory files. And here I've actually cleared out all the MCPs.
所以裡面沒有任何東西,
6:29.344–6:31.020
So there wasn't anything in there,
所以裡面沒有任何東西,
6:31.020–6:32.489
but those can, like I said,
但就像我說的,這些可能會
6:32.489–6:36.160
completely blow up your tokens right from the get go. Okay. Number
直接讓你的 token 用量瞬間爆表。好的,第六點是設定狀態列。
6:36.160–6:37.633
six is to set up a status line.
這與提高可見度息息相關。
6:37.633–6:40.640
This kind of goes hand in hand with having more visibility.
不過你只能在終端機裡看到這個。
6:40.860–6:42.618
You only actually see this in your terminal though.
所以你必須在那裡進行設定。
6:42.618–6:43.640
So you will have to do it there.
它基本上讓你了解當前的狀況。所以
6:44.240–6:46.307
And it basically lets you see what's going on. So
在這裡,你可以在我的終端機中看到,
6:46.307–6:47.960
right here, you can see in my terminal,
我已經設定好了,這樣我就能知道正在使用的模型。
6:47.960–6:50.844
I've got this set up so that I can see the model I'm using.
我可以看到一個視覺化的使用進度
6:50.844–6:52.600
I can see a visual kind of progress
條。然後
6:52.600–6:54.774
bar of my usage. And then
我可以看到我整個
6:54.774–6:56.730
I can see 5% of my whole
一百萬上下文視窗的 5%。我可以看到一百萬中的五萬二千
6:56.730–7:00.860
1 million context window. And I can see 52,000
個 token。為了澄清,這並不是我的會話,也就是我
7:00.860–7:03.270
tokens out of 1000,000, which is a million. And
五個小時的會話。
7:03.270–7:05.680
just to clarify, this isn't my session, like my
這基本上
7:05.680–7:06.948
five hour session.
只是表示我完成了 5%,或者是一百萬中的五萬二千。所以
7:06.948–7:08.137
This is basically
你只需要在終端機的 Cloud Code 中,
7:08.137–7:12.020
just indicating that I'm 5% of the way or 52k out of 1000k. So
輸入 /status line 並說明你想要
7:12.020–7:14.308
all you have to do is in cloud code in the terminal,
複製這個設定。第七點非常簡單,
7:14.308–7:16.540
do slash status line and explain that you want to
但請保持儀表板開啟。這同樣是為了
7:16.540–7:19.420
replicate this setup. Number seven is just super simple,
可見度。你可能會遇到限制問題,
7:19.420–7:21.460
but keep your dashboard open. Same thing
然後突然被中斷。但是
7:21.460–7:24.927
with visibility. You might run into issues with your limit and
如果你把它放在旁邊,或者準備好以便
7:24.927–7:26.660
just get hit out of nowhere. But
切換到該標籤頁,
7:26.660–7:28.633
if you have it pulled up next to you or you have it ready so
每 20 或 40 分鐘檢查一次,
7:28.633–7:29.920
that you can switch into that tab and
你就能更好地控制自己的使用節奏。
7:29.920–7:31.505
check every 20, 40 minutes, then
你甚至可以設定自動化,基本上每 30 分鐘檢查一次,並發送
7:31.505–7:34.440
you're going to be able to pace yourself a little bit better.
簡訊或 Slack 訊息給你,說:嘿,順便提一下,
7:34.840–7:39.420
You could even set up automation to basically check in on it every 30 minutes and send you
你快要達到使用上限了。
7:39.420–7:42.716
a text or a Slack message and say, hey, by the way,
好的,所以第八點,我們要有智慧地進行貼上。
7:42.716–7:44.940
you're getting near your usage.
在你貼上文件、檔案或
7:45.480–7:48.263
All right. So number eight, we have be smart with pasting.
大型內容之前,先問問自己,
7:48.263–7:50.060
Before you drop a document or a file or
Claude 是否需要讀取整個內容?
7:50.060–7:51.986
something large, just ask yourself,
有時確實需要,有時它需要完整的上下文,
7:51.986–7:54.160
does Claude need to read this whole thing?
但有時它只需要
7:54.420–7:56.651
Sometimes it does, sometimes it needs that full context,
其中一個部分或一頁。
7:56.651–7:57.720
but sometimes it just needs
所以如果錯誤...
7:57.720–7:58.980
one section or one page.
所以如果錯誤發生在某個函數中,
7:59.300–8:00.000
So if the bug...
所以如果這個錯誤……
8:00.000–8:00.980
So if the bug is in one function,
所以如果這個錯誤出現在某個函式中,
8:01.100–8:02.280
then paste just that function.
就只貼上該函式。
8:02.420–8:04.380
Or if it just needs the context of one little paragraph,
或者如果只需要一個小段落的上下文,
8:04.580–8:05.240
just paste that.
就只貼上那段內容。
8:05.600–8:07.180
Claude needs to be precise about what it reads,
Claude 需要精確知道它讀取什麼,
8:07.180–8:09.580
but you also need to be precise about what you feed it.
但你也需要精確知道要提供給它什麼。
8:09.940–8:11.420
And number nine, our last tier one hack
第九點,也是我們第一個層級的最後一個技巧
8:11.420–8:14.140
is to actually watch Claude code work.
是實際觀看 Claude 編碼的過程。
8:14.140–8:16.460
Don't just fire off a prompt and walk away or switch tabs.
不要只是發出提示就離開或切換分頁。
8:16.880–8:19.380
Watch what Claude is doing, especially on longer tasks.
觀看 Claude 在做什麼,特別是在較長的任务中。
8:19.780–8:21.720
And this is because if you actually sit and watch it,
這是因為如果你實際坐下來觀看它,
8:21.920–8:24.000
sometimes you'll realize it's going down the wrong path.
有時你會發現它正走向錯誤的方向。
8:24.260–8:25.760
Sometimes it gets stuck in its own loops,
有時它會陷入自己的循環,
8:26.260–8:27.900
rereads the same files, things like that.
重複讀取相同的檔案,諸如此類。
8:28.200–8:29.680
So if it's doing that,
所以如果它正在這樣做,
8:30.080–8:31.800
you might as well just stop it right there.
你不如就在此時停止它。
8:32.060–8:33.300
Kind of the same idea as plan mode.
這與計劃模式的概念相似。
8:33.380–8:35.020
Why would you let it go down the wrong path,
為什麼要讓它走向錯誤的方向,
8:35.120–8:37.140
waste all your tokens, and then just have to scrap it all?
浪費所有權杖,然後不得不全部捨棄?
8:37.440–8:40.180
In a bad loop, 80% of the tokens are being used,
在惡性循環中,80% 的權杖被使用,
8:40.580–8:42.480
producing zero value.
卻產生零價值。
8:42.480–8:44.724
So if you're able to just watch your session run until
所以如果你能夠觀看你的會話運行,直到
8:44.724–8:46.969
you know it's going down the right path, it could save
你知道它正走向正確的方向,這可以節省
8:46.969–8:48.040
you thousands of tokens.
你數千個權杖。
8:48.520–8:49.904
All right, let's kick it up a little bit.
好了,讓我們稍微提升一下。
8:49.904–8:51.120
Let's move into our tier two hacks.
讓我們進入第二個層級的技巧。
8:51.460–8:53.420
And for these ones, we have five of them.
對於這些技巧,我們有五個。
8:53.780–8:56.740
So number one is to keep your Claude.md file lean.
所以第一點是保持你的 Claude.md 檔案精簡。
8:57.260–8:58.816
Place it in your project root,
將其放在專案根目錄,
8:58.816–9:01.180
whether that is globally or in local project.
無論是全域還是本地專案。
9:01.740–9:05.420
Claude auto reads it at the start of every single chat as system context.
Claude 會在每次對話開始時自動讀取它作為系統上下文。
9:05.620–9:07.180
So keep it under 200 lines.
所以請保持它在 200 行以下。
9:07.180–9:09.733
include things like your tech stack, your coding conventions,
包含你的技術堆疊、編碼規範,
9:09.733–9:10.600
your build commands,
你的建構指令,
9:10.880–9:13.820
the 95% confidence rule, only the most important things.
95% 信心規則,僅包含最重要的事項。
9:13.820–9:15.780
And you need to treat this like an index
你需要將此視為一個索引
9:15.780–9:17.665
route to where more data lives. And
指向更多資料所在的路由。並且
9:17.665–9:20.460
it's a complete mindset shift. This file basically
這是一種完整的心態轉變。這個檔案基本上
9:20.460–9:23.149
just tells cloud code, where is everything that it needs and
只是告訴 Claude Code,它需要的一切在哪裡,以及
9:23.149–9:24.440
what to do every single time.
每次該做什麼。
9:24.440–9:26.140
So it can point to files that are huge, but
所以它可以指向巨大的檔案,但
9:26.140–9:28.240
that way it just says, okay, I don't need this right
這樣做的好處是,它只會說:「好吧,我現在不需要這個,」
9:28.240–9:30.668
now, but if I do need this, I know exactly where to look.
「但如果我之後需要,我也清楚知道該去哪裡找。」
9:30.668–9:32.340
And because it knows exactly where to
而且因為它清楚知道該去哪裡
9:32.340–9:34.841
look, it's not going to waste time or tokens searching through and
查找,它就不會浪費時間或 token 去搜尋和
9:34.841–9:35.660
reading other files.
閱讀其他檔案。
9:35.660–9:37.780
It's just able to grab it right there by the file name.
它只需透過檔案名稱就能直接取得該檔案。
9:38.120–9:39.440
And the reason I say this is a mindset shift
我之所以說這是一種思維模式的轉變,
9:39.440–9:41.240
because you should be doing this with other things,
是因為你應該對其他事物也採取這種做法,
9:41.300–9:43.220
not just your Cloud.md, with your skills
而不僅限於你的 Cloud.md,
9:43.220–9:46.260
or with your master reference guide sheets.
或是你的技能說明或主要參考指南。
9:46.580–9:48.720
I saw someone talking about how they created an index
我看到有人提到,他們建立了一個
9:48.720–9:49.720
that's super, super lean,
非常精簡的索引,
9:50.020–9:52.080
and it shows Cloud Code exactly where to go
它能明確指出 Cloud Code 在
9:52.080–9:53.560
in the Cloud Code documentation.
Cloud Code 文件中該前往何處。
9:53.880–9:56.500
So if it needs help with something related to Cloud Code,
因此,如果它需要有關 Cloud Code 的協助,
9:56.560–9:58.440
it doesn't have to search through the whole database.
它就不必搜尋整個資料庫。
9:58.440–10:00.280
It can just say, okay, here's my index file.
它只需說:「好吧,這裡是我的索引檔案。」
10:00.380–10:02.120
I know exactly which URL to look up at.
我清楚知道該查詢哪個 URL。
10:02.300–10:02.860
Super simple.
非常簡單。
10:03.240–10:05.040
You wanna keep this lean and trim it all the time.
你要保持精簡,並隨時進行修剪。
10:05.040–10:07.617
It's always a work in progress because every single chat,
這始終是一個持續進行的過程,因為每一次對話,
10:07.617–10:09.120
not just like your session, every
不僅僅是整個工作階段,而是每一次
10:09.120–10:12.412
single message, cloud.md gets read. So if your cloud.
訊息,cloud.md 都會被讀取。所以如果你的 cloud.
10:12.412–10:14.900
md file is a thousand lines, every single
md 檔案有一千行,每次你發送
10:14.900–10:17.068
time you shoot off a message, even if you just say hi,
訊息時,即使你只是說「嗨」,
10:17.068–10:18.580
the whole thing's going to get read.
整個檔案都會被讀取。
10:18.920–10:21.768
Okay, number two here is to be surgical with file references.
好的,第二點是要精確地引用檔案。
10:21.768–10:23.220
Don't just say something like,
不要只是說:
10:23.340–10:25.200
here's my whole repo, go find the bug.
「這裡是我的整個程式碼庫,去找出錯誤。」
10:25.200–10:27.540
Say something more like, check the verify user
應該說得更具體些,例如:「檢查 auth.js 檔案內的 verify user
10:27.540–10:31.090
function inside the auth.js file. Or you can also
函式。」或者你也可以
10:31.090–10:34.120
use at file name to point at specific files
使用 @ 檔案名稱來指向特定檔案,
10:34.120–10:36.860
instead of once again, letting Claude explore freely.
而不是再次讓 Claude 自由探索。
10:37.160–10:39.200
The whole idea of being specific and routing.
核心概念在於具體明確並進行路由指引。
10:39.580–10:40.260
All right, so number three,
好的,第三點,
10:40.360–10:43.420
I'm saying to compact at around 60% capacity.
我建議在容量達到約 60% 時進行壓縮。
10:43.920–10:45.760
Auto-compact triggers at like 95%,
自動壓縮會在約 95% 時觸發,
10:45.760–10:48.280
by which point your context is already pretty degraded.
到那個時候,你的上下文資訊已經相當退化。
10:48.540–10:50.740
So run slash context to check your capacity percentage,
因此,請執行 /context 來檢查你的容量百分比,
10:50.860–10:52.460
or you should have the status line set up.
或者你應該已經設定了狀態列。
10:52.740–10:55.380
And at about 60%, just run the slash compact
大約在 60% 時,執行 /compact 指令
10:55.380–10:56.860
with specific instructions
並附上具體指示
10:56.860–10:58.360
on what it should actually be preserving.
說明應該保留哪些內容。
10:58.740–11:00.280
After three to four compacts in a row,
連續進行三到四次 compact 後,
11:00.460–11:01.980
the quality does start to degrade.
品質確實會開始下降。
11:02.080–11:04.100
So at that point, once you've done three or four,
因此在那個時候,當你已經完成了三或四次 compact 後,
11:04.120–11:06.517
just get a session summary slash clear,
只需執行 session summary / clear,
11:06.517–11:09.640
give the session summary back, and then keep going.
取得 session summary 後,繼續進行。
11:10.100–11:13.341
All right, so number four, short breaks are actually costing you.
好的,第四點,短暫休息實際上會讓你付出代價。
11:13.341–11:14.460
Cloud Code uses prompt
Cloud Code 使用提示
11:14.460–11:17.462
training to avoid reprocessing unchanged context,
訓練來避免重新處理未變更的上下文,
11:17.462–11:20.260
but the cache has a five-minute timeout. So if you
但快取有五分鐘的逾時設定。所以如果你
11:20.260–11:23.071
step away and you come back and it's been longer than five minutes,
離開然後回來,且超過五分鐘,
11:23.071–11:24.400
your next message reprocesses
你的下一則訊息會重新處理
11:24.400–11:26.399
everything from scratch at full cost. And
一切,並產生完整費用。而且
11:26.399–11:28.740
that is why some people feel like their usage just
這就是為什麼有些人覺得他們的用量會
11:28.740–11:30.720
randomly spikes if they might have, you know,
隨機飆升,如果他們可能,你知道,
11:30.720–11:32.700
stepped away and came back. So if you're going
離開然後回來。所以如果你打算
11:32.700–11:37.120
to do that, just consider doing a slash compact or a slash clear before you step away. All right,
那樣做,請考慮在離開前執行 /compact 或 /clear。好的,
11:37.140–11:39.524
number five, command output bloat. When
第五點,指令輸出膨脹。當
11:39.524–11:42.820
Claude runs shell commands, the full output enters your
Claude 執行 shell 指令時,完整輸出會進入你的
11:42.820–11:47.362
context window. So if you have a command that it comes back with 200 commits or,
上下文視窗。所以如果你有一個指令回傳了 200 個提交,或,
11:47.362–11:48.480
you know, just tons
你知道,只是大量的
11:48.480–11:53.120
and tons of data, then all of that is tokens that get sent to your model.
數據,那麼所有這些都會變成發送給模型的 token。
11:53.120–11:54.640
So really the takeaway
所以這裡真正要帶走的重點
11:54.640–11:57.194
here is to be intentional about what you let Claude run.
是要有意識地讓 Claude 執行什麼。
11:57.194–11:58.860
If you know in a certain project that
如果你知道在特定專案中
11:58.860–12:00.660
that doesn't need to use certain commands,
不需要使用某些指令,
12:00.660–12:02.740
then you can go ahead and in that project,
那麼你可以在該專案中
12:02.740–12:04.800
deny those permissions.
拒絕那些權限。
12:04.800–12:06.880
And this is another one that seems like it's invisible
這又是另一個看似隱形的問題,
12:06.880–12:10.040
because when it runs like a bash or certain commands,
因為當它執行 bash 或某些指令時,
12:10.040–12:11.940
it basically just has like one line
它基本上只有一行
12:11.940–12:13.600
and you don't actually see all the tokens
你實際上看不到它發送的所有 token。
12:13.600–12:16.040
that it has sent there.
好的,所以坐在这里編輯這部影片
12:16.040–12:18.080
All right, so sitting here editing this video
還有一件事
12:18.080–12:19.060
and there's just one more thing
我想說出來
12:19.060–12:21.020
that I wanted to get off my chest
基本上關於達到你的限制。
12:21.020–12:23.720
and it's basically about hitting your limit.
這部影片的目標和你的目標應該是
12:23.720–12:26.100
And the goal of this video and your goal should be
這段影片的目標以及你的目標應該是
12:26.100–12:28.640
to optimize so that you don't hit your limit,
進行優化,以避免觸發你的限制,
12:28.640–12:31.529
But I don't think that you should associate hitting your limit with like,
但我不認為你應該將觸及限制與
12:31.529–12:33.140
it shouldn't be a negative connotation.
負面含義聯繫起來。
12:33.520–12:37.036
Because ultimately, if you're doing a lot of these hacks and
因為最終,如果你做了很多這些技巧
12:37.036–12:39.920
you are not just like being wasteful with tokens,
並且你不僅僅是浪費 token,
12:40.340–12:42.880
then hitting your limit is actually a good thing if you think about it.
那麼從某種角度來看,觸及限制其實是一件好事。
12:42.880–12:45.860
Because it means that you are using this tool so much.
因為這意味著你如此頻繁地使用這個工具。
12:45.900–12:47.080
And I think that's what you want to be.
我認為這就是你想要達到的狀態。
12:47.140–12:51.474
I think you want to be a power user of this tool to the point where it's like,
我認為你應該成為這個工具的進階用戶,直到出現
12:51.474–12:52.540
got to wait again.
又要等待的情況。
12:52.540–12:53.980
And, you know, waiting sucks.
而且,你知道,等待很糟糕。
12:53.980–12:56.940
but people that are using it so much
但那些如此頻繁使用它的人
12:56.940–12:59.000
are going to be so much more productive
會變得更加高效
12:59.000–13:00.300
and so much farther ahead
並且遠遠領先於
13:00.300–13:02.660
than people who are never hitting their limits,
那些從未觸及限制的人,
13:02.860–13:05.280
not getting their money's worth
沒有物超所值
13:05.280–13:09.000
and not truly getting the leverage
也沒有真正獲得
13:09.000–13:09.800
that you are now getting.
你現在所獲得的優勢。
13:09.920–13:12.520
So anyways, quick little raw rant there,
所以,總之,這裡有一段快速而真實的抱怨,
13:12.640–13:14.900
but I think it's an important mindset shift to have,
但我認為這是一個重要的心態轉變,
13:14.960–13:16.480
just something to think about.
只是值得思考的事情。
13:17.000–13:18.940
All right, so we're moving on to tier three now.
好的,現在我們進入第三層。
13:19.060–13:20.960
I hope you guys feel like you already have a lot of things
我希望你們覺得已經有很多
13:20.960–13:21.620
that you wanna implement
想要實施的事情
13:21.620–13:24.520
and these ones are getting a little crazier as well.
而且這些技巧也變得越來越瘋狂。
13:24.660–13:25.720
So we've got four of these here
所以這裡有四個這樣的技巧
13:25.720–13:27.060
and I've got a few bonus ones also,
我還有一些額外的技巧,
13:27.360–13:28.940
but number one is to pick the right model.
但第一點是選擇正確的模型。
13:29.320–13:31.500
So Sonnet for your default, most coding work,
所以,對於默認的大多數編碼工作使用 Sonnet,
13:31.960–13:34.420
Haiku for sub-agents, formatting, simple tasks,
對於子代理、格式化和簡單任務使用 Haiku,
13:34.760–13:36.260
Opus for deep architectural planning
對於深度架構規劃使用 Opus
13:36.260–13:37.940
and only when Sonnet wasn't enough,
並且只有在 Sonnet 不夠用的時候,
13:38.240–13:39.860
try to keep this under 20% of usage
嘗試將這部分的使用量保持在 20% 以下
13:39.860–13:42.460
or unless you just really, really need it for that project.
除非你確實非常需要它來完成那個項目。
13:42.720–13:44.920
Now, a little tip here is when you have a huge code base
現在,這裡有一個小技巧,當你有一個巨大的代碼庫
13:44.920–13:46.780
and you wanna do certain things like maybe a review,
並且你想做一些特定的事情,比如審查,
13:47.280–13:48.920
then try bringing in Codex.
那麼嘗試引入 Codex。
13:49.240–13:50.420
There is an official plugin now
現在有一個官方插件
13:50.420–13:51.480
and I made a video about this.
我為此做了一個視頻。
13:51.480–13:53.552
I'll tag that right up here. But you could basically have,
我會在這裡標註出來。但你基本上可以擁有,
13:53.552–13:54.760
you know, Opus and Sonnet working
你知道的,讓 Opus 和 Sonnet 一起運作
13:54.760–13:57.390
together to build you, you know, a project or a code base.
共同為你建構專案或程式碼庫。
13:57.390–13:59.180
And then you could just bring in codecs
然後你可以引入 codecs
13:59.180–14:01.132
to actually review everything. And
來實際審查所有內容。並且
14:01.132–14:04.060
that way you're saving yourself on the Claude tokens.
這樣做可以幫你節省 Claude 的 token 用量。
14:04.480–14:07.272
The next one, number two here is the cost of sub agents.
接下來,這裡的第二點是子代理人的成本。
14:07.272–14:09.320
Agent workflows use roughly seven to 10
代理人工作流程使用的 token 數量大約是標準單一代理人工作階段的七到十倍。
14:09.320–14:12.188
times more tokens than a standard single agent session.
現在,為什麼會這樣?因為它們啟動時
14:12.188–14:14.080
Now, why is that? Because they wake up
會擁有自己完整的上下文,並且是一個獨立的實例。
14:14.080–14:17.203
with their own full context and it's a separate instance.
所以它們基本上必須在
14:17.203–14:18.960
So they basically have to reload
你啟動新工作階段時重新載入
14:18.960–14:21.137
everything when you start up the new session.
所有內容。
14:21.137–14:23.200
All of those files, all of the system tools,
所有那些檔案、所有系統工具,
14:23.320–14:25.599
like everything like that. Now what you can do though,
像是這類的一切。現在你可以做的是,
14:25.599–14:27.220
which is helpful, is to delegate to sub
這很有幫助,就是委派給子
14:27.220–14:28.497
agents for one-off tasks,
代理人處理一次性任務,
14:28.497–14:29.715
especially if you want th
特別是如果你希望那
14:29.715–14:31.920
at one-off task to use haiku. So maybe you need
個一次性任務使用 haiku。所以也許你需要
14:31.920–14:33.240
to process a lot of information,
處理大量資訊,
14:33.240–14:35.880
or maybe you need to do a ton of research and get just like a summary
或者也許你需要進行大量研究並只取得類似摘要
14:35.880–14:40.022
back. Now yes, tokens are still tokens no matter what at the end of the day,
的回報。現在是的,token 終究還是 token,
14:40.022–14:41.040
but if you can make
但如果你能將
14:41.040–14:46.260
80% of your tokens a cheaper model rather than 80% of your tokens an expensive model, then you're
80% 的 token 用於較便宜的模型,而不是 80% 的 token 用於昂貴的模型,那麼你將
14:46.260–14:48.617
going to be saving money. And then of course,
節省金錢。當然,
14:48.617–14:51.420
agent teams are cool. Sometimes I really do actually
代理人團隊很酷。有時我確實真的
14:51.420–14:54.458
like them and it helps me get more higher quality outputs,
喜歡它們,它們能幫助我獲得更高品質的輸出,
14:54.458–14:56.420
but they're very, very expensive. So
但它們非常、非常昂貴。所以
14:56.420–14:59.351
try to use them very sparingly. All right. So
請盡量謹慎使用。好的,所以
14:59.351–15:02.440
number three is to understand peak hours. So we
第三點是了解尖峰時段。所以我們
15:02.440–15:03.835
just talked about at the beginning,
剛才在開始時談到,
15:03.835–15:06.160
how they've adjusted how fast your five hour session window
他們如何根據尖峰時段的 Demand 調整你五小時工作階段視窗
15:06.160–15:09.390
drains based on demand during the peak hours,
的消耗速度,
15:09.390–15:12.620
which are 8am to 2pm Eastern time on weekdays,
尖峰時段是工作日的東部時間上午 8 點到下午 2 點,
15:12.620–15:14.160
but off-peak this is when
但離峰時段是指
15:14.160–15:17.900
your usage is kind of either normal or it lasts a little longer
你的使用量屬於正常情況,或者持續時間稍長
15:17.900–15:20.092
and these are afternoons evenings weekends so
的時段,這些是下午、晚上和週末,所以
15:20.092–15:22.340
if you actually think about this strategically
如果你從策略角度思考這個問題,
15:22.340–15:26.980
maybe you want to make sure that you're running big refactors or multi-agent sessions or big
也許你希望確保在離峰時段才執行大型重構或多代理人工作階段或大型
15:26.980–15:29.479
projects during off-peak hours only otherwise
專案,否則
15:29.479–15:32.040
you're going to you know drain right through that
你會知道,你會迅速耗盡那個
15:32.040–15:35.681
peak session and on top of this we'll call this a little hack 3.
高峰時段,此外,我們將這個小技巧稱為第 3.5 招。
15:35.681–15:37.180
5 which is the one i kind of
這是我之前
15:37.180–15:40.130
alluded to earlier when i said hey just keep open your clot account so
暗示過的一點,我說嘿,保持你的 Claude 帳戶開啟,以便
15:40.130–15:41.320
you can see your usage at all
隨時查看你的使用情況。如果你接近重置時間,
15:41.320–15:42.990
times. If you're near a reset and
並且你的配額還有剩餘空間,那就放手大用。嘗試
15:42.990–15:46.020
you have room left in your allocation, then go heavy. Try to
在重置前達到使用上限。
15:46.020–15:47.858
hit that usage limit before it resets.
物盡其用。讓你的代理人在那個
15:47.858–15:50.500
Get your money's worth. Let your agents go loose at that
階段自由發揮。另一方面,如果你接近限制,
15:50.500–15:53.586
point. And on the other side, if you're getting near your limit,
但還有大量時間,
15:53.586–15:55.100
but you still have lots of time,
那就退一步。
15:55.400–15:56.220
then step away.
這是時候休息一下,散個步,
15:56.570–15:58.627
This is your time to take a break, take a walk,
做點午餐,帶著滿額
15:58.627–16:00.350
make some lunch, come back with a full
預算回來,而不是為了小事情耗盡最後 5% 的額度,
16:00.350–16:03.464
budget instead of burning the last 5% on something small and
導致任務中途卡住,並且
16:03.464–16:05.270
getting stuck mid-task and having
不得不讓你知曉,
16:05.270–16:06.439
to just kind of, you know,
失去你可能已經進入的心流狀態。
16:06.439–16:08.610
lose that flow state that you might've been in.
好的,第四點,你系統的憲法,
16:08.610–16:12.035
Okay, number four, your system's constitution,
也就是 claw.md。這應該包含穩定
16:12.035–16:15.210
which is claw.md. This should contain stable
的決策、架構規則和進度摘要。
16:15.210–16:17.773
decisions, architecture rules, and progress summaries.
把它想像成讓每個提示詞越來越短的
16:17.773–16:19.290
Think of it like the source of truth
事實來源。
16:19.290–16:21.561
that makes every prompt shorter and shorter.
儲存決策,而非對話。你在那裡儲存的每個架構
16:21.561–16:24.490
Save decisions, not conversations. Every architectural
決策,都是你再也不需要輸入的一段文字。
16:24.490–16:27.677
call that you store there is a paragraph that you never have to type again.
所以這建立在
16:27.677–16:28.670
So this builds on top of
你在第一層級思考方式的基礎之上。
16:28.670–16:31.246
the way that you were thinking about it back in tier one.
你可以在那裡添加規則,基本上
16:31.246–16:33.150
You can add rules in there that basically
告訴它,嘿,我希望你幫助我確保我在智慧地使用 token。
16:33.150–16:36.919
tell it, hey, I want you to help me make sure I'm being smart about tokens.
對於任何
16:36.919–16:38.050
Use subagents for any
探索或研究,使用子代理。
16:38.050–16:39.398
exploration or research.
如果任務需要三個以上檔案或多檔案分析,啟動子
16:39.398–16:42.830
If a task needs three plus files or multi-file analysis, spawn a sub
代理,只回傳摘要後的洞察。
16:42.830–16:44.988
agent and only return summarized insights.
在 Haiku 中啟動該子代理。這裡有一個我放在 mycloud.md 底部的
16:44.988–16:47.730
Spawn that sub agent in Haiku. And here's a little prompt
小提示詞。並且
16:47.730–16:49.890
that I have at the bottom of mycloud.md. And
在我讀出這段話之前,我要說,你必須
16:49.890–16:52.170
I will say before I read this out, you have to be
小心,因為當
16:52.170–16:53.452
careful because when
你建立像
16:53.452–16:54.592
you make a file like
這種自我學習或自我進化的檔案時,你必須
16:54.592–16:57.870
this kind of self-learning or self-evolving, you have
經常檢查它,因為
16:57.870–16:59.304
to check on it frequently because
你不想讓它意外變得過於臃腫。但這裡我說
16:59.304–17:02.070
you don't want it to accidentally get too bloated. But here I said
已應用的學習。
17:02.070–17:04.435
applied learning. When something fails repeatedly,
應用式學習。當某件事反覆失敗時,
17:04.435–17:06.590
when Nate has to re-explain, or when a workaround
當 Nate 必須重新解釋,或為平台工具或限制找到替代方案時,
17:06.590–17:08.957
is found for a platform tool or limitation,
在此新增一行項目符號。將每個項目符號保持在 15
17:08.957–17:11.850
add a one-line bullet here. Keep each bullet under 15
字以內,不加解釋,
17:11.850–17:12.892
words, no explanations,
只新增那些能
17:12.892–17:13.835
only add things that wi
節省未來工作時間的內容。接著它會有一些項目符號。現在,我不是說這是最佳提示,
17:13.835–17:15.870
ll save time in future sessions. And then it's got
但我認為這種讓 Cloud.MD 實際學習並
17:15.870–17:19.398
some bullets. Now, I'm not saying this is the most optimal prompt,
持續思考如何節省您時間與 token 的系統
17:19.398–17:21.130
but I think this sort of system of
是個值得嘗試的好主意。好吧。所以
17:21.130–17:23.308
having your Cloud.MD actually learn and
我知道我們剛才討論了很多內容。
17:23.308–17:26.510
continuously think about how it can save you time and tokens
這份簡報將免費提供下載,地點在我的 FreeSchool 社群。
17:26.510–17:28.509
is a good idea to play with. All right. So
相關連結會在描述中提供。
17:28.509–17:30.810
I know that we just went through a ton of stuff.
但現在,你應該去做的這些
17:31.010–17:35.470
This whole slide deck will be available for download for free in my FreeSchool community.
事情。執行 /context,看看它的樣子。
17:35.470–17:37.352
the link for that will be down in the description.
前往一些活躍的工作階段,執行 /
17:37.352–17:39.050
But right now, what you should go do are these
cost。狀態列,確保它顯示你的模型、
17:39.050–17:41.820
things. Go run slash context, see what it looks like.
你的上下文百分比以及 token
17:41.820–17:44.150
Go to some of your active sessions, run slash
數量。確保你開啟雲端使用儀表板,以便
17:44.150–17:46.417
cost. Status line, make sure it's showing your model,
查看剩餘配額
17:46.417–17:48.130
your context percentage, and your token
以及重置時間。斷開未使用的 MCP 伺服器。
17:48.130–17:50.794
count. Make sure you pull up your cloud usage dashboard so
在 plan 模式下啟動複雜任務。使用
17:50.794–17:52.570
you can see your remaining allocation
/clear 當你切換到不相關的任務時。
17:52.570–17:56.547
and what time it resets. Disconnect unused MCP servers.
在上下文達到 60% 時手動壓縮。將你的
17:56.547–17:59.170
Start complex tasks in plan mode. Use
多步驟指令合併為單一訊息,並
17:59.170–18:02.650
slash clear when you're switching to an unrelated task.
將繁重的工作排定在離峰時段,
18:02.650–18:05.390
Manually compact at 60% context. Batch your
實際上就是要留意真正的時機。所以
18:05.390–18:07.846
multi-step instructions into single messages and
我想留給你們一、
18:07.846–18:10.130
schedule heavy sessions for off-peak hours and
或許兩條訊息。
18:10.130–18:12.541
really just be mindful about the actual timing. So
第一件事是
18:12.541–18:14.550
I wanted to kind of leave you guys with one,
關於品質與成本之間存在平衡的概念。
18:14.710–18:15.887
maybe two messages.
這是一種你需要稍微遊玩的遊戲。
18:15.887–18:16.925
The first thing is
有時你確實
18:16.925–18:19.970
just the idea that there is a balance between quality
需要追求更高品質,
18:19.970–18:22.893
and cost. And so that's kind of a game that you have to play a little bit.
這最終會花費你更多金錢。這只是
18:22.893–18:23.750
And sometimes you do
運作方式。但另一件事是保持簡單,
18:23.750–18:24.897
have to go for the higher quality,
並思考我們在
18:24.897–18:27.110
which ultimately is going to cost you more money. And that's just
這段影片開頭討論的,
18:27.110–18:30.120
the way it works. But the other thing is just to keep it simple and
它運作的方式。但另一件事就是保持簡單,並
18:30.120–18:31.370
think about what we talked
思考我們在這段影片
18:31.370–18:33.031
about at the beginning of this video,
一開始所討論的內容,
18:33.031–18:35.710
how tokens actually work, how Claude Code actually charges
令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令令
18:35.710–18:37.438
you. Most people don't need a bigger plan.
你。大多數人不需要更大的計畫。
18:37.438–18:39.710
They need to stop resending their entire conversation
他們需要停止重複發送整個對話
18:39.710–18:42.067
history 30 times when you could just send it,
歷史記錄30次,而你只需發送
18:42.067–18:44.870
you know, five times. It's not a limits problem. It's
你知道的,五次。這不是限制問題。而是
18:44.870–18:46.631
a context hygiene problem. But anyways,
上下文衛生問題。不過,
18:46.631–18:48.910
that is going to do it for this one. If you guys enjoyed
這集就到這裡。如果你們喜歡
18:48.910–18:50.780
or learned something new, please give it a like.
或學到了新東西,請按讚。
18:50.780–18:52.650
It helps me out a ton. And as always, I appreciate
這對我幫助很大。一如既往,我感謝
18:52.650–18:54.312
you guys making it to the end of the video.
感謝你們看到影片的最後。
18:54.312–18:56.170
I'll see you on the next one. Thanks everyone.
我們下一個影片見。謝謝大家。

影片筆記:18 Claude Code Token Hacks in 18 Minutes

一句話總結

針對 Claude Code 因累積式讀取歷史與隱形開銷(MCP、系統提示詞)導致的 Token 快速消耗問題,影片提供了從基礎指令監控(Tier 1)、系統檔案精簡(Tier 2)到模型選擇與策略調度(Tier 3)的 18 項優化技巧,強調「上下文衛生」優於單純追求高價方案。

核心重點

  1. Token 消耗機制:Claude Code 每次回應都會重新讀取整個對話歷史,導致成本呈指數級累積。數據顯示,在長對話中,高達 98.5% 的 Token 用於重複閱讀舊聊天歷史。
  2. 隱形開銷(Invisible Overhead):每次互動都會重新載入 Claude.md、MCP 伺服器定義、系統提示詞、Skills 及記憶檔案,這些佔用了大量上下文窗口。
  3. Lost in the Middle 現象:模型對對話開頭和結尾關注度較高,中間部分的內容容易被忽略,因此精簡上下文有助於提升輸出品質。
  4. Tier 1 基礎優化:透過 /clear 分隔任務、斷開不必要的 MCP 伺服器、合併提示詞、使用 Plan Mode、監控 /context/cost、設置狀態列及即時監控來控制成本。
  5. Tier 2 進階設定:將 Claude.md(或 claw.md/cloud.md)視為「索引路由」而非內容載體,控制在 200 行以內,僅包含技術堆疊、規範及「95% 信心規則」。
  6. Tier 3 高阶策略
  • 模型選擇:Sonnet 用於一般編碼,Haiku 用於子代理/格式化,Opus 用於深度架構規劃(<20%),Codex 用於大型程式碼庫審查。
  • 子代理成本:子代理擁有獨立上下文,成本約為標準會話的 7-10 倍,應謹慎使用或用於一次性任務。
  • 尖峰時段策略:週一至週五上午 8 點至下午 2 點(美東時間)為尖峰時段,會話窗口消耗較快;大型重構應安排在離峰時段。
  • 心態調整:達到限制並非壞事,問題在於上下文衛生。應透過精簡上下文、選擇合適模型及利用離峰時段來最大化投資報酬率。

詳細大綱

A. 背景與問題現狀

  • 近期用戶反映極快達到 Claude Code 的 Token 限制,即使在高價月費方案(如 $200/月)亦然。
  • Anthropic 員工提及將針對高峰與離峰時段進行調整,但部分用戶反映離峰時段仍消耗過快。
  • 講者整理出 18 個 Token 管理技巧,分為 Tier 1 至 Tier 3。

B. Token 運作機制解析

  • 定義:Token 是 AI 模型讀取及收費的最小文字單位(約等於一個單詞,但非絕對)。
  • 計費邏輯
  • 每次發送訊息,Claude 都會從頭重新讀取整個對話歷史。
  • 成本是「累積」且「指數級增長」,而非線性相加。
  • 範例:第 1 則訊息可能消耗 500 Token,第 30 則訊息可能消耗 15,000 Token(因為包含前 29 則的歷史)。
  • 數據顯示:在 100 則以上的對話中,高達 98.5% 的 Token 用於重複閱讀舊聊天歷史。
  • 隱形開銷
  • 每次互動都會重新載入 Claude.md、MCP 伺服器、系統提示詞(System Prompts)、Skills、檔案等。
  • 這些是「隱形開銷」(Invisible Overhead),持續佔用上下文。
  • 負面影響
  • 上下文膨脹不僅增加費用,還會降低輸出品質。
  • Lost in the Middle 現象:模型對對話開頭和結尾關注度較高,中間部分的內容容易被忽略。

C. Tier 1 技巧(9 項基礎優化)

  1. 開始新對話:使用 /clear 分隔不相關任務,避免將 Topic A 的上下文帶入 Topic B。
  2. 斷開 MCP 伺服器
  • 連接的 MCP 伺服器會在每次訊息中載入所有工具定義(可能單個伺服器就消耗 18,000 Token/訊息)。
  • 建議在 Session 開始時運行 MCP,並斷開不需要的伺服器。
  • 傾向於使用 CLI 而非 MCP(例如使用 Google Workspace CLI 而非 MCP 伺服器),因為更快速且便宜。
  1. 合併提示詞(Batch Prompts)
  • 將多個指令合併為一個訊息,避免歷史堆疊。
  • 若出錯,編輯原始訊息並重新生成,而非發送後續修正訊息(後續修正會永久堆疊在歷史中)。
  • *註*:單一任務專注度可能帶來更好的輸出品質,需視情況權衡。
  1. 使用 Plan Mode
  • 在執行實際任務前,讓 Claude 規劃方法並提出問題。
  • 防止 Claude 走錯方向寫程式後需全部推翻重來。
  • 建議在 Claude.md 中加入規則:在對需求有 95% 信心前,不進行任何更改,並持續提問。
  1. 使用 /context/cost 指令
  • /context:顯示當前消耗 Token 的類別(歷史、MCP 開銷、載入檔案等)。
  • /cost:顯示當前 Session 的實際 Token 使用量及預估花費。
  • 範例顯示:即使在新 Session 中,系統提示詞、工具、自訂代理、Skills、記憶檔案等已預先消耗約 51,000 Token。
  1. 設置狀態列(Status Line)
  • 在終端機(Terminal)中使用 /status line 指令。
  • 可視覺化顯示當前使用的模型、使用進度條、以及剩餘上下文窗口比例(例如 1,000,000 Token 中的 52,000 Token)。
  1. 保持儀表板開啟
  • 定期(每 20-40 分鐘)檢查使用情況,或設置自動化通知(如 Slack/簡訊)在接近限制時提醒。
  1. 精準貼上內容
  • 貼上大文件或檔案前,確認 Claude 是否需要完整內容。
  • 若僅需修復特定函數或段落,僅貼上該部分,避免餵送無關資訊。
  1. 即時監控 Claude 運作
  • 不要發送提示後就離開,需觀察其運作過程。
  • 若發現 Claude 陷入循環、重複讀取檔案或走錯方向,立即停止。
  • 避免在無效循環中浪費 80% 的 Token。

D. Tier 2 技巧(5 項進階設定)

  1. 精簡 Claude.md 檔案
  • 放置於專案根目錄(全域或本地)。
  • Claude 會在每次聊天開始時自動讀取此檔案作為系統上下文。
  • 建議控制在 200 行以內,僅包含技術堆疊、編碼規範、建置指令及「95% 信心規則」。
  • 心態轉變:將 Claude.md 視為「索引路由」(Index Route),指向資料存放處,而非直接包含大量內容。
  • 透過精簡索引,讓 Claude 知道資料位置,避免搜尋和讀取不必要檔案所浪費的 Token。
  • 此原則同樣適用於 Skills 或主參考指南(Master Reference Guide Sheets)。

E. Tier 3 高阶優化策略

  1. 選擇正確的模型 (Pick the right model)
  • Sonnet:預設模型,用於大多數編碼工作。
  • Haiku:用於子代理(sub-agents)、格式化、簡單任務。
  • Opus:用於深度架構規劃,僅在 Sonnet 不足時使用,建議佔比低於 20%。
  • Codex:針對大型程式碼庫審查時引入,可與 Opus 和 Sonnet 協作以節省 Claude 令牌。
  1. 子代理的成本與應用 (Cost of sub agents)
  • 代理工作流(Agent workflows)使用的令牌約為標準單一代理會話的 7 到 10 倍。
  • 原因:子代理擁有獨立的全量上下文和實例,啟動時需重新加載所有檔案和系統工具。
  • 建議:將一次性任務委派給子代理,特別是希望使用 Haiku 處理大量資訊或研究摘要時,以降低成本。
  • 代理團隊(Agent teams):雖能產生高品質輸出,但非常昂貴,應謹慎使用。
  1. 理解尖峰時段 (Understand peak hours)
  • 尖峰時段 (Peak hours):週一至週五上午 8 點至下午 2 點(美國東部時間)。此時 5 小時會話窗口消耗較快。
  • 離峰時段 (Off-peak):下午、晚上、週末。會話持續時間較長或正常。
  • 策略:大型重構、多代理會話或大型專案應安排在離峰時段進行。
  • Hack 3.5:保持 Claude 帳戶開啟以隨時查看用量。
  • 接近重置且有剩餘配額時:加大用量,嘗試在重置前達到上限,讓代理放手執行。
  • 接近上限但時間尚多時:暫停,離開去休息,待重置後帶回完整預算再繼續,避免在最後 5% 時因小任務卡住而中斷心流。
  1. 系統憲法 (Your system's constitution - claw.md / cloud.md)
  • 內容應包含穩定決策、架構規則和進度摘要。
  • 目標:作為「唯一真相來源」(source of truth),使每個提示越來越短。儲存決策而非對話。
  • 規則範例:指示使用子代理進行探索或研究;若任務需 3 個以上檔案或多檔案分析,則生成子代理並僅返回摘要;在 Haiku 中生成該子代理。
  • 應用學習 (Applied learning):當重複失敗、需重新解釋或找到平台工具/限制的變通方法時,新增一行簡短備註(15 字以內,無解釋,僅添加能節省未來會話時間的內容)。
  • 注意:此檔案具有自我學習/演進特性,需頻繁檢查以防過度膨脹。

F. 結語與心態調整

  1. 質量與成本的平衡
  • 有時必須追求高質量,這意味著更高的成本,這是正常現象。
  1. 核心觀念轉變
  • 大多數人不需要更大的方案,而是需要停止重複發送整個對話歷史。
  • 問題不在於限制(limits),而在於上下文衛生(context hygiene)。
  1. 行動清單 (Action Items)
  • 運行 /context 查看狀態。
  • 在活躍會話中運行 /cost
  • 確保狀態列顯示模型、上下文百分比和令牌計數。
  • 調出雲端使用儀表板查看剩餘配額和重置時間。
  • 斷開未使用的 MCP 伺服器。
  • 在計劃模式(plan mode)下啟動複雜任務。
  • 切換到不相關任務時使用 /clear
  • 在 60% 上下文時手動壓縮(compact)。
  • 將多步驟指令批處理為單一訊息。
  • 將重型會話安排在離峰時段。

工具 / 模型 / 名詞整理

  • Claude Code:影片討論的主要 AI 編碼助手。
  • Anthropic:Claude 的開發公司。
  • MCP Servers:Model Context Protocol 伺服器,用於連接外部工具。
  • Claude.md:Claude Code 的系統設定/提示詞檔案(筆記中亦提及 claw.mdcloud.md)。
  • CLI:Command Line Interface,命令列介面。
  • Google Workspace CLI:提及作為 MCP 伺服器的替代方案。
  • Google Workspace:提及的應用程式套件。
  • Google Calendar:提及的應用程式。
  • X:社群媒體平台(原 Twitter)。
  • Slack:提及用於自動化通知的工具。
  • Slash Commands
  • /clear
  • /context
  • /cost
  • /status line
  • /compact
  • 模型名稱
  • Sonnet:預設模型,用於大多數編碼工作。
  • Haiku:用於子代理、格式化、簡單任務。
  • Opus:用於深度架構規劃。
  • Codex:針對大型程式碼庫審查時引入。
  • FreeSchool community:提及的社群。
  • bash:提及的指令。
  • Lost in the Middle:專有名詞,指模型注意力分佈現象。
  • Invisible Overhead:隱形開銷,指系統提示詞、MCP 等重複載入的開銷。
  • Index Route:索引路由,指將系統檔案視為指向資料的索引而非內容本身。
  • Source of truth:唯一真相來源。
  • Agent workflows / Sub-agents:代理工作流/子代理。
  • Peak hours / Off-peak:尖峰時段/離峰時段。

操作流程整理

  1. 監控與診斷
  • 使用 /context 查看當前 Token 消耗類別(歷史、MCP、檔案等)。
  • 使用 /cost 查看當前 Session 的實際 Token 使用量及預估花費。
  • 使用 /status line 設置狀態列,視覺化顯示模型、進度條及剩餘上下文窗口比例。
  • 定期(每 20-40 分鐘)檢查雲端使用儀表板,或設置 Slack/簡訊通知。
  1. 日常操作優化
  • 新任務:使用 /clear 開始新對話,分隔不相關任務。
  • MCP 管理:在 Session 開始時運行 MCP,並斷開不需要的伺服器;傾向使用 CLI 替代 MCP。
  • 提示詞撰寫:合併多個指令為單一訊息(Batch Prompts);若出錯,編輯原始訊息重新生成,避免發送後續修正訊息。
  • 複雜任務:使用 Plan Mode,讓 Claude 規劃方法並提問,直到有 95% 信心才進行更改。
  • 檔案處理:精準貼上內容,僅貼上修復所需的特定函數或段落。
  • 即時監控:發送提示後觀察運作,若發現循環或錯誤立即停止。
  1. 系統設定維護
  • 維護專案根目錄的系統檔案(Claude.md/claw.md/cloud.md),控制在 200 行以內。
  • 將系統檔案視為索引,僅包含技術堆疊、規範、建置指令及「95% 信心規則」。
  • 應用學習:當重複失敗或找到變通方法時,新增一行簡短備註(15 字以內)至系統檔案。
  1. 策略性調度
  • 模型選擇:一般編碼用 Sonnet;子代理/格式化用 Haiku;深度架構用 Opus(<20%);大型審查用 Codex。
  • 子代理使用:將一次性任務或需大量資訊處理的工作委派給子代理(使用 Haiku 生成),避免高昂的標準會話成本。
  • 時段安排:大型重構、多代理會話安排在離峰時段(下午、晚上、週末);尖峰時段(週一至週五 8am-2pm EST)避免大型操作。
  • 配額管理:接近重置且有剩餘配額時,加大用量讓代理執行;接近上限但時間尚多時,暫停以保留預算。

值得注意的限制或風險

  1. Token 累積效應:隨著對話長度增加,成本呈指數級增長,而非線性相加。
  2. Lost in the Middle:模型對對話中間部分的內容關注度較低,過長的上下文會導致重要資訊被忽略。
  3. 子代理高昂成本:子代理工作流使用的令牌約為標準單一代理會話的 7 到 10 倍,因擁有獨立全量上下文。
  4. 系統檔案膨脹風險:系統憲法檔案(Claude.md 等)具有自我學習特性,若不加控制會過度膨脹,需頻繁檢查。
  5. 尖峰時段限制:尖峰時段(週一至週五上午 8 點至下午 2 點美東時間)的 5 小時會話窗口消耗較快。
  6. 上下文衛生問題:大多數用戶的問題不在於方案限制,而在

生字列表

生字讀音類型中文
limitりみっと限制,限度
promptぷろむと名詞提示,提示詞
threadしれっど名詞討論串,線程
sessionせっしょん名詞會話,工作階段
peak hoursぴっくあわーず名詞片語尖峰時段
off-peak hoursおっぴっくあわーず名詞片語離峰時段
tokenとうくん名詞權杖,記號(AI計費單位)
hackはっく名詞技巧,捷徑
tierてぃあー名詞等級,層級
reverse engineerりばーすいんじにあー動詞片語反向工程,逆向分析
baselineべーすらいん名詞基準,基準線
compoundingこんぱうんでぃんぐ動名詞複利累積,疊加
exponentiallyえくすぽーんしゅりー副詞指數級地,急劇地
cumulativeきゅulative形容動詞累計的,累積的
overheadおーばへっど名詞額外開銷,管理成本
bloatedぶろーてっど形容詞膨脹的,臃腫的
intentionいんてんしょん名詞注意力,意圖
implementいんぷるめんと動詞實作,實施

生字解說

limit りみっと

· N4

意思:限制,限度

解說:指數量、時間或範圍的上限。在技術語境中常指服務配額或用量上限。

影片原句
many people have been complaining about hitting their cloud code limit
許多人抱怨他們的雲端代碼用量限制
延伸例句
このアプリには一日あたりのメッセージ送信制限があります。
這個應用程式有每日訊息發送限制。

prompt ぷろむと

名詞 · N3

意思:提示,提示詞

解說:AI對話中使用者輸入的指令或問題。

影片原句
Claims like one prompt that is about 1% of the limit is now around 10%.
有人表示,原本只佔限制約1%的單一提示,現在卻佔到了10%左右。
延伸例句
AIに正確なプロンプトを入力することで、より良い回答が得られます。
輸入準確的提示詞可以獲得更好的回答。

thread しれっど

名詞 · N3

意思:討論串,線程

解說:在論壇或社群媒體中,圍繞同一主題的一系列相關回覆或訊息。

影片原句
You could go through X and find tons and tons of threads about this topic.
你可以在X上搜尋,找到大量關於這個主題的討論串。
延伸例句
このフォーラムでは、この問題に関するスレッドが多数見つかります。
在這個論壇上可以找到許多關於這個問題的討論串。

session せっしょん

名詞 · N3

意思:會話,工作階段

解說:指一段連續的互動時間或電腦系統的一次連接過程。

影片原句
people are reaching the session limit way too fast.
人們也過快達到了會話限制。
延伸例句
セッションが切れると、データが保存されません。
如果會話中斷,資料將不會被保存。

peak hours ぴっくあわーず

名詞片語 · N3

意思:尖峰時段

解說:指使用人數最多、系統負荷最重的時間段。

影片原句
are working on a little change with peak hours and off-peak hours.
正在針對尖峰時段和離峰時段進行一些調整。
延伸例句
ラッシュアワーは交通が非常に混雑します。
尖峰時段交通非常擁擠。

off-peak hours おっぴっくあわーず

名詞片語 · N3

意思:離峰時段

解說:指使用人數較少、系統負荷較輕的時間段。

影片原句
are working on a little change with peak hours and off-peak hours.
正在針對尖峰時段和離峰時段進行一些調整。
延伸例句
オフピーク時間帯は料金が安くなることがあります。
離峰時段的費用可能會較低。

token とうくん

名詞 · N3

意思:權杖,記號(AI計費單位)

解說:AI模型處理文字的最小單位,通常用於計費。

影片原句
I have 18 token management hacks for you guys
我為你們整理了18個Token管理技巧
延伸例句
AIモデルはトークン単位で課金されます。
AI模型按權杖單位計費。

hack はっく

名詞 · N3

意思:技巧,捷徑

解說:指解決問題或提高效率的巧妙方法或小技巧。

影片原句
I have 18 token management hacks for you guys
我為你們整理了18個Token管理技巧
延伸例句
この写真撮影のハックを試してみてください。
試試這個拍照技巧。

tier てぃあー

名詞 · N3

意思:等級,層級

解說:指分級或分層的系統中的某一級別。

影片原句
I've organized from tier 1 all the way up to tier 3
我將這些技巧從第1級到第3級進行分級
延伸例句
このゲームには異なるティアのキャラクターがいます。
這個遊戲中有不同等級的角色。

reverse engineer りばーすいんじにあー

動詞片語 · N2

意思:反向工程,逆向分析

解說:指通过分析結果來推導出設計原理或構造的方法。

影片原句
reverse engineer the way that you work in order to use less tokens.
反向工程你的工作方式,以減少Token的使用。
延伸例句
競合製品をリバースエンジニアリングして機能を分析した。
逆向分析競爭對手的產品以了解其功能。

baseline べーすらいん

名詞 · N3

意思:基準,基準線

解說:指作為比較基礎的標準或起點。

影片原句
Kind of just a good baseline.
這只是一個大致的基準。
延伸例句
このデータは比較のためのベースラインとなります。
這些數據將作為比較的基準。

compounding こんぱうんでぃんぐ

動名詞 · N2

意思:複利累積,疊加

解說:指利息或成本隨著時間和基數增加而加速增長的過程。

影片原句
your cost is compounding, not just adding
你的成本是複利累積,而不只是單純相加
延伸例句
複利効果で資産が増加していきます。
透過複利效應資產會增加。

exponentially えくすぽーんしゅりー

副詞 · N2

意思:指數級地,急劇地

解說:形容增長速度極快,呈指數級上升。

影片原句
it's exponentially growing.
它是呈指數級增長。
延伸例句
人口は指数関数的に増加している。
人口呈指數級增長。

cumulative きゅulative

形容動詞 · N2

意思:累計的,累積的

解說:指經過一段時間或多次累加後的總和。

影片原句
our cumulative tokens increasing
我們的累計 token 都在增加
延伸例句
累積した経験が役に立ちました。
累積的經驗派上了用場。

overhead おーばへっど

名詞 · N3

意思:額外開銷,管理成本

解說:指為了維持運作而產生的非直接成本或負擔。

影片原句
This is invisible overhead
這是隱形的開銷
延伸例句
管理コストが利益を圧迫している。
管理成本侵蝕了利潤。

bloated ぶろーてっど

形容詞 · N2

意思:膨脹的,臃腫的

解說:形容因包含過多不必要內容而變得笨重或低效。

影片原句
bloated context doesn't just cost you more money
膨脹的上下文不僅會讓你花費更多金錢
延伸例句
肥大化したプログラムは動作が遅い。
臃腫的程式運行速度較慢。

intention いんてんしょん

名詞 · N3

意思:注意力,意圖

解說:在此語境中指模型對內容的關注程度或聚焦能力。

影片原句
models are paying the most intention in the beginning of your session
模型在會話的開始和結尾處會投入最多的注意力。
延伸例句
彼は明確な意図を持って行動した。
他帶著明確的意圖行動。

implement いんぷるめんと

動詞 · N3

意思:實作,實施

解說:指將計劃、方法或功能具體執行或應用。

影片原句
These are the ones that are going to be super easy to implement
這些是非常容易實作的技巧
延伸例句
新しいシステムを実装する必要がある。
需要實施新系統。

句型解說(含實例)

~ing

意思:進行式,動名詞

接續:動詞語幹 + ing

解說:表示動作正在進行中,或作為名詞使用。

影片原句
many people have been complaining about hitting their cloud code limit
許多人抱怨他們的雲端代碼用量限制
實例
  1. 彼は今、新しいプロジェクトに取り組んでいます。
    他目前正在致力於新專案。
  2. 運動することは健康に良いです。
    運動對健康有益。

way too + adj

意思:過於……,太……了

接續:way too + 形容詞

解說:強調程度過高,帶有負面或驚訝的語氣。

影片原句
people are reaching the session limit way too fast.
人們也過快達到了會話限制。
實例
  1. このコーヒーは苦すぎます。
    這咖啡太苦了。
  2. 彼は私の話を聞きすぎている。
    他聽得太過仔細了。

even if / even after

意思:即使……,哪怕……

接續:even + if/after + 條件/時間

解說:表示儘管有某種條件或情況發生,結果依然不變。

影片原句
But even after that, some people were saying they were still hitting it really quick
但即使如此,仍有人表示他們依然很快觸發限制
實例
  1. 雨が降っても、私は走ります。
    即使下雨,我也會跑步。
  2. 彼が謝った後でも、私は怒っていた。
    即使他道了歉,我還是生氣。

~in order to + verb

意思:為了……

接續:in order to + 動詞原形

解說:表示目的或意圖,比單純的 to 更正式或強調目的性。

影片原句
reverse engineer the way that you work in order to use less tokens.
反向工程你的工作方式,以減少Token的使用。
實例
  1. 合格するために、毎日勉強します。
    為了及格,我每天學習。
  2. 彼はお金を稼ぐために働いている。
    他為了賺錢而工作。

~as + adj + as

意思:和……一樣……

接續:as + 形容詞 + as + 名詞/句

解說:表示兩者在某種性質上相等。

影片原句
So every single message in a long chat is exponentially more expensive than the same message in a fresh chat.
因此,長對話中的每一則訊息,其成本都比全新對話中的相同訊息呈指數級增加。
實例
  1. 彼は私と同じ背丈です。
    他和我一樣高。
  2. この問題は難しいです。
    這個問題很難。

~rather than + noun/verb

意思:與其……不如……

接續:rather than + 名詞/動詞原形

解說:表示選擇前者而非後者,或傾向於前者。

影片原句
rather than having the Google Workspace or Google Calendar MCP server
與其使用消耗大量 token 的 Google Workspace 或 Google Calendar MCP 伺服器
實例
  1. コーヒーより紅茶が好きです。
    我比較喜歡紅茶而不是咖啡。
  2. 彼らは議論するよりも行動する。
    他們選擇行動而不是爭論。

~instead of + noun/gerund

意思:代替……,而不是……

接續:instead of + 名詞/動名詞

解說:表示用後者取代前者,或作為替代方案。

影片原句
edit your original message and regenerate instead of sending a full follow-up correction.
請編輯您的原始訊息並重新生成,而不是發送完整的後續修正訊息。
實例
  1. 彼は車ではなくバスで行った。
    他坐巴士而不是開車去。
  2. 砂糖の代わりに人工甘味料を使った。
    使用了人工甜味劑代替糖。