0:00
(欢快的音乐)
0:02
- 你好。
0:05
大家好,我是Boris。
0:08
我是Anthropic的技术团队成员,
0:11
我创建了quad code。
0:13
今天和大家聊聊
0:15
使用quad code的一些实用技巧。
0:18
会很实用的。
0:20
我不会过多讲解其历史
0:22
或者理论之类的内容。
0:24
嗯,开始之前,
0:27
我们先快速举个手好吗?
0:28
谁之前用过quad code?
0:30
好啊,这才对。
0:34
没举手的朋友们,
0:36
我知道讲课时不该这样,
0:38
但如果你能打开笔记本电脑,
0:38
输入这段命令,
0:42
它会帮你安装quad code,
0:48
这样你后面能跟上讲解。
0:55
只要你的工作环境有Node.js就行。
0:58
(含糊不清)
1:04
嗯,你不必跟着敲,
1:06
但如果还没装,
1:08
现在是装它的好机会,可以跟着学。
1:11
那quad code是什么?
1:15
Quad code是一种全新的AI助手,
1:19
有过几代
1:20
为编程设计的AI助手。
1:23
大多数都是一次补全一行代码,
1:26
或几行代码。
1:28
而quad code并非如此,它是完全自主的。
1:31
它用于构建功能,
1:33
编写完整函数、完整文件,
1:37
同时修复整个bug。
1:39
quad code很酷的一点是,
1:42
它能配合你所有的工具使用,
1:44
你不用改变工作流程,
1:46
也不用更换一切设置来开始用它。
1:48
无论你用什么IDE,无论是VS code,
1:51
还是Xcode或JetBrains系列,
1:56
Anthropic内部有些人
1:57
死也不肯放弃他们的IDE,
2:00
但他们用quad code,因为quad code适用
2:03
所有IDE和终端。
2:05
无论本地、远程SSH,
2:08
或者TMUX等任何环境,都可运行它。
2:12
它是通用的,如果
2:17
你过去没用过这种自由形式
2:20
的代码助手,
2:22
可能会觉得难以入门,
2:24
因为打开后只有一个提示栏,
2:26
你可能会想,我该干嘛?
2:28
我该输入什么?
2:29
它是个强大工具,可以做很多事情,
2:32
但功能强大也意味着
2:34
我们不会指引你用固定流程,
2:36
毕竟你作为工程师,
2:38
应该能自由使用它。
2:40
首次打开quad code时,
2:47
我们建议做几件事
2:49
来配置你的环境。
2:51
这些操作都很简单。
2:52
运行terminal set up,可以让你用shift+回车
2:54
换行,不必用反斜杠输入新行。
2:56
这让使用体验更好。
2:58
你懂的,让它更顺手。
3:01
输入/slash theme设置浅色或深色模式,
3:04
或者其他漂亮主题。
3:05
你也可以输入/slash install GitHub app。
3:09
今天我们发布了GitHub应用,
3:12
可以让你在任何GitHub问题或拉取请求中
3:15
添加或提及一个cloud。
3:17
安装时,只需在终端运行该命令。
3:20
你可以自定义允许使用的工具列表,
3:24
这样不必每次都被提示。
3:25
这非常方便。
3:27
对于频繁提示的设置,
3:28
我肯定会这样定制,
3:30
避免每次都要确认。
3:32
还有一点,我很多提示
3:35
不会手动输入到quad code里。
3:37
如果你用macOS,可以进系统设置
3:40
在辅助功能的听写里启用它。
3:44
我常用的方法是双击
3:45
听写快捷键,然后直接口述提示。
3:49
拥有具体的提示真的很帮忙。
3:52
这实在太棒了。
3:53
你可以像跟其他工程师讲话一样
3:55
和quad code交流,不用敲太多代码。
3:58
刚开始用quad code时,
4:04
它非常自由,功能全。
4:06
那从哪里入手呢?
4:07
我最推荐的就是
4:09
从代码库问答开始。
4:11
直接提问,向你的代码库提问。
4:13
这是我们在Anthropic给新员工
4:15
的第一课。
4:18
技术入职第一天,
4:20
你会了解quad code,下载并配置好它。
4:23
然后你立刻开始提问
4:25
关于代码库的问题。
4:26
过去在做技术入职培训时,
4:28
这对团队来说是个很大的负担,对吧?
4:31
你必须问团队里的其他工程师。
4:34
你要查看代码,这需要一些时间。
4:36
你得弄明白怎么使用工具,
4:37
这也需要很长时间。
4:39
使用 Quad Code,你只需问它,
4:42
它就会自动浏览代码库。
4:43
它会回答这类问题。
4:45
所以在 Anthropic 入职时,
4:47
技术岗位一般需要两到三周。
4:49
现在大约只需要两三天。
4:50
Q&A 另一个很酷的地方是,
4:56
我们不做任何索引。
4:57
所以没有远程数据库存储你的代码。
4:59
我们不上传代码到任何地方。
5:00
你的代码保持本地。
5:02
我们不在代码上训练生成模型。
5:05
代码依然存在,
5:06
由你控制。
5:06
没有任何索引之类的东西。
5:09
这也意味着没有设置步骤。
5:11
你下载 Quad,启动它,
5:13
没有索引过程。
5:14
你无需等待。
5:15
可以马上开始使用。
5:16
这是一场技术讲解,
5:20
我会展示一些非常具体的提示语
5:22
和代码示例,
5:24
希望能帮助你提升 Quad Code 的使用体验。
5:28
可以问的问题比如,
5:30
这段代码具体是怎么用的,
5:33
或者我该如何实例化它?
5:34
Quad Code 不只是简单的文本搜索
5:36
来回答这个问题。
5:37
它通常会进一步深入,试图找到
5:41
这个类是如何被实例化的示例,
5:42
它是怎么被使用的?
5:44
它会给你更深入的答案。
5:45
这是你从基础文档中难以获得的,
5:48
而非简单的按 Command+F 查找。
5:52
我还经常用它查询 Git 历史。
5:55
例如,为什么这个函数有 15 个参数?
5:59
为什么参数名称这么奇怪?
6:01
我在所有代码库里都加了这类信息。
6:03
你会有类似这样的函数或类,
6:07
Quad Code 能查看 Git 历史,
6:09
找出这些参数是怎么被引入的,
6:11
是谁引入的,是什么情况,
6:14
这些提交关联了哪些问题?
6:16
它会浏览所有这些并做总结。
6:18
你不需要告诉它所有细节,
6:21
只要提问就行了。
6:22
你说,看一下 Git 历史,
6:23
我不知道该怎么做。
6:26
顺便说一句,它之所以知道,
6:27
不是因为我们特别提示了它。
6:28
系统提示里没有关于查看
6:30
Git 历史的任何信息。
6:32
它知道是因为这个模型非常强大。
6:34
如果你让它用 Git,它就知道怎么用 Git。
6:37
我们能基于这么优秀的模型开发,真的很幸运。
6:40
我也经常问关于 GitHub issue 的事。
6:43
它可以用网络抓取功能,获取 issue 并查找
6:47
相关上下文。
6:48
这非常棒。
6:51
我每周一的例会上都会这样做,
6:54
问“这周我发布了什么?”
6:57
Quad Code 会查看日志,
6:58
它知道我的用户名,
6:59
然后给我一份漂亮的发布内容清单。
7:02
我只需复制粘贴到文档里即可。
7:04
这是第一个技巧。
7:10
对于没用过 Quad Code 的人来说,
7:12
如果你第一次给团队演示,
7:15
我们非常推荐从代码库 Q&A 开始。
7:17
不要一开始就用复杂工具,
7:18
不要先修改代码,
7:19
先从问代码库的问题开始。
7:21
这能教会大家怎样提问。
7:23
也会慢慢让他们了解 Quad Code 的边界,
7:25
什么是它能做的,
7:27
什么是它能胜任的,
7:28
哪些需要你多引导一点。
7:31
哪些可以一次性完成?
7:32
哪些需要两步、三步操作?
7:33
哪些得用交互模式 REPL 来操作?
7:35
当你对 Q&A 比较熟悉后,可以深入做
7:37
代码编辑,
7:40
这是下一步。
7:42
用 LM 代理方式的酷点在于,
7:44
你给它工具,它能神奇地
7:46
自己学会使用工具。
7:51
这非常神奇。
7:53
它能自己找到用法。
7:54
我们在 Quad Code 中给它的工具很少,
7:56
数量不多。
7:58
It's not a lot.
8:00
所以它有一个编辑文件的工具。
8:02
它有一个运行bash命令的工具。
8:03
它有一个搜索文件的工具。
8:05
它会把这些工具串联起来,探索代码
8:08
头脑风暴,然后最终进行编辑。
8:12
你不必特别提示它使用这个
8:14
工具和那个工具,以及其他工具。
8:15
你只需要说,做这件事,它就会想办法去做
8:17
它。
8:17
它会以正确的方式把它们串联起来。
8:19
这对quad代码来说很有意义。
8:20
有很多使用它的方法。
8:26
我有时喜欢做的一件事是,在让
8:30
quad开始写代码之前,我会让它先头脑风暴
8:33
一下或者制定计划。
8:35
这是我们强烈推荐的。
8:37
我有时看到的是,人们会用quad代码
8:39
让它实现一个庞大的3000行功能。
8:43
有时它第一次就能准确做到。
8:45
但有时它做出来的东西
8:47
根本不是你想要的。
8:49
而得到你想要结果的最简单方法是让它
8:51
先思考。
8:55
所以先头脑风暴想法。
8:56
制定计划,告诉我。
8:57
在写代码之前先征求我的同意。
8:58
你不必使用计划模式。
9:01
你也不必用任何特殊工具来做这件事。
9:03
你只要问Claude就行。
9:05
它就知道该怎么做。
9:06
所以只说,写代码之前先制定计划。
9:07
就这样。
9:10
这也是——我想用它想想这个提交
9:13
推送的步骤。
9:15
这是我常用的一种方法。
9:15
没什么特别,但Claude足够聪明能理解它。
9:18
它会做一次提交。
9:20
它会推送到分支,新建分支,然后在GitHub上
9:21
为我创建一个拉取请求。
9:22
你不必做任何解释。
9:23
它会自己查看代码。
9:25
它会查看历史记录。
9:26
它会自己浏览Git日志,搞清楚提交格式等细节。
9:27
然后它会正确地提交并推送。
9:29
我们没有用系统提示让它这么做。
9:30
它就是知道怎么做。
9:32
模型很强大。
9:36
当你逐渐进阶时,你会想要
9:39
开始接入你团队的工具。
9:40
这正是Claude代码真正闪光的地方。
9:41
通常有两类工具。
9:46
一类是bash工具。
9:48
举个例子,我编了个叫burly的CLI工具。
9:51
它并不真实存在。
9:53
但你可以说,使用这个CLI做某事。
9:54
你可以告诉Claude代码这个工具。
9:57
你可以让它用--help参数来了解用法。
9:57
这样很高效。
9:59
如果你常用这个工具,也可以把信息
10:01
存进你的Claude MD,我们稍后会讲。
10:02
这样Claude可以跨会话记住它。
10:06
这是我们在在非营利组织中常用的模式,
10:07
外部客户也用得很多。
10:09
MCP工具同理。
10:11
Claude代码可以用bash工具。
10:13
也可以用MCP工具。
10:15
只要告诉它工具信息。
10:18
然后你可以添加MCP工具。
10:21
告诉它怎么用。
10:23
它就会开始用它。
10:24
这非常强大,因为当你开始用
10:25
新代码库时,你可以把所有
10:27
团队已有的工具给它。
10:29
Claude代码可以代你使用它们。
10:30
有几种常见工作流程。
10:33
之前说过,这个就是一种。
10:36
先做点探索,制定计划,然后开始写代码前征求我确认。
10:39
右边的其他工具非常强大。
10:40
当Claude有办法检查自己的工作——
10:43
比如写单元测试,或用puppeteer截屏,或截iOS模拟器屏幕——
10:45
它就可以迭代改进。
10:53
这很棒,比如你给它一个mock示例,告诉它做这个网页UI,
10:55
它会做得蛮好。
10:57
但迭代两到三次后,通常能做到几乎完美。
11:01
关键是给它一些工具,能用于反馈,检查结果。
11:02
基于此,它能自主迭代,
11:05
你会得到更好的成果。
11:07
无论你的领域是什么,是单元测试,还是
11:11
in puppeteer, or screenshotting the iOS simulator--
11:14
then it can iterate.
11:16
And this is incredible, because if you give it, for
11:18
example, a mock, and you say, build this web UI, it'll
11:20
get it pretty good.
11:22
But if you iterate two or three times, often it gets it
11:25
almost perfect.
11:26
So the trick is give it some sort of tool that it can use
11:29
for feedback to check its work.
11:31
And then based on that, it will iterate by itself, and you're
11:33
going to get a much better result.
11:35
So whatever your domain is, if it's unit test, or
11:37
集成测试,或截图,或应用程序,或网页,或
11:40
任何东西,只要给它一种查看结果的方式,它就会
11:43
迭代并变得更好。
11:44
所以这就是接下来的步骤。
11:50
教Claude如何使用你的工具,找出
11:52
正确的工作流程。
11:53
如果你想让Claude跳进代码,或者想让它
11:55
稍微清理一下,做个计划,如果你想让它
11:57
迭代,基本上要有些这样的意识。
11:59
这样你就知道如何提示Claude去做你想要的事。
12:02
当你深入到工具之外时,你要开始给
12:09
Claude更多的上下文。
12:10
上下文越多,决策越聪明,
12:12
因为作为在代码库中工作的工程师,你脑海中有
12:14
大量关于系统的上下文,所有
12:17
历史以及其他信息。
12:19
所以有不同的方法可以把这些给Claude。
12:22
随着你给Claude更多上下文,它表现会更好。
12:25
实现方式有很多种。
12:27
最简单的是我们称之为Claude MD的方式。
12:30
Claude.md是特殊的文件名。
12:33
最简单的放置位置是项目根目录。
12:36
也就是你启动Claude的那个目录。
12:38
在那放一个Claude MD文件。
12:40
它会在每次会话开始时自动被读入上下文中。
12:42
本质上,第一次用户交互会包含
12:43
Claude MD内容。
12:45
你也可以有一个本地的Claude MD,这个文件
12:48
通常不会提交到版本控制。
12:52
所以Claude MD文件,应提交到版本控制,与团队共享,
12:53
这样写一次可以共享给团队。
12:56
这个本地文件不提交。
12:58
仅供你自己使用。
13:00
你放在Claude MD里的内容,
13:01
比如常用bash命令,常用MCP工具,架构决定,
13:03
重要文件,任何你通常需要知道以便在此代码库工作
13:05
的信息。
13:09
尽量保持简短,因为太长会消耗大量上下文,
13:12
且通常没那么有用。
13:14
所以尽量保持尽可能简洁。
13:15
举例来说,在我们的代码库中,我们有常用bash命令,
13:18
有代码风格指南,有几个核心文件,
13:20
类似这样的东西。
13:21
其他的Claude MD文件可以放在其他
13:23
嵌套的子目录中,Claude会根据需求加载它们。
13:27
这些Claude MD文件会被自动加载。
13:30
你也可以在嵌套目录放置Claude MD文件,
13:32
当Claude在那些目录工作时,也会自动加载。
13:34
当然,如果你是公司,可能需要一个
13:37
跨所有代码库共享的Claude MD,由你代表用户管理,
13:39
可以放在企业根目录,它会自动加载。
13:41
有很多种方式可以加载上下文。
13:42
我为了表达可以用的各种方式,组装这段内容时
13:45
碰到了不少困难。
13:48
但Claude MD会自动加载。
13:51
你也可以使用快速命令(flash commands)。
13:54
这是.Dot Claude的快速命令。
13:56
它可以在你的主目录,也可以提交到项目中。
13:58
这是用来执行快速命令的。
14:00
这里有几个我们在Claude代码里用到的快速命令示例。
14:01
比如说,如果你在Claude代码库里看到问题被自动标记,
14:07
实际上就是这个工作流在运行。
14:09
它会给GitHub Issues打标签。
14:11
我们有个GitHub动作在运行,就是今天早上提到的,
14:12
Claude代码会执行这个快速命令,
14:15
它就是个快速命令。
14:16
执行后会给问题自动打标签,省去人工标记的时间。
14:18
节省了我们很多时间。
14:21
当然,你也可以添加引用文件,把它们纳入上下文。
14:21
正如我之前说的,嵌套目录里的Claude MD,
14:24
当Claude在那目录工作时会被加载。
14:29
所以给Claude更多上下文。
14:31
花时间调优上下文绝对值得。
14:34
你可以用提示改进器来优化。
14:37
考虑这个上下文是给谁的。
14:38
你是想每次都加载,还是按需加载,
14:40
想跟团队共享,还是个人使用,都去调优。
14:42
如果做得好,会显著提升性能。
14:46
随着你更深入,你会想更细致考虑
14:47
不同层级和方式来加载所有内容。
14:50
have to.
14:50
It just saves us a bunch of time.
14:53
And of course, you can add mention files to pull them into
14:55
context.
14:56
And like I said before, Claude MD is in a nested directory,
14:59
get pulled in when Claude works in that directory.
15:01
So give Claude more context.
15:08
And it's definitely worth taking the time to tune context.
15:11
You can run it through a prompt improver.
15:12
Consider who the context is for.
15:15
If you want to pull it in every time, if you want to pull
15:17
it in on demand, if you want to share it with a team, if it's
15:20
a personal preference, definitely take the time to tune
15:22
it.
15:22
This will improve performance dramatically if you do it
15:25
right.
15:25
As you get more advanced, you're going to want to think
15:33
about this a little bit more of this kind of hierarchy of
15:35
different ways to pull in everything.
15:36
不仅仅是Claude MD,也包括配置等。
15:42
关于Claude的一切,你都可以以这种方式引入
15:43
分层的方式。
15:45
所以项目是针对你的Git仓库的,你可以
15:48
提交它,或者只为自己使用。
15:51
你也可以有全局配置,应用于你所有的
15:53
项目,或者你可以有企业策略。
15:56
这本质上是一个你为
15:58
所有员工统一推行的全局配置,团队中的每个人
16:00
都会自动应用。
16:02
这张幻灯片信息量很大,但
16:05
关键是它适用于很多情况。
16:07
你可以用它来管理斜杠命令。
16:08
你也可以用它来管理权限。
16:10
比如说,如果你有一个批量命令,想
16:12
让所有员工都能运行,比如让所有员工使用
16:15
这个测试命令。
16:17
你实际上可以把它直接写进企业
16:19
策略文件里。
16:21
然后任何员工运行这个命令时,会
16:23
自动获得批准,非常方便。
16:26
你还可以用它来阻止命令。
16:27
比如说,有个URL绝对不能
16:29
被抓取。
16:31
只要把它添加到配置里。
16:32
这样员工就不能覆盖它了。
16:35
那个URL就永远无法被抓取。
16:38
这既方便解放员工,也
16:40
有助于保护你的代码库安全。
16:43
MCP服务器也一样。
16:45
有个MCP JSON文件,提交到代码库。
16:47
这样每当有人在代码库中运行quad代码时,
16:50
都会提示安装MCP服务器并与团队
16:53
共享。
16:54
如果你不确定用哪种,这其实是一个
17:00
相当复杂的矩阵。
17:01
因为我们支持很多东西。
17:03
工程师的工作流非常灵活。
17:04
每个公司都不一样。
17:05
所以我们想支持所有情况。
17:07
如果你不知道如何开始,我建议
17:09
先从共享项目上下文开始。
17:12
你写一次,
17:13
然后与你团队所有人分享。
17:14
这样就会产生网络效应,有人做点工作,
17:17
团队所有人都能受益。
17:19
Quad内置了很多管理工具。
17:26
比如说,运行/memory,你可以看到所有
17:29
被引入的不同记忆文件。
17:31
比如我有企业策略。
17:33
我有用户记忆。
17:34
我有项目的quad MD。
17:36
还有可能有嵌套的quad MD。
17:38
只会在某些目录下被引入。
17:42
同理,运行/memory时,你可以编辑
17:45
特定的记忆文件。
17:46
当你输入井号记住某事时,你可以
17:48
选择想要存到哪个记忆里。
17:49
这就是下一步。
17:55
花时间配置Quad MD、MCP服务器,配置
18:00
团队使用的所有东西,这样你只用配置一次,
18:02
然后与所有人共享。
18:05
一个例子是在我们的人类学应用仓库里。
18:11
这里是我们所有网页和应用代码所在的仓库。
18:16
这里有个puppeteer MCP服务器,我们共享给
18:18
团队。
18:19
并且有一个MCP JSON文件被提交。
18:21
所以任何在该仓库工作的工程师都能用puppeteer
18:24
来自动化pilot、测试和截图
18:26
并进行迭代,这样每个工程师
18:28
就不用自己安装了。
18:29
这是关于专业技巧的讲解。
18:35
我想稍作插曲,讲讲一些
18:38
大家可能不知道的常用快捷键。
18:40
为终端开发很难,
18:41
但也很有趣。
18:43
这感觉像是在重新发现一种新的设计语言。
18:46
但终端有个特点,就是极简。
18:49
所以有时很难发现这些快捷键。
18:52
这里是个快速参考表。
18:54
任何时候你都可以按Shift+Tab接受编辑,
18:58
这会切换到自动接受编辑模式。
19:00
bash命令不需要批准,编辑则
19:02
自动接受,你随时可以让Quad
19:04
稍后撤销它们。
19:06
例如,当我知道Quad方向正确,
19:09
或者写单元测试并迭代时,我
19:11
通常会切换到自动接受模式。
19:13
这样我不用每个编辑都确认。
19:17
任何时候你想让Claude记住某事,比如
19:19
它没正确使用某工具,你想让它
19:22
以后正确使用,只需输入井号,告诉它要记住什么,
19:24
它就会记住。
19:26
它会自动将其纳入Quad MD。
19:26
如果你想切换到bash模式,执行一个
19:30
bash命令,可以按感叹号并输入
19:32
命令。
19:35
命令会在本地执行,同时也会进入
19:35
上下文窗口,Quad下一次能看到。
19:38
这对长时间运行的命令很有用。
19:42
如果你
19:44
确切知道你想做什么,或者任何你
19:46
想要进入上下文的命令。
19:47
Quad 会看到命令和输出。
19:51
你可以添加上千个文件夹。
19:53
任何时候你都可以按 Esc 停止 Quad 的操作,
19:57
无论 Quad 在做什么,你总能看到我们是否按了
19:58
Esc 键。
19:59
这不会破坏会话。
20:00
也不会弄乱任何东西。
20:02
比如 Quad 正在编辑文件。
20:04
我按下 Esc。
20:04
告诉它要做不同的操作。
20:06
或者它建议了一个 20 行的修改,我觉得
20:09
19 行完美,但有一行你应该
20:11
改动。
20:12
我按下 Esc。
20:12
告诉它。
20:13
然后让我告诉它重新做一次。
20:17
你可以按两次 Esc 回到历史状态。
20:20
结束会话后,你可以用 resume 来恢复那个会话,
20:22
或者用 --continue。
20:25
任何时候如果想看更多输出,按
20:28
控制键(controller)。
20:30
它会显示完整输出,跟 Quad 在上下文窗口里看到的一样。
20:31
And that'll show you the entire output, the same thing
20:34
that Quad sees in its context window.
20:35
接下来我想讲的是 Quadcode SDK。
20:44
我们之前顶部提过这个。
20:46
紧接着这之后,说它在做一个会话,我觉得,
20:49
就在走廊对面。
20:50
他会深入讲解 SDK。
20:52
如果你没试过这个,或者在 Quad 里用过 -P 参数,
20:55
这就是 SDK。
20:58
我们这几周不断增加功能,让它更强大。
21:00
few weeks to make it even better.
21:03
所以你可以基于它开发。
21:05
能做很多酷炫的事。
21:06
这正是 Quadcode 使用的东西。
21:08
完全相同的 SDK。
21:11
比如,你可以用 Quad -P。
21:13
这是命令行 SDK。
21:15
你可以传入提示(prompt)。
21:18
可以传入允许的工具,甚至可以包括
21:20
特定的 bash 命令。
21:22
可以告诉它你想要什么格式。
21:24
比如 JSON,或者流式 JSON,
21:27
方便你做处理。
21:29
这对构建基于它的应用很棒。
21:31
我们在持续集成里一直用它,也用来应急响应,
21:34
各种流水线里都用它。
21:37
非常方便。
21:38
把它当作一个类 Unix 工具就行。
21:39
你给它一个提示,它给你 JSON。
21:41
你可以随意使用它。
21:42
可以向它传输输入,也可以从它传出输出。
21:44
管道功能也很酷。
21:50
比如用 Git status,然后把结果传给它,
21:53
再用 JQ 选择结果。
21:56
组合无穷无尽。
21:58
这是个新思路。
21:59
像一个超级智能的 Unix 工具。
22:02
我觉得我们才刚刚开始摸索用法。
22:04
我们还在探索中。
22:07
你可以从 GCP 存储桶读取巨量日志,传给它,
22:11
让 Cloud 发现日志里有什么
22:12
有趣的内容。
22:14
你可以获取 Century CLI 的数据。
22:18
也同样可以输入数据,让 Cloud 做些处理。
22:20
最后一个,也是我们见过最高级的用例,
22:29
我算是个 Quad 普通用户。
22:31
通常我只开一个 Quad。
22:34
有时会开多个终端标签页,
22:36
运行几个不同代码库。
22:38
看过 Enthropic 的高手们,
22:41
几乎都开 SSH 会话。
22:44
用 Tmux 隧道连接 Quad 会话。
22:47
会有多个同一仓库的检出,
22:50
这样他们可以并行运行多个 Quad。
22:53
或者用 Git worktree 做隔离。
22:55
我们正在积极优化使用体验。
22:56
但现在这些就是在 Cloud 里并行工作的思路。
22:59
你可以开任意多会话。
23:03
可以同时完成很多事情。
23:05
就是这样。
23:08
我还想留点时间回答问题。
23:10
我想这是我最后一页幻灯片了。
23:14
如果大家有问题,
23:17
两边都有麦克风。
23:19
我们很乐意回答任何问题。
23:21
[掌声]
23:23
我明白了。
23:27
嗨,Boris。
23:31
感谢你开发 Cloud Code。
23:42
我想知道对你来说,开发中最难的部分是什么?
23:50
我觉得有很多棘手的地方。
23:51
我觉得最难的一部分是
23:54
我们为了让 bash 命令安全做的工作。
23:59
I think there's a lot of tricky parts.
24:03
I think one part that is especially tricky
24:06
is the things that we do to make bash commands safe.
24:10
Bash 本质上是相当危险的。
24:11
它可能以意想不到的方式改变系统状态。
24:14
但与此同时,如果你必须手动
24:18
批准每一条 bash 命令,
24:20
作为工程师会非常烦人。
24:21
而且你几乎无法高效工作,
24:23
因为你必须不断地验证每条命令。
24:25
怎样安全地进行操作,
24:28
并能适应不同代码库的规模,
24:30
很有挑战,因为不是每个人
24:32
都在 Docker 容器中运行代码。
24:35
我们最终确定的是,
24:37
某些命令是只读的。
24:39
我们会做一些静态分析,
24:40
来判断哪些命令可以安全组合,
24:43
以安全的方式。
24:44
然后我们有一个相当复杂的分级权限
24:47
系统,可以在不同层级允许或屏蔽命令,
24:49
实现白名单和无阻断命令管理。
24:53
你好,Boris。
24:54
你提到给 Cloud Code 传递一个镜像,
24:57
这让我想知道是否有我不知道的多模态
25:00
功能。
25:02
那是——你只是把它指向
25:03
文件系统上的镜像还是别的?
25:05
是的,Cloud Code 完全支持多模态,
25:08
从一开始就是这样的。
25:09
它在终端里,所以不太容易发现。
25:12
但你可以拖拽一个镜像进来,
25:15
这会奏效。
25:16
你也可以提供一个文件路径,同样有效。
25:18
你还能复制粘贴镜像,这也可以。
25:23
我经常这样用,比如我有个模拟文件,
25:26
我就拖拽进来。
25:28
告诉它去实现,
25:29
给它多级服务器以便迭代测试。
25:32
是的,这完全自动化。
25:33
嘿,你为什么做一个 CLI 工具而不是 IDE?
25:43
这是个好问题。
25:44
我觉得有两个原因。
25:45
一是我们开始时是为 Anthropic 做的,
25:48
Anthropic 的人用各种不同的 IDE。
25:51
有的人用 VS Code,有的人用 said、Xcode、Vim 或 Emacs。
25:58
做一个适合所有人的工具很难。
26:00
终端就是最通用的选择。
26:03
第二, Anthropic 近距离见证了模型的快速进步,
26:10
越来越好。
26:10
我觉得很可能今年年底,
26:13
人们就不再使用 IDE 了。
26:15
所以我们想为这个未来做好准备。
26:17
想避免在 UI 和其他层面过度投入,
26:21
因为模型发展速度快,
26:24
这些工作很快就可能没用了。
26:26
是的。
26:32
你使用 Cloud Code 做机器学习建模有多少?我不知道这段录音有没有开。
26:35
你使用 Cloud Code 做机器学习建模有多少?
26:39
还有那种 AutoML 的体验。
26:40
我很好奇到目前为止的体验如何。
26:44
问题是,我们用 Cloud Code 做机器学习和建模的频率如何?
26:48
其实我们用得挺多的。
26:50
Anthropic 的工程师和研究员每天都用 Cloud Code,
26:51
大约 80% 的技术人员每天都用。
26:56
希望你能从产品中看到,我们投入了很多爱和自用。
27:00
这包括用笔记本工具编辑和运行笔记本的研究员。
27:01
好的,非常酷。
27:04
谢谢。
27:04
好了,我想就这些。
27:06
谢谢。
27:10
[掌声]
27:12
[音乐播放]
27:13
[音乐播放]
27:16
All right, I think that's it.
27:17
Thanks.
27:18
[APPLAUSE]
27:20
[MUSIC PLAYING]
27:48
[MUSIC PLAYING]
0:00
(upbeat music)
0:02
- Hello.
0:05
Everyone, I'm Boris.
0:08
I'm a member of technical staff here at Anthropic,
0:11
and I created quad code.
0:13
And here to talk to you a little bit
0:15
about some practical tips and tricks for using quad code.
0:18
It's gonna be very practical.
0:20
I'm not gonna go too much into the history
0:22
or the theory or anything like this.
0:24
And yeah, before we start, actually,
0:27
can we get a quick show of hands?
0:28
Who has used quad code before?
0:30
Yeah, all right, that's what we like to see.
0:34
For everyone that didn't raise your hands,
0:36
I know you're not supposed to do this
0:38
while people are talking,
0:38
but if you can open your laptop and type this,
0:42
and this will help you install quad code
0:48
just so you can follow along for the rest of the talk.
0:55
All you need is no JS if you have a dish at work.
0:58
(mumbling)
1:04
Yeah, well, you don't have to follow along,
1:06
but if you don't have it yet,
1:08
this is your chance to install it so you can follow along.
1:11
So what is quad code?
1:15
Quad code is a new kind of AI assistant,
1:19
and there's been different generations
1:20
of AI assistants for coding.
1:23
Most of them have been about completing line at a time,
1:26
completing a few lines of code at a time.
1:28
Quad code is not for that, it's fully agentic.
1:31
So it's meant for building features,
1:33
for writing entire functions, entire files,
1:37
fixing entire bugs at the same time.
1:39
And what's kind of cool about quad code
1:42
is it works with all of your tools,
1:44
and you don't have to change out your workflow,
1:46
you don't have to swap everything to start using it.
1:48
So whatever IDE you use if you use VS code
1:51
or if you use Xcode or if you use JetBrains IDEs,
1:56
there's some people out on Tropic
1:57
that you can't pry them from their cold, dead hands,
2:00
but they use quad code because quad code works
2:03
with every single ID, every terminal out there.
2:05
It'll work locally over remote SSH,
2:08
over Tmox, whatever environment you're in, you can run it.
2:12
It's general purpose, and this is something
2:17
where if you haven't used these kind of free form
2:20
coding assistants in the past,
2:22
it can be kind of hard to figure out how to get started
2:24
'cause you open it up and you just see a prompt bar
2:26
and you might wonder like, what do I do with this?
2:28
What do I type in?
2:29
It's a power tool, so you can use it for a lot of things,
2:32
but also because it can do so much,
2:34
we don't try to guide you towards a particular workflow
2:36
because really you should be able to use it
2:38
however you want as an engineer.
2:40
As you open up quad code for the first time,
2:47
there's a few things that we recommend doing
2:49
to get your environment set up.
2:51
And these are pretty straightforward.
2:52
So run terminal set up, this will give you shift enter
2:54
for new lines so you don't have to do
2:56
like back slashes to enter new lines.
2:58
This is, you know, it makes it a little bit nicer to use.
3:01
Do slash theme to set light mode or dark mode
3:04
or delta nice themes.
3:05
You can do slash install GitHub app.
3:09
So today when we announced a GitHub app
3:12
where you can add, mention a cloud
3:15
on any GitHub issue or a pull request.
3:17
So to install it, just run this command in your terminal.
3:20
You can customize the set of allowed tools that you can use
3:24
so you're not prompted for it every time.
3:25
This is pretty convenient.
3:27
For stuff that I'm prompted about a bunch,
3:28
I'll definitely customize it in this way
3:30
so I don't have to accept it every time.
3:32
And something that I actually do is for a lot of my prompts,
3:35
I won't hand type them into a quad code.
3:37
If you're on macOS, you can go into your system settings
3:40
under accessibility as dictation and you can enable it.
3:44
And so something I do is you just hit
3:45
like the dictation key twice and you can just speak your prompt.
3:49
And it helps a lot to have specific prompts.
3:52
So this is actually pretty awesome.
3:53
You can just talk to quad code and like you would
3:55
another engineer and you don't have to type a lot of code.
3:58
So when you're starting out with quad code,
4:04
it's so freeform and it can do everything.
4:06
What do you start with?
4:07
The thing I recommend above everything else
4:09
is starting with code base Q&A.
4:11
So just asking your question, asking questions
4:13
to your code base.
4:15
This is something that we teach new hires at Anthropic.
4:18
So on the first day in technical onboarding,
4:20
you learn about quad code, you download it, you get it set up.
4:23
And then you immediately start asking questions
4:25
about the code base.
4:26
And in the past, when you're doing technical onboarding,
4:28
it's something that taxes the team a lot, right?
4:31
You have to ask other engineers on the team questions.
4:34
You have to look around the code and this takes a while.
4:36
You have to figure out how to use the tools
4:37
that this takes a long time.
4:39
With quad code, you can just ask quad code
4:42
and it'll explore the code base.
4:43
It'll answer these kind of questions.
4:45
And so at Anthropic onboarding, you
4:47
should take about two or three weeks for technical hires.
4:49
It's now about two or three days.
4:50
What's also kind of cool about Q&A is we
4:56
don't do any sort of indexing.
4:57
So there's no remote database with your code.
4:59
We don't upload it anywhere.
5:00
Your code stays vocal.
5:02
We do not train generative models on the code.
5:05
So it's there.
5:06
You control it.
5:06
There's no indices or anything like this.
5:09
And what that means is also there's no setup.
5:11
So you start quad, you download it.
5:13
You start it, there's no indexing.
5:14
You don't have to wait.
5:15
You can just use it right away.
5:16
This is a technical talk.
5:20
So I'm going to show some very specific prompts
5:22
and very specific code samples that you can use
5:24
and hopefully improve and up level your quad code experience.
5:28
So some kind of questions that you can ask is,
5:30
how is this particular piece of code used
5:33
or how do I instantiate this thing?
5:34
And quad code, it won't just do a text search
5:36
and try to answer this.
5:37
It'll often go a level deeper and it'll try to find examples
5:41
of how is this class instantiated?
5:42
How is it used?
5:44
And it'll give you a much deeper answer.
5:45
So something that you would get out of a weekier documentation
5:48
instead of just like Command F.
5:52
Something that I do a lot also is ask it about Git history.
5:55
So for example, why does this function have 15 arguments?
5:59
And why are the arguments named this weird way?
6:01
And this is something I've added in all of our code bases.
6:03
You have some function like this or some class like this.
6:07
And quad code can look through Git history.
6:09
And it'll look to figure out how did these arguments get
6:11
introduced and who introduced them and what was the situation?
6:14
What are the issues that those commits linked to?
6:16
And it'll look through all this and summarize it.
6:18
And you don't have to tell it that in all this detail,
6:21
you just ask it.
6:22
So you say, look through Git history.
6:23
And I don't know who to do this.
6:26
The reason it knows it, by the way,
6:27
is not because we prompted it to.
6:28
There's nothing in the system prompt about looking
6:30
through Git history.
6:32
It knows it because the model is awesome.
6:34
And if you tell it to use Git, it'll know how to use Git.
6:37
So we're lucky to be building on such a good model.
6:40
I often ask about GitHub issues.
6:43
So it can use web fetch and it can fetch issues and look up
6:47
contexts on issues, too.
6:48
And this is pretty awesome.
6:51
And this is something that I do every single Monday in our
6:54
weekly stand-up is I ask, what did I ship this week?
6:57
And quad code looks to the log.
6:58
It knows my username.
6:59
And it'll just give me a nice readout of everything I shipped.
7:02
And I'll just copy and paste that into a docs.
7:04
So yeah, that's tip number one.
7:10
For people that have not used quad code before, if you're
7:12
just showing it to someone for the first time onboarding your
7:15
team, the thing we definitely recommend is start with code
7:17
base Q&A.
7:18
Don't start by using fancy tools.
7:19
Don't start by editing code.
7:21
Just start by asking questions about the code base.
7:23
And that'll teach people how to prompt.
7:25
And it'll start teaching them this boundary of like, what
7:27
can quad code do?
7:28
What is it capable of versus what do you need to hold this
7:31
hand with a little bit more?
7:32
What can be one-shotted?
7:33
What can be two-shotted, three-shotted?
7:35
What do you need to use interactive mode for in a
7:37
REPL?
7:40
Once you're pretty comfortable with Q&A, you can dive into
7:42
editing code.
7:44
This is the next thing.
7:46
And the cool thing about any sort of agentic, like using
7:51
an LM in an agentic way is you give it tools, and it's just
7:53
like magical.
7:54
It figures out how to use the tools.
7:56
And with quad code, we give it a pretty small set of tools.
7:58
It's not a lot.
8:00
And so it has a tool to edit files.
8:02
It has a tool to run bash commands.
8:03
It has a tool to search files.
8:05
And it'll string these together to explore the code
8:08
brainstorm, and then finally make edits.
8:12
And you don't have to prompt it specifically to use this
8:14
tool and this tool and this tool.
8:15
You just say, do this thing, and it'll figure out how to do
8:17
it.
8:17
It'll string it together in the right way.
8:19
That makes sense for quad code.
8:20
There's a lot of ways to use this.
8:26
Something I like to do sometimes is before having
8:30
quad jump in to write code, I'll ask it to brainstorm a
8:33
little bit or make a plan.
8:35
This is something we highly recommend.
8:37
And something I see sometimes is people, they take quad code
8:39
and they ask it, hey, implement this enormous 3,000
8:43
wine feature.
8:45
And sometimes it gets this right on the first shot.
8:47
But sometimes what happens is the thing that it builds is
8:49
not at all the thing that you want it.
8:51
And the easiest way to get the result you want is ask it to
8:55
think first.
8:56
So brainstorm ideas.
8:57
Make a plan, run it by me.
8:58
Ask for approval before you write code.
9:01
And you don't have to use plan mode.
9:03
You don't have to use any special tools to do this.
9:05
All you have to do is ask Claude.
9:06
And it'll know to do this.
9:07
So just say, before you write code, make a plan.
9:10
That's it.
9:13
This is also-- I want to think with this one, this commit
9:15
push figure.
9:15
This is a really common incantation that I use.
9:18
There's nothing special about it, but Claude is kind of
9:20
smart enough to interpret this.
9:21
So it'll make a commit.
9:22
It'll push it to the branch, make a branch, and then make
9:23
a pull request from me on GitHub.
9:25
You don't have to explain anything.
9:26
It'll look through the code.
9:27
It'll look through the history.
9:29
It'll look through the Git log by itself to figure out the
9:30
commit format and all of the stuff.
9:32
And it'll make the commit and push it the right way.
9:36
Again, we're not system prompting to do this.
9:39
It just knows how to do this.
9:40
The model is good.
9:41
As you get a little bit more advanced, you're going to want
9:46
to start to plug in your team's tools.
9:48
And this is where Claude code starts to really shine.
9:51
And there's generally two kinds of tools.
9:53
So one is bash tools.
9:54
And an example of this, I just made up this, like, burly
9:57
CLI.
9:57
This isn't a real thing.
9:59
But you can say, use the CLI to do something.
10:01
And you can tell Claude code about this.
10:02
And you can tell it to use, for example, dash, dash help
10:06
to figure out how to use it.
10:07
And this is efficient.
10:09
If you friend yourself using it a lot, you can also dump
10:11
this into your Claude MD, which we'll talk about in a bit.
10:13
So Claude can remember this across sessions.
10:15
But this is a common pattern we follow at on-profit, and we
10:18
see external customers use too.
10:21
And same thing with MCP.
10:23
Claude code can use bash tools.
10:24
It can use MCP tools.
10:25
So just tell it about the tools.
10:27
And you can add the MCP tool.
10:29
And you can tell it how to use it.
10:30
And it'll just start using it.
10:33
And this is extremely powerful, because when you start to use
10:36
code on a new code base, you can just give it all of your
10:39
tools.
10:40
All the tools your team already uses for this code base.
10:43
And Claude code can use it on your behalf.
10:45
There's a few common workflows.
10:53
And this is the one that I talked about already.
10:55
So kind of do a little bit of exploration, do a little bit
10:57
of planning, and ask me for confirmation before you start
11:01
to write code.
11:02
These other tools on the right are extremely powerful.
11:05
When Claude has some way to check its work--
11:07
so for example, by writing unit tests, or screenshotting
11:11
in puppeteer, or screenshotting the iOS simulator--
11:14
then it can iterate.
11:16
And this is incredible, because if you give it, for
11:18
example, a mock, and you say, build this web UI, it'll
11:20
get it pretty good.
11:22
But if you iterate two or three times, often it gets it
11:25
almost perfect.
11:26
So the trick is give it some sort of tool that it can use
11:29
for feedback to check its work.
11:31
And then based on that, it will iterate by itself, and you're
11:33
going to get a much better result.
11:35
So whatever your domain is, if it's unit test, or
11:37
integration test, or screenshots, or apps, or web, or
11:40
anything, just give it a way to see its result, and it'll
11:43
iterate and get better.
11:44
So these are the next steps.
11:50
Teach Claude how to use your tools, and figure out the
11:52
right work flow.
11:53
If you want Claude to jump in a code, if you want it to
11:55
rinse from a little bit, make a plan, if you want it to
11:57
iterate, kind of have some sense of that.
11:59
So you know how to prompt Claude to do what you want.
12:02
As you go deeper, beyond tools, you want to start to give
12:09
Claude more context.
12:10
And the more context, the smarter the decisions will be,
12:12
because as an engineer working in a code base, you have a
12:14
ton of context in your head about your systems, and all
12:17
the history, and everything else.
12:19
So there's different ways to give this to Claude.
12:22
And as you give Claude more context, it'll do better.
12:25
There's different ways to do this.
12:27
The simplest one is what we call Claude MD.
12:30
And Claude.md is the special file name.
12:33
The simplest place to put it is in the project root.
12:36
So the same director, you start Claude in.
12:38
Put a Claude MD in there.
12:40
And that'll get automatically read into context at the
12:42
start of every session.
12:43
And essentially, the first user turn will include the
12:45
Claude MD.
12:48
You can also have a local Claude MD, and this one, you
12:52
don't usually check into source control.
12:53
So Claude MD, you should check into source control, share
12:56
with your team so that you can write it once and share it
12:58
with your team.
13:00
This one, you don't check in.
13:01
It's just for you.
13:03
The kinds of things you put in Claude MD, it's like
13:05
common bash commands, common MCP tools, architectural
13:09
decisions, important files, anything that you would kind
13:12
of typically need to know in order to work in this code
13:14
base.
13:15
Try to keep it pretty short, because if it gets too long,
13:18
it's just going to use up a bunch of context.
13:20
And it's usually not that useful.
13:21
So just try to keep it as short as you can.
13:23
And for example, in our code base, we have common bash
13:27
commands, we have a style guide, we have a few core files,
13:30
kind of things like that.
13:32
All the other Claude MDs, you can put them in other
13:34
nested child directories, and Claude will pull them in on
13:37
demand.
13:39
So these are the Claude MDs that will get pulled in
13:41
automatically.
13:42
But then also, you can put in Claude MDs in nested
13:45
directories, and those will get automatically pulled when
13:48
Claude works in those directories.
13:51
And of course, if you're a company, maybe you want a
13:54
Claude MD that's shared across all the different code
13:56
bases, and you want to manage it on behalf of your users,
13:58
and you can put it in your enterprise route, and that
14:00
will get pulled in automatically.
14:01
There's a ton of ways to pull in context.
14:07
I actually had a lot of trouble putting this fight
14:09
together, just to communicate the breadth of ways you can do
14:11
this.
14:12
But Claude MD is pulled in automatically.
14:15
You can also use flash commands.
14:16
So this is dot Claude's flash commands.
14:18
And this can be in your home directory, or it can be checked
14:21
into your project.
14:21
And this is for flash commands.
14:24
And over here, we have a few examples of the flash commands
14:29
that we have in Claude code itself.
14:31
And so for example, if you're in the Claude code repo and
14:34
you see issues getting labeled, that's actually this
14:37
workflow running here.
14:38
It's labeled GitHub Issues.
14:40
And we have a GitHub action running, the same one we
14:42
talked about this morning, where Claude code will run this
14:46
command, and it's just a splash command.
14:47
It'll run, and it'll label the issues, so humans don't
14:50
have to.
14:50
It just saves us a bunch of time.
14:53
And of course, you can add mention files to pull them into
14:55
context.
14:56
And like I said before, Claude MD is in a nested directory,
14:59
get pulled in when Claude works in that directory.
15:01
So give Claude more context.
15:08
And it's definitely worth taking the time to tune context.
15:11
You can run it through a prompt improver.
15:12
Consider who the context is for.
15:15
If you want to pull it in every time, if you want to pull
15:17
it in on demand, if you want to share it with a team, if it's
15:20
a personal preference, definitely take the time to tune
15:22
it.
15:22
This will improve performance dramatically if you do it
15:25
right.
15:25
As you get more advanced, you're going to want to think
15:33
about this a little bit more of this kind of hierarchy of
15:35
different ways to pull in everything.
15:36
So like not just Claude MD, but also config and kind of
15:42
everything about Claude, you can pull in in this
15:43
hierarchical way.
15:45
So projects are specific to your Git repo, and this you can
15:48
check in, or you can make it just for you.
15:51
You can also have global configs that are across all your
15:53
projects, or you can have enterprise policies.
15:56
And this is essentially a global config that you roll out
15:58
for all of your employees, everyone on your team
16:00
automatically.
16:02
And this slide is like pretty information dense, but the
16:05
point is this applies to a lot of stuff.
16:07
So you can do this for slash commands.
16:08
You can do it for permissions.
16:10
So for example, if you have a batch command that you would
16:12
run for all your employees, like all your employees use
16:15
this like test command, for example.
16:17
You can actually just check it into this enterprise
16:19
policies file.
16:21
And then any employee, when they run this command, it will
16:23
be auto approved, which is pretty convenient.
16:26
And you can also use this to block commands.
16:27
So for example, let's say there's a URL that should never
16:29
be fetched.
16:31
Just add it to this config.
16:32
And that'll make it so an employee cannot override it.
16:35
And that URL can never be fetched.
16:38
So pretty convenient both to unblock people and also just
16:40
to keep your code base safe.
16:43
And then same thing for MCP servers.
16:45
Have a MCP JSON file, check it into the code base.
16:47
That way, anytime someone runs quad code in your code base,
16:50
they'll be prompted to install the MCP servers and share it
16:53
with the team.
16:54
If you're not sure which of these to use, this is like a
17:00
kind of an insane matrix.
17:01
Because we support a lot of stuff.
17:03
And engineer workflows are very flexible.
17:04
And every company is different.
17:05
So we kind of want to support everything.
17:07
So if you're not sure how to get started, I would recommend
17:09
start with shared project context.
17:12
You write this once.
17:13
And then you share it with everyone on the team.
17:14
And you get this kind of network effect where someone does a
17:17
little bit of work and everyone on the team benefits.
17:19
There's a lot of tools built into Quad to manage this.
17:26
So as an example, if you run /memory, you can see all the
17:29
different memory files that are getting pulled in.
17:31
So maybe I have an enterprise policy.
17:33
I have my user memory.
17:34
I have project quad MD.
17:36
And then maybe there's an nested quad MD.
17:38
That's only pulled in for certain directories.
17:42
And then similarly, when you do /memory, you can edit
17:45
particular memory files.
17:46
When you type pound sign to remember something, you can
17:48
pick which memory you want it to go to.
17:49
So yeah, that's the next step.
17:55
Take the time to configure Quad MD, MCP servers, all the
18:00
stuff that your team uses, so that you can use it once,
18:02
configure it once, and then share it with everyone.
18:05
An example of this is in our apps repo for anthropic.
18:11
This is the repo that we have all of our web and apps code in.
18:16
There's a puppeteer MCP server, and we share this with the
18:18
team.
18:19
And there's an MCP JSON checked in.
18:21
So any engineer working that repo can use puppeteer in
18:24
order to pilot and to when test and to screenshot
18:26
automatically and iterate, so that every engineer doesn't
18:28
have to install it themselves.
18:29
This is a talk about pro tips.
18:35
I just want to take a quick interlude to talk about some
18:38
common key bindings that people may not know.
18:40
It's very hard to build for Terminal.
18:41
It's also very fun.
18:43
It feels like rediscovering this new design language.
18:46
But something about Terminal is it's extremely minimal.
18:49
And so sometimes it's hard to discover these key bindings.
18:52
And here's just a quick reference sheet.
18:54
So anytime you can hit Shift+Tab to accept edits, and this
18:58
switches you into auto-accept edits mode.
19:00
So bash commands don't need approval, but edits are
19:02
auto-accepted, and you can always ask Quad to undo them
19:04
later.
19:06
For example, I'll do this if I know Quad's on the right track,
19:09
or if it's writing unit tests and iterating on tests, I'll
19:11
usually just switch into auto-accept mode.
19:13
So I don't have to OK every single edit.
19:17
Any time you want Cloud to remember something, so for
19:19
example, if it's not using a tool correctly and you want it
19:22
to use it correctly from then on, just type the
19:24
pound sign and then tell it what to remember, and it'll
19:26
remember it.
19:26
It'll incorporate it into Quad MD automatically.
19:30
If you ever want to drop down to bash mode, so just run a
19:32
bash command, you can hit the exclamation mark and type
19:35
in your command.
19:35
That'll run locally, but that also goes into the
19:38
context window, so Quad will see it on the next turn.
19:42
And this is pretty good for long running commands, if you
19:44
know exactly what you want to do, or any command that you
19:46
want to get into context.
19:47
And Quad will see the command and the output.
19:51
You can add mention thousand folders.
19:53
Any time you can hit escape to stop what Quad is doing, no
19:57
matter what Quad is doing, you can always see if we hit
19:58
escape.
19:59
It's not going to corrupt the session.
20:00
It's not going to mess anything up.
20:02
So maybe Quad is doing a file edit.
20:04
I'll hit escape.
20:04
I'll tell it what to do differently.
20:06
Or maybe it suggested a 20-line edit, and I'm like, actually,
20:09
19 of these lines look perfect, but one line, you should
20:11
change.
20:12
I'll hit escape.
20:12
I'll tell it that.
20:13
And then I'll tell it to redo that.
20:17
You can hit escape twice to jump back in history.
20:20
And then after you're done with the session, you can start
20:22
Quad with a resume to resume that session, if you want, or
20:25
dash, dash, continue.
20:28
And then any time if you want to see more output, hit
20:30
controller.
20:31
And that'll show you the entire output, the same thing
20:34
that Quad sees in its context window.
20:35
The next thing I want to talk about is the Quadcode SDK.
20:44
So we talked about this at the top.
20:46
Right after this, say it is doing a session, I think, just
20:49
across the hallway.
20:50
And he's going to go super deep on the SDK.
20:52
If you hadn't played around with this, if you used the
20:55
dash P flag in Quad, this is what the SDK is.
20:58
And we've been winning a bunch of features over the last
21:00
few weeks to make it even better.
21:03
So yeah, you can build on top of this.
21:05
You can do cool stuff.
21:06
This is exactly the thing that Quadcode uses.
21:08
It's exactly the same SDK.
21:11
And so for example, something you can do is Quad dash P.
21:13
So this is the CLI SDK.
21:15
You can pass a prompt.
21:18
You can pass some allowed tools, which could include
21:20
specific bash commands.
21:22
And you can tell it which format you want.
21:24
So you might want JSON, or you might want streaming JSON,
21:27
if you want to process this somehow.
21:29
So this is awesome for building on.
21:31
We use this in CI all the time, we use this for incident
21:34
response, we use this in all sorts of pipelines.
21:37
So really convenient.
21:38
Just think of it as a Unix utility.
21:39
You give it a prompt, it gives you JSON.
21:41
You can use this in any way.
21:42
You can pipe into it, you can pipe out of it.
21:44
The piping is also pretty cool.
21:50
So you can use, for example, Git status and pipe this in,
21:53
and use JQ to select the result.
21:56
The combinations are endless.
21:58
And it's sort of this new idea.
21:59
It's like a super intelligent Unix utility.
22:02
And I think we barely scratched the surface of how to use this.
22:04
We're just figuring this out.
22:07
You can read from a GCP bucket, read a giant log and pipe it
22:11
in and tell Cloud to figure out what's
22:12
interesting about this log.
22:14
You can fetch data from the century CLI.
22:18
You can also pipe it in and have Cloud do something good.
22:20
The final thing, and this is probably the most advanced
22:29
use case as we see, I'm sort of a quad normy.
22:31
So I'll have usually one quad running at a time.
22:34
And maybe I'll have a few terminal tabs
22:36
for a few different repos running at a time.
22:38
When I look at power users in and out of enthropic,
22:41
almost always they're going to have SSH sessions.
22:44
They'll have Tmux tunnels into their quad sessions.
22:47
They're going to have a bunch of checkouts of the same repo
22:50
so that they can run a bunch of quads in parallel in that repo.
22:53
Or they're using Git work trees to have some kind of isolation
22:55
as they do this.
22:56
And we're actively working on making this easier to use.
22:59
But for now, these are some ideas for how
23:03
to do more work in parallel with Cloud.
23:05
You can run as many sessions as you want.
23:08
And there's a lot that you can get done in parallel.
23:10
So yeah, that's it.
23:14
I wanted to also leave some time for Q&A.
23:17
So I think this is the last slide that I have.
23:19
And yeah, if folks have questions,
23:21
there's mics on both sides.
23:23
And yeah, we'd love to answer any questions.
23:27
[APPLAUSE]
23:31
I did.
23:42
Hey, Boris.
23:50
Thanks for building Cloud Code.
23:51
And I was wondering what was the hardest implementation,
23:54
like part of the implementation for you, of building it?
23:59
I think there's a lot of tricky parts.
24:03
I think one part that is especially tricky
24:06
is the things that we do to make bash commands safe.
24:10
Bash is inherently pretty dangerous.
24:11
And it can change system state in unexpected ways.
24:14
But at the same time, if you have to manually
24:18
approve every single bash command,
24:20
it's super annoying as an engineer.
24:21
And you can't really be productive,
24:23
because you're just constantly proving every command.
24:25
And just kind of navigating how to do this safely
24:28
in a way that scales across the different kinds of code
24:30
bases people have, because not everyone
24:32
runs their code in a Docker container was pretty tricky.
24:35
And essentially, the thing we landed on
24:37
is there's some commands that are read-only.
24:39
There's some static analysis that we
24:40
do in order to figure out which commands can be combined
24:43
in safe ways.
24:44
And then we have this pretty complex tiered permission
24:47
system so that you can allow list and blockless commands
24:49
at different levels.
24:53
Hi, Boris.
24:54
You mentioned giving an image to Cloud Code,
24:57
which made me wonder if there's some sort of multimodal
25:00
functionality that I'm not aware of.
25:02
Is that-- are you just pointing it out
25:03
in the image on the file system or something?
25:05
Yeah, so Cloud Code is fully multimodal.
25:08
It has been from the start.
25:09
It's in a terminal, so it's a little hard to discover.
25:12
But yeah, you can take an image and just drag and drop it in.
25:15
That'll work.
25:16
You can give it a file path that'll work.
25:18
You can copy and paste the image in, and that works, too.
25:23
So I'll use this pretty often for if I have a mock of something.
25:26
I'll just drag and drop in the mock.
25:28
I'll tell it to implement it.
25:29
I'll give it up a tier server so it can iterate against it.
25:32
And yeah, it's just fully automated.
25:33
Hey, why did you build a CLI tool instead of an IDE?
25:43
Yeah, it's a good question.
25:44
I think there's probably two reasons.
25:45
One is we started this ad entropic.
25:48
And ad entropic people use a broad range of IDs.
25:51
And some people use VS Code, other people use said, or Xcode, or Vim, or Emacs.
25:58
And it was just hard to build something that works for everyone.
26:00
And so terminal is just a common denominator.
26:03
The second thing is ad entropic, we see up close how fast the model is getting
26:10
better.
26:10
And so I think there's a good chance that by the end of the year,
26:13
people aren't using IDs anymore.
26:15
And so we want to get ready for this future.
26:17
And we want to avoid over-investing in UI and other layers on top,
26:21
given that the way the models are progressing,
26:24
it may not be useful work pretty soon.
26:26
Yeah.
26:32
How much have you-- I don't know if this is on.
26:35
How much have you used Cloud Code for machine learning modeling?
26:39
And almost that AutoML experience.
26:40
I was curious what the experience has been so far with that.
26:44
Yeah, I think the question was, how much are we using Cloud Code for machine
26:48
learning and modeling?
26:50
We actually use it for this a bunch.
26:51
So both engineers and researchers at anthropic use Cloud Code every day.
26:56
I think about 80% of people at anthropic that are technical use Cloud Code
27:00
every day.
27:01
And hopefully you can see that in the product and the kind of the amount of
27:04
love
27:04
and dog fooding we've put into it.
27:06
But this includes researchers who use tools like the notebook tool to edit and
27:10
run notebooks.
27:12
OK, very cool.
27:13
Thank you.
27:16
All right, I think that's it.
27:17
Thanks.
27:18
[APPLAUSE]
27:20
[MUSIC PLAYING]
27:48
[MUSIC PLAYING]
Reply