推荐微信扫码登录以获得更好的体验!另:🎉建议更新到最新版,以体验新功能!🎉 版本更新记录→

【AI编程】AI怀疑者尝试plan模式后 · 每个改动都用它

2

剧集目录

标题时长
P1【AI编程】AI怀疑者尝试plan模式后 · 每个改动都用它12:20
P2【AI编程】AI怀疑者尝试plan模式后 · 每个改动都用它12:20

P1 · 【AI编程】AI怀疑者尝试plan模式后 · 每个改动都用它 p01 中英字幕 (P1)

字幕摘录

时间英文中文
0:00My interest in AI coding started when I tried plan mode.我对AI编码的兴趣始于我尝试计划模式时.
0:04Before I tried plan mode, I was a total AI skeptic.在我尝试计划模式之前, 我是一个完全AI怀疑。
0:06I thought there's no way that AI can write decent code.我认为AI不可能写出体面的代码.
0:09Certainly not at the speed that I can.当然不是以我所能的速度。
0:10There's no way that AI can understand my code baseAI不可能理解我的密码基础
0:13as well as I can.尽我所能
0:14And there's no way that AI can mimic the instinctsAI不可能模仿直觉
0:16that I've built up over a long career doing this stuff.我花了很长的时间做这些事
0:19And then Claude code released plan mode然后克劳德代码发布了计划模式
0:21and I tried it and I've never gone back.我试过了,我从来没有回去。
展开字幕全文(350 条)
序号英文中文
1My interest in AI coding started when I tried plan mode.我对AI编码的兴趣始于我尝试计划模式时.
2Before I tried plan mode, I was a total AI skeptic.在我尝试计划模式之前, 我是一个完全AI怀疑。
3I thought there's no way that AI can write decent code.我认为AI不可能写出体面的代码.
4Certainly not at the speed that I can.当然不是以我所能的速度。
5There's no way that AI can understand my code baseAI不可能理解我的密码基础
6as well as I can.尽我所能
7And there's no way that AI can mimic the instinctsAI不可能模仿直觉
8that I've built up over a long career doing this stuff.我花了很长的时间做这些事
9And then Claude code released plan mode然后克劳德代码发布了计划模式
10and I tried it and I've never gone back.我试过了,我从来没有回去。
11Every piece of code I write now goes through this loop我写的每件代码都经过这个循环
12where I first plan it in plan mode with an AI.我用人工智能在计划模式下第一次计划
13I then get the AI to execute the plan,然后,我得到了AI执行计划,
14basically write the code that was in the plan.基本上写出计划中的密码
15We then test it together either by running unit tests然后我们一起测试 通过运行单元测试
16or by type checking or by manual QA.或通过类型检查或人工质量控制。
17Then we commit the code and the process starts again然后我们输入代码 程序重新开始
18and we start planning the new thing.我们开始计划新的事情。
19I believe this process is completely indispensable我认为这个过程是绝对不可或缺的
20to getting decent outputs from an AI.从人工智能那里获得体面的产出。
21And if you drop this plan step altogether,如果你完全放弃这个计划
22then you are really hampering yourself那你真的在妨碍自己
23in terms of what you can do.就你所能做的而言
24Now for folks who want to skip to the end现在给那些想跳到最后的人
25and get the good stuff immediately,并立即得到好的东西,
26I've added a link below that shares my rules我下面加了一个链接 分享我的规则
27for creating really great plans in my Claude.md file.在我的Claude.Md档案里创造出非常伟大的计划
28We're gonna be going through some of these我们会经历一些这些
29and why I have them in here,和为什么我有他们在这里,
30but if you wanna get them right now and start using them,但是如果你现在想要他们开始使用,
31then follow the link below.然后沿着下面的链接。
32And if you don't wanna miss out on any more of this stuff,如果你不想错过这些东西
33then sign up to my newsletter there too.然后在那里报名我的通讯。
34But let's actually get talking about但让我们谈谈
35what plan mode is first of all.什么样的计划模式首先是。
36When you run Claude code or any kind of AI coding assistant当你运行 Claude 代码或任何类型的 AI 编码助理
37on your computer, it can do four main things.在你的电脑上,它可以做四个主要的事情。
38It can write to the file system,它可以写入文件系统,
39it can read from the file system,它可以从文件系统读取,
40or it can read websites and documentation或者它能读取网站和文件
41and go and ping URLs,并且去浏览URL,
42or it can run bash scripts on your local machine,或者它可以在你的本地机器上运行bash脚本,
43或者如果你在Windows, PowerShell之类的东西上,
44or it can use MCP servers that are either running locally也可以使用本地运行的 MCP 服务器
45or are remote and call tools on them或者远程的,或者召唤工具
46to do things and find out information.做一些事情,找出信息。
47The way that plan mode works计划模式的运作方式
48is you essentially disable the write functionality.您是基本禁用写入功能。
49In plan mode, the AI agent isn't allowed to write files在计划模式下, AI 代理不允许写入文件
50and the agent has a different system prompt而代理器有不同的系统提示
51telling it to do different things告诉它做不同的事情
52to actually create a plan before making any changes.在做出任何改变之前,实际创建一个计划。
53And if it tries to make changes,如果它试图改变,
54then it should actually encounter an error.然后它会遇到一个错误。
55So it's being stopped from making changes.因此它被阻止 做出改变。
56So because the agent can't do any writes to the file system,所以,因为代理不能做任何 写文件系统,
57it then goes into a mode where it explores your code base,然后进入一种模式 探索你的代码基础,
58looks for all the information it might need寻找所有它可能需要的信息
59and puts that into a detailed plan并把它纳入一个详细的计划
60that it will then go to execute on afterwards.然后,它将随后执行。
61You can get into plan mode really easily你很容易进入计划模式
62by just taking Claude code and just shift tabbing刚拿了克劳德的密码 换了个位置
63until you reach plan mode.直到你到达计划模式。
64Claude code was the first place that I saw plan mode,克劳德代码是我第一次看到计划模式的地方
65I don't know, about nine months ago, let's say.我不知道,大约9个月前,让我们说。
66But now other places like Cursor and VS Code但是现在其他的地方,如光标码和VS码
67also have plan mode.也有计划模式。
68So I've told you what it is,所以我告诉你是什么,
69but I haven't really told you但我没告诉你
70why this plan step here is so crucial.为什么这个计划在这里 如此关键。
71What happens if you don't plan如果你不计划怎么办?
72and instead go straight into executing?然后直接执行?
73Well, let's start off with the agent first.先从探员开始
74I want you to imagine for a second我希望你能想象一下, 一会儿
75that you had a colleague who every time they made a commit你有一个同事,他们每次犯罪,
76forgot everything they'd ever learned about the repo.忘记了他们从中学到的一切
77How would you make that colleague productive?你怎么让那个同事有成果?
78Well, probably what you'd tell them好吧,也许你会告诉他们
79is to explore the repo first是先探索回购
80before they went and made any changes.之前,他们去 并做了任何改变。
81And that's what plan mode does here.这就是计划模式在这里所做的。
82It loads up the LLM's context with all the relevant info.它将LLM的上下文加载了所有相关信息.
83It helps the LLM look at your code base它帮助 LLM 查看您的代码基础
84to see code patterns that you're using.来查看你使用的代码模式。
85And not only that, it will often use a really cheap,不仅如此,它还经常用很便宜的
86fast model to do this.快速的模型做到这一点。
87Claude code often uses 4.5 Haiku,克劳德代码经常使用4.5海库,
88which is really cheap and really, really quick非常便宜,非常,非常,非常快
89and launches it in a sub agent.然后用副剂发射
90So Haiku can go and ping out loads and loads of requests所以海库可以去查查要求的负载
91for different files, and then it sends back a summary对于不同的文件,然后它发送回一个摘要
92to the parent more expensive agent.给父母更贵的经纪人
93If you had no idea what I just said,如果你不知道我刚才说什么
94I will explore that in a future video.我会在未来的视频中探讨这个问题。
95But all of this to say that planning helps the agent.但所有这一切 都是为了说 计划帮助了代理。
96Now, if you don't do this,现在,如果你不这样做,
97then the context won't be loaded with relevant information.然后上下文就不会包含相关信息
98The LLM might make a stupid mistakeLLM可能会犯一个愚蠢的错误
99because it just doesn't have all the information.因为它只是没有 所有的信息。
100It might use patterns or context它可能使用模式或上下文
101that aren't actually used in your code base.这在你的代码基础里并没有使用
102And so lots of the failure modes that you might be seeing所以很多失败模式 你可能看到的
103while using these tools might be down to the fact在使用这些工具的同时,可能实际上
104that you're not planning.说你没有计划。
105But let's talk about the other side of the coin,但我们来谈谈硬币的另一面
106that planning actually helps the developer.计划实际上帮助了开发者。
107There's a great maxim from the pragmatic programmer实用程序员有个伟大的格言
108that says no one ever knows what they want.没人知道他们想要什么
109When you start planning out a new feature or a new idea,当你开始规划一个新的功能 或一个新的想法,
110you probably don't fully know exactly what you want.你可能并不完全知道你想要什么。
111If you're planning a refactor,如果你在计划重构
112you might not fully understand你可能无法完全理解
113the ramifications of your change.你改变的后果。
114When you've got a UI thing to tweak,当你有一个UI的东西去调整,
115you might have three different options你可能有三个不同的选择
116that you're considering in your head.你脑子里想着
117The way around this for most developers is rubber ducking,对大多数开发商来说 绕着这个方向是橡皮鸭
118is literally talking it out with someone else就是跟别人说话
119or a rubber duck in front of you或橡皮鸭在你面前
120until you've figured out the best solution直到你找到最好的解决方案
121by talking through it, considering all the options.通过对话,考虑所有的选择。
122And so an actual planning process helps the developer因此,一个实际的规划过程 帮助开发者
123by making sure they have a strong idea of what they want.确保他们对自己想要什么有强烈的认识。
124And this process is iterative.这个过程是迭代的。
125In other words, you loop back and forth with the AI换句话说,你和人工智能循环
126until you have a plan that you feel that you can depend on.直到你有你觉得可以依赖的计划
127And that process of the AI suggesting something人工智能的这个过程暗示
128and you saying, no, not quite.你说,不,不完全。
129By the end of that, both you and the AI到最后,你和人工智能
130are gonna have a clearer idea将会有一个更清晰的主意
131of what actually needs to be done.需要做点什么
132And then the doing of it is really simple然后做它真的很简单
133and you can mostly let the AI go on autopilot.你可以让AI继续自动驾驶
134Now, if you don't do this,现在,如果你不这样做,
135then the AI is not going to know quite what you want.那么人工智能不会完全知道你想要什么
136You in this situation are like a demanding client你这样就像个要求很高的客户
137demanding something gets fixed,要求一些东西得到修复,
138but the AI doesn't quite know how to implement it.但人工智能并不知道如何执行
139Or the AI isn't sure how to please you.或者人工智能不确定如何取悦你
140And if you don't talk out the requirements,如果你不说出要求
141you're not going to fully know what they are.你不会完全知道他们是什么
142Hashing out the requirements before you get to code在输入密码之前先按下要求
143is something we've been doing for 50 years as developers.是我们50年来作为开发者所做的。
144And there's no reason why we should stop now.我们没有理由现在停下来
145So hopefully I've convinced you希望我说服了你
146that plan mode is really useful.那个计划模式真的有用
147Let's actually walk through a recent trace of mine让我们从我的最近踪迹走过去
148so we can see it working.这样我们就能看到它起作用了
149I've been working on my course video manager,我一直在做我的课程录像经理
150which you've probably seen a few times你可能见过几次
151if you've been looking at this channel.如果你一直在看这个频道。
152The first thing I did was I entered plan mode我所做的第一件事是 我进入了计划模式
153and I described a bug that was happening.我描述一个虫子正在发生。
154Essentially in my database,在我的数据库里
155我刚刚从Repos转为repo版本,
156but not all of the code had been migrated yet.但并非所有代码都已经迁移。
157So something weird was happening when I added a repo.所以当我加回扣时 发生了奇怪的事情
158I didn't type this out, I just dictated this in.我没有打字,我只是说这个。
159And by the way, if you're not using a dictation tool顺便说一句,如果你没有使用拼写工具
160like whisper flow or super whisper, you absolutely have to,就像低语流或超级低语, 你绝对必须,
161but that's probably a topic for another video.但这可能是另一个视频的主题。
162So what it did is it then ran an explore sub agent所以它做的是运行一个探索子代理
163to explore the code base, understand the current schema来探索代码基础, 了解当前方案
164and how repos are created.和如何创造再现。
165Doing this, it burned around 40,000 tokens,做这个,它烧了大约4万个代币,
166but bear in mind, it wasn't using Opus 4.5 for this,但记住,它不是使用 Opus 4.5 为这个,
167it was using Haiku 4.5.用的是海库4.5
168And then it said, now I can see the issue clearly.然后它说,现在我可以清楚地看到这个问题。
169api.repos.add.ts创建没有版本的段落.
170Let me explore how versions are created elsewhere,让我探讨一下其他版本是如何创建的,
171understand that create sections method signature.理解创建分区的方法签名。
172So the explore sub agent just gave it a little hint所以,探险子代理刚刚给了它一点提示
173as to what was going wrong.至于什么是错的。
174And then it went and looked itself然后它走过去,看着自己
175创建 repo 版本。
176Let me check the exact schema definition.让我检查一下计划的定义
177And then once it had a full understanding,然后,一旦它有一个完全的理解,
178it said, let me write the plan.它说,让我写计划。
179It saves these plans on the file system它保存这些计划到文件系统
180so that you can actually read them yourselves.这样你们就可以自己读了
181And in fact, you can see in this directory,事实上,你可以看到这个目录,
182I have dozens and dozens of plans我有几十个计划
183from all of my plan mode usage.从我所有的计划模式使用。
184One thing it then did is it asked me some questions.然后它做了一件事,它问我一些问题。
185It asked, should new repos default to v1.0它询问, 如果新重置默认值为 v1.0 。
186as the initial version name?作为初始版本名称?
187And I said, yes.我说是的
188So in other words, it was iterating with me换句话说,它和我在一起
189towards the solution.走向解决方案。
190This was a question that I hadn't answered我还没回答这个问题
191in my initial like two line prompt,在我的开头像两行提示,
192and it figured out it needed that information它发现它需要这个信息
193and it asked me the information.它问我的信息。
194In other words, I was behaving like a crappy client,换句话说 我的行为就像一个烂客户
195not providing all the information upfront.没有提前提供所有信息。
196And so I had a question from the developer and I answered it.于是我从开发商那里得到了一个问题,我回答了这个问题。
197So I then approved the plan and moved out of plan mode于是我批准了这个计划 并脱离了计划模式
198into actual pushing mode.进入实际推进模式。
199And from there, it was then able从那里,它得以
200{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}真的可以改变
201Funnily enough, it turned out that there was something有意思的是,结果发现有什么东西
202that neither of us had considered,我们都没想过
203which was the sections still had a repo ID on them里面还有他们的身份
204from the previous iteration.从之前的重复。
205I said, surely they can just have a repo version ID我说,他们当然可以只 拥有一个Repo版本的ID
206and then resolve any dependencies through that.然后解决任何依赖 通过这一点。
207So for this, I actually kicked off plan mode again.因此,我再次放弃了计划模式。
208It went and did some more exploration here,它在这里做了更多的探索
209and then it found that it was a completely different task.然后它发现这是一个完全不同的任务。
210So it updated the plan file with this refactor.所以它用这个重构器更新了计划文件.
211Further down, it then answered,更进一步,他回答说:
212oh, I answered some more questions,哦,我回答了一些更多的问题,
213and it then went and did it and executed the code changes.然后它去做了它 并实施了代码更改。
214So that's what the plan mode execution loop这就是计划模式的循环
215actually looks like.看起来像
216And this scales from small changes, as we saw there,我们从小的变化中看到这些鳞片,
217to actually large scale architectural changes.事实上是大尺度的建筑改变
218One really cool thing I've seen people doing有件很酷的事我见过人做
219is taking their plans and putting them in GitHub issues把他们的计划放到GitHub议题上
220so other people can comment on them.所以其他人可以评论他们。
221Kind of like a request for comment RFC proposal有点像征求对RFC建议的评论
222where you just put it up, people ping their ideas up there,在那里,你刚把它, 人们在他们的想法在那里,
223and then you reach a shared solution together.然后你们一起达成一个共同的解决办法。
224It's even great to put them on GitHub PRs把它们放在GitHub公关上就更好了
225so that someone reviewing your code让别人审查你的代码
226can understand what the plan was when you made the code.能理解你做密码时的计划是什么
227But there's probably one question但也许有一个问题
228that's come into your head immediately.你马上就想起来了
229Isn't this just like a huge amount of reading?这难道不是一大批的读者吗?
230Like, I don't want my job to become喜欢,我不想我的工作成为
231just reading product requirement documents all day.整天看产品要求文件
232Well, let me show you the single line of text好吧,让我告诉你 单行文字
233that I added to my claw.md file我加入了我的爪子MD文件
234that has made my plans so much easier to read.这让我的计划更容易阅读
235Here it is right here.就在这里
236Make the plan extremely concise,让计划非常简洁,
237sacrifice grammar for the sake of concision.牺牲语法是为了切口。
238Now I've talked about this before,我之前说过了
239but this is an absolutely key part to my workflow.但这绝对是我工作流程的关键部分
240This takes plans that are like 2000 words long这需要两千字长的计划
241and puts them in 400 words.把它们写成400个字
242It gives you a really detailed high level overview这给你一个非常详细的高层次的概述
243of the changes and actually means you can skip through loads的修改,实际上意味着您可以跳过负载
244of the plan really, really fast计划真的,真的,真的很快
245and just scan it to see if anything looks wrong.扫描一下看有没有问题
246And finally, I say at the end of each plan,最后,我在每个计划的最后说,
247give me a list of unresolved questions to answer if any.给我一份尚未解决的问题清单,如果有的话。
248This gives the agent an extra little nudge这给了特工一个额外的小动作
249just to ask me anything that it's confused about只是想问我任何它困惑的东西
250or not sure about.还是不确定
251And it puts it in more of an exploratory,更像是在试探
252sort of slightly worried paranoid mode,有点担心妄想症
253which is where I want it.这就是我想要的地方。
254I strongly recommend you take these literally我强烈建议你从字面上拿这些
255three lines of text here,这里有三行文字
256take them, put them in your claw.md带上,放在你的爪子上
257and you will notice a massive difference in plan mode.你会发现计划模式的巨大差异
258I could make this setup longer, right?我可以做这个设置更长的时间,对不对?
259I could really go into detail here,我真的可以详谈一下
260but I don't want to overforce the LLM但我不想过度使用LLM
261and this claw.md will be put和这个爪子,md将被放置
262into every single session I use.进入我用的每一场课
263So I find that the concision here所以我发现这里的切口
264is actually really essential for steering the LLM better.实际上,对于更好地指导LLM来说,这是非常必要的。
265The fewer instructions you use inside your claw.md,用在爪子内的指示越少. 医生,
266the more instruction budget the LLM has to do other things.越多的教学预算 LLM不得不做其他的事情。
267But instruction budget is probably the topic但教学预算可能是话题
268for another video, I think.我想是另一个视频
269Now there's one final thing to cover here,现在还有一件事情要处理
270which I can hear you typing out in the comments immediately.我听到你在评论中立刻打字
271I got loads of these comments on my claw.code video as well,我爪子上有很多评论 密码录像也,
272which covered some similar ground.它覆盖了一些相似的地方。
273And what you're probably typing is,你可能会打字的是,
274I can do this faster myself.我自己能快点
275Going through the whole plan mode rigmarole,通过整个计划模式的硬币,
276then just to get the AI ready to do the work,然后让人工智能做好工作
277I can just go into the code base myself,我可以自己去密码基地
278change the files and actually just do it.更改文件, 并做它。
279And guess what?你猜怎么着?
280In some cases, you are absolutely right.在某些情况下,你绝对是对的。
281When you know the code base inside out,当你知道里面的密码时
282when you know exactly the change that needs to be made,当你确切地知道 需要做的改变,
283you go into the code base你进入密码库
284with a massive advantage over the LLM,与LLM相比有很大优势,
285which is you have all the context already.这是你所有的上下文。
286You don't need to send off an explore subagent你不需要派潜水员去探险
287to burn tokens to actually understand the code base,点燃符牌来真正理解密码基础,
288you know it already.你已经知道了
289And in those cases, you should absolutely go through在这种情况下,你绝对应该通过
290and make the change yourself.并亲自改变。
291But here's the thing you should think about,但你应该想想
292which is those cases are going to be relatively limited.这些案件将相对有限。
293In a large organization, you only have so many repos在一个大组织里,你只有这么多回扣
294that you understand deeply.你们深知。
295Plan mode allows you to contribute effectively计划模式允许您有效贡献
296to repos you don't know that well,如果你不知道的话
297because you and the LLM walk in因为你和LLM走进来了
298with the same amount of context.内容相同
299And plan mode allows you to work your way through the repo,计划模式允许你通过回购
300figure out exactly what change needs to be made,弄清楚需要做哪些改变,
301even if it's in a language就算是用一种语言
302that you're not quite that familiar with.说你不太熟悉
303And here's the other thing,还有一件事
304in this situation where you can do it faster than the LLM,在这样的情况下,你可以做到这一点 比LLM,
305it's probably quite a simple change.这可能是一个相当简单的改变。
306If it's a big architectural tweak,如果它是一个大的建筑修饰,
307then you probably still want to go那你可能还想去
308through the rubber duck process.通过橡胶鸭工艺。
309You can do that with a colleague, of course,你当然可以和同事一起
310but then you're taking up your colleague's time.但你要占用你同事的时间
311Wouldn't it be better to rubber duck with an AI用人工智能橡皮鸭不是更好吗?
312that can scan the code base, understand what's going on,它可以扫描代码基础, 了解发生了什么,
313create a plan document,创建计划文档,
314send that plan document to your buddy,把计划文件发给你的朋友
315and say, I've got this plan, what do you think?我说,我有这个计划,你觉得呢?
316Or you might find with the AI或者你可能会发现与AI
317that actually the requirements are more solid事实上,要求是更坚实的
318than you thought,比你想象的还要多
319and you can just get the AI to bash it out.你可以让人工智能把它打出来
320The final point here is that these tools最后一点是这些工具
321are only going to get faster.只会加快速度
322It's an open question这个问题没有定论
323as to whether the tools are going to get smarter.关于这些工具是否会变得更加聪明。
324I think they're going to get a bit smarter,我觉得他们会变得更聪明一点
325but not a lot smarter.但没那么聪明
326But what's guaranteed is that they will get faster.但可以保证的是,它们会更快。
327And so if your only advantage over AI is your speed,如果你对AI的唯一优势是速度
328then that advantage will get eroded more and more and more.然后,这种优势会越来越受到侵蚀。
329And so for me, I'm using plan mode every single time对我来说,我每次都用计划模式
330because I want to develop familiarity with these tools.因为我想让大家熟悉这些工具
331I want to understand how they work我想知道他们是怎么工作的
332and what their weaknesses are,他们的弱点是什么?
333because there are weird weaknesses baked into the cake因为蛋糕里有怪异的弱点
334that are not going to be removed however long this goes on for.不论持续多久,都无法消除。
335And the more feel I can get for AI,我越觉得自己可以得到AI
336I know the more secure my career is going forward.我知道我的职业越安全
337So that's plan mode,这就是计划模式
338this loop where you plan before you execute and test执行和测试前的这个循环
339that loads up the LLM with context用上下文加载 LLM
340and makes your requirements clearer to yourself.让你的要求更加明确
341If I had one tip to give to anyone that's doing AI coding,如果我有一个提示给任何人 谁做AI编码,
342it is to use plan mode.这是使用计划模式。
343It is a phenomenal tool for working with AI这是与AI合作的惊人工具
344and I honestly could not live without it.老实说,我不能没有它。
345And if you want to get the most out of plan mode,如果你想摆脱计划模式
346then you've got to follow the link below那你得跟着下面的链接
347获取 myagents.md文件。
348Thanks for following along folks.谢谢你跟随大家
349I've been really enjoying making these AI coding videos.我一直很喜欢制作这些 AI编码视频。
350I'll see you in the next one.后一见.
该视频共有字幕 350 条。解锁更多字幕为会员功能,请移动到 价格

P2 · 【AI编程】AI怀疑者尝试plan模式后 · 每个改动都用它 p02 无字幕 (P2)

字幕摘录

时间英文中文
0:00My interest in AI coding started when I tried PlanMode.我对AI编码的兴趣始于我尝试PlanMode时.
0:04Before I tried PlanMode, I was a total AI skeptic.在尝试PlanMode之前,我是一个完全AI怀疑。
0:06I thought, there's no way that AI can write decent code.我想AI不可能写得像样
0:09Certainly not at the speed that I can.当然不是以我所能的速度。
0:10There's no way that AI can understand my code baseAI不可能理解我的密码基础
0:13as well as I can.尽我所能
0:14And there's no way that AI can mimic the instinctsAI不可能模仿直觉
0:16that I've built up over a long career doing this stuff.我花了很长的时间做这些事
0:19然后Claude Code发布了PlanMode 我尝试过
0:22and I've never gone back.我从来没有回去。
展开字幕全文(351 条)
序号英文中文
1My interest in AI coding started when I tried PlanMode.我对AI编码的兴趣始于我尝试PlanMode时.
2Before I tried PlanMode, I was a total AI skeptic.在尝试PlanMode之前,我是一个完全AI怀疑。
3I thought, there's no way that AI can write decent code.我想AI不可能写得像样
4Certainly not at the speed that I can.当然不是以我所能的速度。
5There's no way that AI can understand my code baseAI不可能理解我的密码基础
6as well as I can.尽我所能
7And there's no way that AI can mimic the instinctsAI不可能模仿直觉
8that I've built up over a long career doing this stuff.我花了很长的时间做这些事
9然后Claude Code发布了PlanMode 我尝试过
10and I've never gone back.我从来没有回去。
11Every piece of code I write now goes through this loop我写的每件代码都经过这个循环
12where I first plan it in PlanMode with an AI.我首先在PlanMode用人工智能计划
13I then get the AI to execute the plan,然后,我得到了AI执行计划,
14basically write the code that was in the plan.基本上写出计划中的密码
15We then test it together either by running unit tests然后我们一起测试 通过运行单元测试
16or by type checking or by manual QA.或通过类型检查或人工质量控制。
17Then we commit the code and the process starts again然后我们输入代码 程序重新开始
18and we start planning the new thing.我们开始计划新的事情。
19I believe this process is completely indispensable我认为这个过程是绝对不可或缺的
20to getting decent outputs from an AI.从人工智能那里获得体面的产出。
21And if you drop this plan step altogether,如果你完全放弃这个计划
22then you are really hampering yourself那你真的在妨碍自己
23in terms of what you can do.就你所能做的而言
24Now for folks who want to skip to the end现在给那些想跳到最后的人
25and get the good stuff immediately,并立即得到好的东西,
26I've added a link below that shares my rules我下面加了一个链接 分享我的规则
27for creating really great plans in my Claude.md file.在我的Claude.Md档案里创造出非常伟大的计划
28We're gonna be going through some of these我们会经历一些这些
29and why I have them in here,和为什么我有他们在这里,
30but if you wanna get them right now and start using them,但是如果你现在想要他们开始使用,
31then follow the link below.然后沿着下面的链接。
32And if you don't wanna miss out on any more of this stuff,如果你不想错过这些东西
33then sign up to my newsletter there too.然后在那里报名我的通讯。
34But let's actually get talking about但让我们谈谈
35PlanMode是怎样的第一。
36When you run Claude Code or any kind of AI coding assistant当你运行 Claude 代码或任何类型的 AI 编码助理
37on your computer, it can do four main things.在你的电脑上,它可以做四个主要的事情。
38It can write to the file system,它可以写入文件系统,
39it can read from the file system,它可以从文件系统读取,
40or it can read websites and documentation或者它能读取网站和文件
41and go and ping URLs,并且去浏览URL,
42or it can run bash scripts on your local machine,或者它可以在你的本地机器上运行bash脚本,
43或者如果你在Windows, PowerShell之类的东西上,
44or it can use MCP servers that are either running locally也可以使用本地运行的 MCP 服务器
45or are remote and call tools on them或者远程的,或者召唤工具
46to do things and find out information.做一些事情,找出信息。
47The way that PlanMode works计划模式的运作方式
48is you essentially disable the write functionality.您是基本禁用写入功能。
49在PlanMode中,AI代理不允许写文件,
50and the agent has a different system prompt而代理器有不同的系统提示
51telling it to do different things告诉它做不同的事情
52to actually create a plan before making any changes.在做出任何改变之前,实际创建一个计划。
53And if it tries to make changes,如果它试图改变,
54then it should actually encounter an error.然后它会遇到一个错误。
55So it's being stopped from making changes.因此它被阻止 做出改变。
56So because the agent can't do any writes to the file system,所以,因为代理不能做任何 写文件系统,
57it then goes into a mode where it explores your code base,然后进入一种模式 探索你的代码基础,
58looks for all the information it might need寻找所有它可能需要的信息
59and puts that into a detailed plan并把它纳入一个详细的计划
60that it will then go to execute on afterwards.然后,它将随后执行。
61You can get into PlanMode really easily你很容易进入计划模式
62by just taking Claude Code and just shift-tabbing刚采取克劳德代码 和只是转身
63until you reach PlanMode.直到你到达计划模式。
64Claude Code是我第一次见到PlanMode的地方,
65I don't know, about nine months ago, let's say,我不知道,大约九个月前,让我们说,
66but now other places like Cursor and VS Code但是现在其他的地方,如光标和VS代码
67also have PlanMode.还有"计划模式"
68So I've told you what it is,所以我告诉你是什么,
69but I haven't really told you但我没告诉你
70why this plan step here is so crucial.为什么这个计划在这里 如此关键。
71What happens if you don't plan如果你不计划怎么办?
72and instead go straight into executing?然后直接执行?
73Well, let's start off with the agent first.先从探员开始
74I want you to imagine for a second我希望你能想象一下, 一会儿
75that you had a colleague who every time they made a commit你有一个同事,他们每次犯罪,
76forgot everything they'd ever learned about the repo.忘记了他们从中学到的一切
77How would you make that colleague productive?你怎么让那个同事有成果?
78Well, probably what you'd tell them好吧,也许你会告诉他们
79is to explore the repo first是先探索回购
80before they went and made any changes.之前,他们去 并做了任何改变。
81And that's what PlanMode does here.这就是PlanMode在这里的工作。
82It loads up the LLM's context with all the relevant info.它将LLM的上下文加载了所有相关信息.
83It helps the LLM look at your code base它帮助 LLM 查看您的代码基础
84to see code patterns that you're using.来查看你使用的代码模式。
85And not only that, it will often use a really cheap,不仅如此,它还经常用很便宜的
86fast model to do this.快速的模型做到这一点。
87Claude Code often uses 4.5 Haiku,克劳德代码经常使用4.5 海库
88which is really cheap and really, really quick非常便宜,非常,非常,非常快
89and launches it in a sub-agent,然后用一种试剂,
90so Haiku can go and ping out loads and loads of requests所以海库可以去和 拨出负载和负载的请求
91for different files, and then it sends back a summary对于不同的文件,然后它发送回一个摘要
92to the parent, more expensive agent.给父母 更贵的经纪人
93If you had no idea what I just said,如果你不知道我刚才说什么
94I will explore that in a future video.我会在未来的视频中探讨这个问题。
95But all of this to say that planning helps the agent.但所有这一切 都是为了说 计划帮助了代理。
96Now, if you don't do this,现在,如果你不这样做,
97then the context won't be loaded with relevant information.然后上下文就不会包含相关信息
98The LLM might make a stupid mistakeLLM可能会犯一个愚蠢的错误
99because it just doesn't have all the information.因为它只是没有 所有的信息。
100It might use patterns or context它可能使用模式或上下文
101that aren't actually used in your code base.这在你的代码基础里并没有使用
102And so lots of the failure modes that you might be seeing所以很多失败模式 你可能看到的
103while using these tools might be down to the fact在使用这些工具的同时,可能实际上
104that you're not planning.说你没有计划。
105But let's talk about the other side of the coin,但我们来谈谈硬币的另一面
106that planning actually helps the developer.计划实际上帮助了开发者。
107There's a great maxim from the pragmatic programmer实用程序员有个伟大的格言
108that says no one ever knows what they want.没人知道他们想要什么
109When you start planning out a new feature or a new idea,当你开始规划一个新的功能 或一个新的想法,
110you probably don't fully know exactly what you want.你可能并不完全知道你想要什么。
111If you're planning a refactor,如果你在计划重构
112you might not fully understand你可能无法完全理解
113the ramifications of your change.你改变的后果。
114When you've got a UI thing to tweak,当你有一个UI的东西去调整,
115you might have three different options你可能有三个不同的选择
116that you're considering in your head.你脑子里想着
117The way around this for most developers is rubber ducking,对大多数开发商来说 绕着这个方向是橡皮鸭
118is literally talking it out with someone else就是跟别人说话
119or a rubber duck in front of you或橡皮鸭在你面前
120until you've figured out the best solution直到你找到最好的解决方案
121by talking through it, considering all the options.通过对话,考虑所有的选择。
122And so an actual planning process helps the developer因此,一个实际的规划过程 帮助开发者
123by making sure they have a strong idea of what they want.确保他们对自己想要什么有强烈的认识。
124And this process is iterative.这个过程是迭代的。
125In other words, you loop back and forth with the AI换句话说,你和人工智能循环
126until you have a plan that you feel that you can depend on.直到你有你觉得可以依赖的计划
127And that process of the AI suggesting something人工智能的这个过程暗示
128and you saying, no, not quite.你说,不,不完全。
129By the end of that, both you and the AI到最后,你和人工智能
130are gonna have a clearer idea将会有一个更清晰的主意
131of what actually needs to be done.需要做点什么
132And then the doing of it is really simple然后做它真的很简单
133and you can mostly let the AI go on autopilot.你可以让AI继续自动驾驶
134Now, if you don't do this,现在,如果你不这样做,
135then the AI is not going to know quite what you want.那么人工智能不会完全知道你想要什么
136You in this situation are like a demanding client,在这样的情况下,你就像一个要求很高的客户,
137demanding something gets fixed,要求一些东西得到修复,
138but the AI doesn't quite know how to implement it.但人工智能并不知道如何执行
139Or the AI isn't sure how to please you.或者人工智能不确定如何取悦你
140And if you don't talk out the requirements,如果你不说出要求
141you're not going to fully know what they are.你不会完全知道他们是什么
142Hashing out the requirements before you get to code在输入密码之前先按下要求
143is something we've been doing for 50 years as developers.是我们50年来作为开发者所做的。
144And there's no reason why we should stop now.我们没有理由现在停下来
145So hopefully I've convinced you希望我说服了你
146that plan mode is really useful.那个计划模式真的有用
147Let's actually walk through a recent trace of mine让我们从我的最近踪迹走过去
148so we can see it working.这样我们就能看到它起作用了
149I've been working on my course video manager,我一直在做我的课程录像经理
150which you've probably seen a few times你可能见过几次
151if you've been looking at this channel.如果你一直在看这个频道。
152The first thing I did was I entered plan mode我所做的第一件事是 我进入了计划模式
153and I described a bug that was happening.我描述一个虫子正在发生。
154Essentially in my database,在我的数据库里
155我刚刚从Repos转为repo版本,
156but not all of the code had been migrated yet.但并非所有代码都已经迁移。
157So something weird was happening when I added a repo.所以当我加回扣时 发生了奇怪的事情
158I didn't type this out, I just dictated this in.我没有打字,我只是说这个。
159And by the way, if you're not using a dictation tool顺便说一句,如果你没有使用拼写工具
160like whisper flow or super whisper, you absolutely have to,就像低语流或超级低语, 你绝对必须,
161but that's probably a topic for another video.但这可能是另一个视频的主题。
162So what it did is it then ran an explore sub agent所以它做的是运行一个探索子代理
163to explore the code base, understand the current schema来探索代码基础, 了解当前方案
164and how repos are created.和如何创造再现。
165Doing this, it burned around 40,000 tokens,做这个,它烧了大约4万个代币,
166but bear in mind, it wasn't using Opus 4.5 for this,但记住,它不是使用 Opus 4.5 为这个,
167it was using Haiku 4.5.用的是海库4.5
168And then it said, now I can see the issue clearly.然后它说,现在我可以清楚地看到这个问题。
169api.repos.add.ts创建没有版本的段落.
170Let me explore how versions are created elsewhere,让我探讨一下其他版本是如何创建的,
171understand that create sections method signature.理解创建分区的方法签名。
172So the explore sub agent just gave it a little hint所以,探险子代理刚刚给了它一点提示
173as to what was going wrong.至于什么是错的。
174And then it went and looked itself然后它走过去,看着自己
175创建 repo 版本。
176Let me check the exact schema definition.让我检查一下计划的定义
177And then once it had a full understanding,然后,一旦它有一个完全的理解,
178it said, let me write the plan.它说,让我写计划。
179It saves these plans on the file system它保存这些计划到文件系统
180so that you can actually read them yourselves.这样你们就可以自己读了
181And in fact, you can see in this directory,事实上,你可以看到这个目录,
182I have dozens and dozens of plans我有几十个计划
183from all of my plan mode usage.从我所有的计划模式使用。
184One thing it then did is it asked me some questions.然后它做了一件事,它问我一些问题。
185It asked, should new repos default to v1.0它询问, 如果新重置默认值为 v1.0 。
186as the initial version name?作为初始版本名称?
187And I said, yes.我说是的
188So in other words, it was iterating with me换句话说,它和我在一起
189towards the solution.走向解决方案。
190This was a question that I hadn't answered我还没回答这个问题
191in my initial like two line prompt,在我的开头像两行提示,
192and it figured out it needed that information它发现它需要这个信息
193and it asked me the information.它问我的信息。
194In other words, I was behaving like a crappy client,换句话说 我的行为就像一个烂客户
195not providing all the information upfront.没有提前提供所有信息。
196And so I had a question from the developer and I answered it.于是我从开发商那里得到了一个问题,我回答了这个问题。
197So I then approved the plan and moved out of plan mode于是我批准了这个计划 并脱离了计划模式
198into actual pushing mode.进入实际推进模式。
199And from there, it was then able从那里,它得以
200{\fn黑体\fs22\bord1\shad0\3aHBE\4aH00\fscx67\fscy66\2cHFFFFFF\3cH808080}真的可以改变
201Funnily enough, it turned out that there was something有意思的是,结果发现有什么东西
202that neither of us had considered,我们都没想过
203which was the sections still had a repo ID on them里面还有他们的身份
204from the previous iteration.从之前的重复。
205I said, surely they can just have a repo version ID我说,他们当然可以只 拥有一个Repo版本的ID
206and then resolve any dependencies through that.然后解决任何依赖 通过这一点。
207So for this, I actually kicked off plan mode again.因此,我再次放弃了计划模式。
208It went and did some more exploration here,它在这里做了更多的探索
209and then it found that it was a completely different task.然后它发现这是一个完全不同的任务。
210So it updated the plan file with this refactor.所以它用这个重构器更新了计划文件.
211Further down, it then answered,更进一步,他回答说:
212oh, I answered some more questions,哦,我回答了一些更多的问题,
213and it then went and did it and executed the code changes.然后它去做了它 并实施了代码更改。
214So that's what the plan mode execution loop这就是计划模式的循环
215actually looks like.看起来像
216And this scales from small changes, as we saw there,我们从小的变化中看到这些鳞片,
217to actually large scale architectural changes.事实上是大尺度的建筑改变
218One really cool thing I've seen people doing有件很酷的事我见过人做
219is taking their plans and putting them in GitHub issues把他们的计划放到GitHub议题上
220so other people can comment on them.所以其他人可以评论他们。
221Kind of like a request for comment RFC proposal有点像征求对RFC建议的评论
222where you just put it up, people ping their ideas up there,在那里,你刚把它, 人们在他们的想法在那里,
223and then you reach a shared solution together.然后你们一起达成一个共同的解决办法。
224It's even great to put them on GitHub PRs把它们放在GitHub公关上就更好了
225so that someone reviewing your code让别人审查你的代码
226can understand what the plan was when you made the code.能理解你做密码时的计划是什么
227But there's probably one question但也许有一个问题
228that's come into your head immediately.你马上就想起来了
229Isn't this just like a huge amount of reading?这难道不是一大批的读者吗?
230Like I don't want my job to become就像我不想我的工作变成
231just reading product requirement documents all day.整天看产品要求文件
232Well, let me show you the single line of text好吧,让我告诉你 单行文字
233that I added to my claw.md file我加入了我的爪子MD文件
234that has made my plans so much easier to read.这让我的计划更容易阅读
235Here it is right here.就在这里
236Make the plan extremely concise,让计划非常简洁,
237sacrifice grammar for the sake of concision.牺牲语法是为了切口。
238Now I've talked about this before,我之前说过了
239but this is an absolutely key part to my workflow.但这绝对是我工作流程的关键部分
240This takes plans that are like 2000 words long这需要两千字长的计划
241and puts them in 400 words.把它们写成400个字
242It gives you a really detailed high level overview这给你一个非常详细的高层次的概述
243of the changes and actually means you can skip through更改并实际表示您可以跳过
244loads of the plan really, really fast计划真的,真的,真的快
245and just scan it to see if anything looks wrong.扫描一下看有没有问题
246And finally, I say at the end of each plan,最后,我在每个计划的最后说,
247give me a list of unresolved questions to answer, if any.如果有的话,请给我一份未决问题清单。
248This gives the agent an extra little nudge这给了特工一个额外的小动作
249just to ask me anything that it's confused about只是想问我任何它困惑的东西
250or not sure about.还是不确定
251And it puts it in more of an exploratory,更像是在试探
252sort of slightly worried paranoid mode,有点担心妄想症
253which is where I want it.这就是我想要的地方。
254I strongly recommend you take these literally我强烈建议你从字面上拿这些
255three lines of text here,这里有三行文字
256take them, put them in your claw.md带上,放在你的爪子上
257and you will notice a massive difference in plan mode.你会发现计划模式的巨大差异
258I could make this set up longer, right?我可以做这个设置更长的时间,对不对?
259I could really go into detail here,我真的可以详谈一下
260but I don't want to overforce the LLM但我不想过度使用LLM
261and this claw.md will be put into而这个爪子... 将投入
262every single session I use.每一次我用过的课
263So I find that the concision here所以我发现这里的切口
264is actually really essential for steering the LLM better.实际上,对于更好地指导LLM来说,这是非常必要的。
265The fewer instructions you use inside your claw.md,用在爪子内的指示越少. 医生,
266the more instruction budget the LLM has to do other things.越多的教学预算 LLM不得不做其他的事情。
267But instruction budget is probably the topic但教学预算可能是话题
268for another video, I think.我想是另一个视频
269Now there's one final thing to cover here,现在还有一件事情要处理
270which I can hear you typing out in the comments immediately.我听到你在评论中立刻打字
271I've got loads of these comments我有很多这些评论
272on my claw.code video as well,在我的爪子上。 密码录像也,
273which covered some similar ground.它覆盖了一些相似的地方。
274And what you're probably typing is,你可能会打字的是,
275I can do this faster myself.我自己能快点
276Going through the whole plan mode rigmarole,通过整个计划模式的硬币,
277then just to get the AI ready to do the work,然后让人工智能做好工作
278I can just go into the code base myself,我可以自己去密码基地
279change the files and actually just do it.更改文件, 并做它。
280And guess what?你猜怎么着?
281In some cases, you are absolutely right.在某些情况下,你绝对是对的。
282When you know the code base inside out,当你知道里面的密码时
283when you know exactly the change that needs to be made,当你确切地知道 需要做的改变,
284you go into the code base你进入密码库
285with a massive advantage over the LLM,与LLM相比有很大优势,
286which is you have all the context already.这是你所有的上下文。
287You don't need to send off an explore subagent你不需要派潜水员去探险
288to burn tokens to actually understand the code base.以燃烧符号来实际理解代码基础。
289You know it already.你已经知道了
290And in those cases, you should absolutely go through在这种情况下,你绝对应该通过
291and make the change yourself.并亲自改变。
292But here's the thing you should think about,但你应该想想
293which is those cases are going to be relatively limited.这些案件将相对有限。
294In a large organization, you only have so many repos在一个大组织里,你只有这么多回扣
295that you understand deeply.你们深知。
296Plan mode allows you to contribute effectively计划模式允许您有效贡献
297to repos you don't know that well,如果你不知道的话
298because you and the LLM walk in因为你和LLM走进来了
299with the same amount of context.内容相同
300And plan mode allows you to work your way through the repo,计划模式允许你通过回购
301figure out exactly what change needs to be made,弄清楚需要做哪些改变,
302even if it's in a language就算是用一种语言
303that you're not quite that familiar with.说你不太熟悉
304And here's the other thing,还有一件事
305in this situation where you can do it faster than the LLM,在这样的情况下,你可以做到这一点 比LLM,
306it's probably quite a simple change.这可能是一个相当简单的改变。
307If it's a big architectural tweak,如果它是一个大的建筑修饰,
308then you probably still want to go那你可能还想去
309through the rubber duck process.通过橡胶鸭工艺。
310You can do that with a colleague, of course,你当然可以和同事一起
311but then you're taking up your colleague's time.但你要占用你同事的时间
312Wouldn't it be better to rubber duck橡皮鸭不是更好吗?
313with an AI that can scan the code base,一个能扫描密码基础的AI,
314understand what's going on, create a plan document,了解发生了什么, 创建计划文件,
315send that plan document to your buddy,把计划文件发给你的朋友
316and say, I've got this plan, what do you think?我说,我有这个计划,你觉得呢?
317Or you might find with the AI或者你可能会发现与AI
318that actually the requirements are more solid事实上,要求是更坚实的
319than you thought, and you can just get the AI比你想象的还要多 你可以拿到人工智能
320to bash it out.击出它。
321The final point here is that these tools最后一点是这些工具
322are only going to get faster.只会加快速度
323It's an open question as to whether是否
324the tools are going to get smarter.工具会变得更聪明
325I think they're going to get a bit smarter,我觉得他们会变得更聪明一点
326but not a lot smarter.但没那么聪明
327But what's guaranteed is that they will get faster.但可以保证的是,它们会更快。
328And so if your only advantage over AI is your speed,如果你对AI的唯一优势是速度
329then that advantage will get eroded more and more and more.然后,这种优势会越来越受到侵蚀。
330And so for me, I'm using plan mode every single time对我来说,我每次都用计划模式
331because I want to develop familiarity with these tools.因为我想让大家熟悉这些工具
332I want to understand how they work我想知道他们是怎么工作的
333and what their weaknesses are,他们的弱点是什么?
334because there are weird weaknesses baked into the cake因为蛋糕里有怪异的弱点
335that are not going to be removed however long this goes on for.不论持续多久,都无法消除。
336And the more feel I can get for AI,我越觉得自己可以得到AI
337I know the more secure my career is going forward.我知道我的职业越安全
338So that's plan mode.这就是计划模式。
339This loop where you plan before you execute and test执行和测试前的循环
340that loads up the LLM with context用上下文加载 LLM
341and makes your requirements clearer to yourself.让你的要求更加明确
342If I had one tip to give to anyone that's doing AI coding,如果我有一个提示给任何人 谁做AI编码,
343it is to use plan mode.这是使用计划模式。
344It is a phenomenal tool for working with AI这是与AI合作的惊人工具
345and I honestly could not live without it.老实说,我不能没有它。
346And if you want to get the most out of plan mode,如果你想摆脱计划模式
347then you've got to follow the link below那你得跟着下面的链接
348获取 myagents.md文件。
349Thanks for following along folks.谢谢你跟随大家
350I've been really enjoying making these AI coding videos.我一直很喜欢制作这些 AI编码视频。
351I'll see you in the next one.后一见.
该视频共有字幕 351 条。解锁更多字幕为会员功能,请移动到 价格