Clipping 视频号

同步助手_2026-04-19

by Unknown 原文 ↗
Created: 2026-06-14

**作者:**Boris Cherny (Anthropic 成员, Claude Code 创始人)

1. 介绍与背景

Boris Cherny,Anthropic 成员,创建了 Claude Code。他分享了非常实用的使用技巧,不涉及历史或理论。

Boris Cherny, an Anthropic member, created Claude Code. He shares very practical tips, not history or theory.

Boris Cherny 介绍 Claude Code

Boris Cherny 介绍 Claude Code

如果你还未使用过 Claude Code,可以在安装了 Node.js 的终端中打开它,安装命令已提供。

If you haven’t used Claude Code yet, you can open it in a terminal with Node.js installed. The installation command is provided.

终端安装 Claude Code 命令

终端安装 Claude Code 命令

Claude Code 是新一代 AI 助手,具有全代理能力,可以构建功能、编写整个函数或文件、修复整个 bug。

Claude Code is a new generation AI assistant, fully agentic, capable of building features, writing entire functions/files, and fixing entire bugs.

Claude Code 全代理能力演示

Claude Code 全代理能力演示

它兼容所有 IDE 和终端(包括本地、远程 SSH、Tmux),无需改变你现有的工作流。

It works with all IDEs and terminals (local, remote SSH, Tmux) without changing your existing workflow.

Claude Code 兼容各种终端环境

Claude Code 兼容各种终端环境

通用目的,首次使用只需打开提示栏,自由发挥即可。

It’s general-purpose; just open the prompt bar and experiment freely.

2. 初始设置

运行 terminal setup 启用 Shift+Enter 换行;使用 /theme 设置主题(含色盲模式);使用 /install GitHub app 安装 GitHub 应用。

Run terminal setup to enable Shift+Enter for newlines; use /theme to set theme (including colorblind mode); use /install GitHub app to install the GitHub app.

初始设置命令展示

初始设置命令展示

自定义允许的工具集,避免每次确认提示。在 Mac 系统设置中启用语音听写,双击听写键直接说话输入,就像与工程师交流一样。

Customize the allowed toolset to avoid repeated confirmation prompts. Enable voice dictation in Mac system settings; double-press the dictation key to speak input, like talking to an engineer.

自定义工具集和语音听写设置

自定义工具集和语音听写设置

3. 基础用法:代码库问答

最推荐从 CodeBase Q&A 开始,直接向代码库提问。Anthropic 新员工培训第一天即用 Claude Code 问答,过去需 2-3 周,现在仅需 2-3 天。

Most recommended: start with CodeBase Q&A by asking questions directly to the codebase. Anthropic’s new hire training uses Claude Code Q&A from day one; previously took 2-3 weeks, now only 2-3 days.

CodeBase Q&A 示例

CodeBase Q&A 示例

无需索引,代码不上传,不训练模型,无需任何设置即可使用。

No indexing, code is not uploaded, models are not trained, and no setup is needed.

你可以问“这段代码怎么用”或“如何实例化某类”,Claude Code 会深入查找实例和使用方式,给出比文档更深入的答案。

You can ask “How to use this code?” or “How to instantiate a class?” and Claude Code will deeply search for examples and usage, providing answers beyond documentation.

深入代码库查找实例

深入代码库查找实例

4. 查看 Git 历史与 Issues

常用技巧:询问 git 历史,例如“这个函数为什么有 15 个参数”“参数名为什么奇怪”,Claude Code 自动查看 git 历史、谁引入、关联 issue 并总结。

A common trick: ask about git history, e.g., “Why does this function have 15 parameters?” or “Why are the parameter names weird?” Claude Code automatically checks git history, who introduced it, linked issues, and summarizes.

查询 git 历史示例

查询 git 历史示例

只需说“查看 git 历史”,模型自己知道怎么做(不是系统提示,是模型本身的能力)。

Just say “View git history”, the model knows what to do (not a system prompt, but the model’s own capability).

可以问 GitHub issues:使用 webfetch 获取 issue 上下文。每周一用“我这周发布了什么”,Claude Code 查看 git 日志按用户名汇总,直接复制粘贴到文档。

You can ask about GitHub issues: use webfetch to get issue context. Every Monday, ask “What did I ship this week?” and Claude Code checks git log, summarizes by user, ready to copy-paste into docs.

查询 GitHub issues 和周报

查询 GitHub issues 和周报

5. 团队上手建议

团队上手建议:从代码库 Q&A 开始,不要一开始编辑代码。提问能帮人学会如何提示,理解 Claude Code 的能力边界(一次完成、多次交互、需要 REPL 交互模式等)。

Onboarding advice for teams: start with codebase Q&A, don’t start editing code right away. Asking questions helps people learn how to prompt and understand Claude Code’s capability boundaries (single pass, multi-turn, REPL mode, etc.).

Q&A 熟练后进入编辑代码阶段。

Once comfortable with Q&A, move to editing code.

从 Q&A 过渡到编辑代码

从 Q&A 过渡到编辑代码

6. 编辑代码与工具集

工具集很小:编辑文件、运行 bash、搜索文件。Claude Code 自动组合这些工具探索代码、构思并最终修改,无需指定具体工具。

The toolset is small: edit files, run bash, search files. Claude Code automatically combines them to explore code, plan, and make changes—no need to specify tools manually.

推荐先让 Claude 脑暴或做计划,再写代码。避免直接要求实现 3000 行的大功能,先让模型思考、生成计划、获得批准再写代码。

Recommended: let Claude brainstorm or plan first before writing code. Avoid asking for a 3000-line feature directly; first let the model think, generate a plan, get approval, then write code.

脑暴和计划模式

脑暴和计划模式

只需说“写代码前先做计划”即可。

Just say “Plan before writing code.”

常用命令“commit push PR”:自动提交、推送、创建 Pull Request,无需解释格式,模型自行查看代码和 git 日志。

Common command “commit push PR”: automatically commits, pushes, and creates a pull request without needing to explain the format; the model checks the code and git log itself.

自动 commit push PR

自动 commit push PR

7. 高级工作流:计划、迭代、自动检查

进阶用法:接入团队工具,通常有两种类型。Bash 工具:可直接让 Claude Code 使用 CLI 命令,通过 --help 学习用法,高效。

Advanced usage: integrate team tools, usually two types. Bash tools: directly let Claude Code use CLI commands, learn usage via --help, very efficient.

高频使用的命令可存入 Claude.md,跨会话记忆,这是 Anthropic 内部及外部客户的常见模式。MCP 工具同理:告诉 Claude 工具及其用法,它就会自动调用。

Frequently used commands can be stored in Claude.md for cross-session memory—a common pattern at Anthropic and for external customers. Same for MCP tools: tell Claude about a tool and its usage, it will invoke it automatically.

Claude.md 存放常用命令

Claude.md 存放常用命令

新代码库中,把团队已有的所有工具交给 Claude,它就能替你使用,极其强大。

In a new codebase, give Claude all the tools your team already has, and it will use them for you—extremely powerful.

常见工作流:先少量探索和规划,请求确认后再开始写代码。更强大的工作流:让 Claude 有办法检查自己的工作,例如写单元测试、用 Puppeteer 截图或 iOS 模拟器截图,它就能迭代。

Common workflow: a little exploration and planning, ask for confirmation, then start coding. More powerful: give Claude a way to check its own work, such as writing unit tests, taking screenshots with Puppeteer or iOS simulator, and it will iterate.

自动检查迭代工作流

自动检查迭代工作流

给一个 mock 和构建 UI 的任务,Claude 一次做得不错;迭代两三次后几乎完美。关键是提供反馈工具让它自行迭代。

Given a mock and a task to build UI, Claude does well in one pass; after two or three iterations it’s nearly perfect. The key is providing feedback tools for self-iteration.

无论领域(单元测试、集成测试、应用或网页截图),给 Claude 看到结果的方式,它就能迭代改进。

Regardless of domain (unit tests, integration tests, app or web screenshots), give Claude a way to see results, and it will iterate and improve.

8. 上下文管理:Claude.md

接下来:教会 Claude 使用你的工具,确定合适的工作流(头脑风暴、做计划、迭代),从而知道如何提示它。

Next: teach Claude to use your tools, determine suitable workflows (brainstorming, planning, iteration), so you know how to prompt it.

深入后,要给 Claude 更多上下文。工程师脑中有大量系统上下文和历史,可用不同方式交给 Claude。

Going deeper, you need to give Claude more context. Engineers have a lot of system context and history in their heads; deliver it to Claude in different ways.

上下文管理概念

上下文管理概念

最简单的方式:Claude.md 文件。放在项目根目录,每次会话自动读入作为首轮用户输入。本地 Claude.md 不纳入版本控制,用于个人配置;项目 Claude.md 应纳入版本控制,团队共享。

Simplest way: the Claude.md file. Place it in the project root; it’s automatically read as the first user input in each session. Local Claude.md is not versioned (personal config); project Claude.md should be versioned for team sharing.

Claude.md 内容:常见 bash 命令、MCP 工具、架构决策、重要文件等,尽量简短以免占用上下文。

Content of Claude.md: common bash commands, MCP tools, architecture decisions, important files, etc. Keep it brief to avoid consuming context.

可嵌套子目录中的 Claude.md,Claude 在处理该目录时自动拉取。企业级可在根目录放共享 Claude.md,统一管理。

You can nest Claude.md files in subdirectories; Claude automatically pulls them when working in that directory. Enterprise level: place a shared Claude.md in the root for unified management.

9. 斜杠命令与内存

其他上下文拉取方式:.claude/slash_commands(放在用户主目录或项目中),用于定义斜杠命令。Claude Code 自身也用斜杠命令,例如在仓库中运行工作流标记 GitHub Issues,通过 GitHub Action 执行。

Other context retrieval: .claude/slash_commands (placed in home directory or project) for defining slash commands. Claude Code itself uses slash commands, e.g., running workflows to label GitHub Issues via GitHub Actions.

斜杠命令配置

斜杠命令配置

自动标记议题可节省人工时间。可通过提及文件将其拉入上下文。

Auto-labeling issues saves manual time. You can also pull files into context by mentioning them.

嵌套目录中的 Claude.md 会在 Claude 工作于该目录时自动被拉入。为 Claude 提供更多上下文,值得花时间调优。

Nested Claude.md files are automatically pulled when Claude works in that directory. It’s worth investing time to optimize context for Claude.

嵌套 Claude.md 自动拉取

嵌套 Claude.md 自动拉取

通过提示改进器运行,考虑上下文面向谁、是否每次都拉入、按需拉入、团队共享还是个人偏好。花时间调优上下文会显著提升性能。

Run through the prompt improver, consider the audience, whether to always pull in, on-demand, team-shared or personal. Investing in context tuning dramatically improves performance.

高级用法:考虑分层拉入不同方式。不仅仅是 Claude.md,还包括配置等,可以分层拉入。项目配置特定于 Git 仓库,可检入或仅用于自己。全局配置可跨所有项目,企业策略是全局配置自动应用于所有员工。

Advanced: consider layered retrieval. Not just Claude.md but also configs, layered. Project configs are per-Git-repo, can be checked in or personal. Global configs apply across all projects; enterprise policy is a global config that automatically applies to all employees.

分层配置示意图

分层配置示意图

这些配置适用于斜杠命令、权限等。例如:常用 bash 命令可检入企业策略文件,运行时会自动批准。所有员工使用的测试命令检入后自动批准。也可用此配置阻止命令,例如禁止获取某个 URL。添加到配置后员工无法覆盖,该 URL 永远无法获取。

These configs apply to slash commands, permissions, etc. For example: common bash commands can be checked into the enterprise policy file for auto-approval. Test commands used by all employees get auto-approved. You can also block commands, e.g., disallow fetching a certain URL. Once added, employees cannot override it; that URL is permanently blocked.

既方便团队也保障代码库安全。同样适用于 MCP 服务器:将 MCP JSON 文件检入代码库。任何人运行 Claude Code 时会提示安装 MCP 服务器并共享给团队。

This benefits both team convenience and codebase safety. Same applies to MCP servers: check in the MCP JSON file to the codebase. Anyone running Claude Code will be prompted to install the MCP server and share it with the team.

MCP 服务器配置检入

MCP 服务器配置检入

不确定用哪种时,推荐从共享项目上下文开始。写一次然后共享给团队,产生网络效应。

If unsure, start with shared project context. Write once and share with the team, creating network effects.

Claude 内置工具管理这些,运行 “/memory” 可看到所有被拉入的内存文件。包括企业策略、用户内存、项目 Claude.md、嵌套 Claude.md 等。通过 “/memory” 可编辑特定内存文件,输入 “#” 记住东西时选择存入哪个内存。

Claude has built-in tools to manage these: run “/memory” to see all pulled-in memory files, including enterprise policies, user memory, project Claude.md, nested Claude.md, etc. Via “/memory” you can edit specific memory files; when typing ”#” to remember something, choose which memory to save it to.

/memory 命令查看内存文件

/memory 命令查看内存文件

花时间配置 Claude.md、MCP 服务器等,配置一次然后共享。

Invest time in configuring Claude.md, MCP servers, etc. Configure once and share.

例子:Anthropic 应用仓库中检入 puppeteer MCP JSON,工程师无需自己安装即可使用端到端测试和截图。

Example: Anthropic’s application repo checks in a puppeteer MCP JSON, so engineers can use end-to-end testing and screenshots without manual installation.

10. 快捷键与 Bash 模式

快捷键:Shift+Tab 接受编辑,进入自动接受编辑模式(bash 命令仍需批准,编辑自动接受,可让 Claude 稍后撤销)。写单元测试迭代时常用自动接受模式。

Shortcuts: Shift+Tab to accept edit, entering auto-accept edit mode (bash commands still require approval, edits are auto-accepted, and you can ask Claude to revert later). Often used when iterating on unit tests.

Shift+Tab 自动接受编辑

Shift+Tab 自动接受编辑

输入“#”告诉 Claude 记住某件事,自动融入 Claude.md。

Typing ”#” tells Claude to remember something, automatically merging it into Claude.md.

输入“!”进入 bash 模式运行本地命令,该命令进入上下文窗口,Claude 后续会看到;适用于长时间运行命令或想让命令进入上下文的情况。

Typing ”!” enters bash mode to run a local command; the command enters the context window and Claude will see it later. Useful for long-running commands or when you want the command in context.

Bash 模式感叹号命令

Bash 模式感叹号命令

Claude 会看到命令和输出,可以提及文件和文件夹,按 Escape 可安全停止操作,不会破坏会话。可以中断 Claude 正在做的编辑,告诉它修改,然后重新执行。按两次 Escape 跳回历史。

Claude sees the command and output; you can mention files and folders. Press Escape to safely stop the operation without corrupting the session. You can interrupt Claude’s ongoing edit, tell it to modify, then re-execute. Press Escape twice to go back in history.

使用 --resume--continue 恢复会话。按 Control R 显示完整输出,与 Claude 上下文窗口看到的一致。

Use --resume or --continue to resume a session. Press Control R to show the full output, same as what Claude sees in its context window.

11. SDK 与并行使用

介绍 Claude Code SDK,与 CLI 的 -dash P 标志相同。可基于 SDK 构建应用,示例:cloud -p [提示] [允许的工具] 指定格式(JSON 或流式 JSON)。用于 CI、事件响应、管道,像 Unix 实用工具,可管道输入输出。

Introducing the Claude Code SDK, same as the -dash P flag in CLI. Build applications on top of the SDK, example: cloud -p [prompt] [allowed tools] specifying format (JSON or streaming JSON). Used for CI, incident response, pipelines, like a Unix utility with pipes.

Claude Code SDK 示例

Claude Code SDK 示例

管道输入输出示例:git status | cloud -p ... | jq

Pipe example: git status | cloud -p ... | jq.

可从 GCP 桶、Sentry 等管道输入日志,让 Claude 分析。高级用法:并行运行多个 Claude 会话,使用 SSH、Tmux、Git work trees 隔离。可以同时运行多个会话并行工作。

Pipe logs from GCP buckets, Sentry, etc., for Claude to analyze. Advanced: run multiple Claude sessions in parallel using SSH, Tmux, Git work trees for isolation. Run multiple sessions simultaneously.

并行运行多个 Claude 会话

并行运行多个 Claude 会话

12. 安全机制

问答:最难实现部分是让 bash 命令安全,避免手动批准每个命令,设计了只读命令分类、静态分析、层级权限系统。

Q&A: The hardest part was making bash commands safe—avoiding manual approval for every command. They designed read-only command classification, static analysis, and a tiered permission system.

安全机制层级权限

安全机制层级权限

13. 多模态支持

问题:是否有多模态功能(给图片)?Claude Code 完全支持多模态,可在终端中直接拖拽图片、粘贴图片或传入文件路径来实现设计稿。

Question: Does it support multimodal (images)? Claude Code fully supports multimodal; you can drag and drop images, paste images, or pass file paths directly in the terminal for design mockups.

多模态拖拽图片

多模态拖拽图片

常用做法:将设计稿拖入终端,让 Claude Code 实现,配合测试服务器进行迭代,整个过程全自动。

Common practice: drag a design mockup into the terminal, let Claude Code implement it, iterate with a test server—fully automated.

14. 为何选择 CLI 及内部使用

选择 CLI 而非 IDE 有两个原因:一是 Anthropic 内部使用多种 IDE(VS Code、Zed、Xcode、Vim、Emacs 等),终端是共同分母,易于覆盖所有人。

Two reasons for choosing CLI over IDE: First, Anthropic internally uses many IDEs (VS Code, Zed, Xcode, Vim, Emacs, etc.), the terminal is the common denominator, easy to cover everyone.

二是模型进步极快,预计到年底用户可能不再需要 IDE,因此避免在 UI 层面过度投资,提前适应未来趋势。

Second, the model is improving so fast that by the end of the year users may not need an IDE anymore, so they avoid over-investing in UI and adapt to future trends early.

CLI 选择原因及内部使用统计

CLI 选择原因及内部使用统计

Anthropic 约 80% 的技术人员每天使用 Claude Code,包括研究人员使用 notebook 工具编辑和运行 Jupyter 笔记本,用于机器学习建模和 AutoML 体验。

About 80% of Anthropic’s technical staff use Claude Code daily, including researchers using the notebook tool to edit and run Jupyter notebooks for ML modeling and AutoML experience.

逐字稿

00:00 Hello.

00:07 Hey everyone.

00:09 I’m Boris.

00:10 I’m a member of technical staff here at Anthropic.

00:13 And I created Claude Code.

00:15 And here to talk to you a little bit about some practical tips and tricks for using Claude Code.

00:20 It’s going to be very practical.

00:22 I’m not going to go too much into the history or the theory or anything like this.

00:26 And before we start, can we get a quick show of hands, who has used Claude Code before?

00:33 Yeah.

00:34 That’s what we like to see.

00:36 For everyone that didn’t raise your hands, I know you’re not supposed to do this while

00:40 people are talking, but if you can open your laptop and type this.

00:44 And this will help you install Claude Code just so you can follow along for the rest of the talk.

00:56 All you need is Node.js if you have it that should work.

01:03 If you want it to follow along, it’s Claude Code.

01:06 Yeah, you don’t have to follow along, but if you don’t have it yet, this is your chance to install it so you can follow along.

01:13 So what is Claude Code?

01:17 Claude Code is a new kind of AI assistant.

01:21 And there’s been different generations of AI assistants for coding.

01:25 Most of them have been about completing a line at a time, completing a few lines of code at a time.

01:30 Claude Code is not for that.

01:32 It’s fully agentic.

01:33 So it’s meant for building features, for writing entire functions, entire files, fixing entire bugs at the same time.

01:41 And what’s kind of cool about Claude Code is it works with all of your tools.

01:46 And you don’t have to change out your workflow, you don’t have to swap everything to start using it.

01:50 So whatever IDE you use, if you use VS Code or if you use Xcode or if you use JetBrains IDEs,

01:58 there’s some people at Anthropic that you can’t pry them from their cold dead hands, but they use Claude Code.

02:03 Because Claude Code works with every single IDE, every terminal out there.

02:07 It will work locally over remote SSH, over Tmux, whatever environment you’re in, you can run it.

02:14 It’s general purpose, and this is something where if you haven’t used these kind of free form coding assistants in the past,

02:24 it can be kind of hard to figure out how to get started.

02:26 Because you open it up and you just see a prompt bar and you might wonder, like, what do I do with this?

02:30 What do I type in?

02:31 What do I type in?

02:32 It’s a power tool, so you can use it for a lot of things, but also because it can do so much, we don’t try to guide you towards a particular workflow.

02:38 Because really, you should be able to use it however you want as an engineer.

02:43 As you open up Claude Code for the first time, there’s a few things that we recommend doing to get your environment set up.

02:53 And these are pretty straightforward. So run terminal setup, this will give you shift enter for new lines,

02:57 so you don’t have to do backslashes to enter new lines. It makes it a little bit nicer to use.

03:03 Do slash theme to set light mode or dark mode or daltonize themes.

03:08 You can do slash install GitHub app. So today we announced a GitHub app where you can add mention Claude on any GitHub issue or pull request.

03:19 So to install it, just run this command in your terminal.

03:22 You can customize the set of allowed tools that you can use so you’re not prompted for it every time.

03:28 This is pretty convenient. For stuff that I’m prompted about a bunch, I’ll definitely customize it in this way so I don’t have to accept it every time.

03:34 And something that I actually do is for a lot of my prompts, I won’t hand type them into a Claude Code.

03:39 If you’re on Mac OS, you can go into your system settings under accessibility as dictation, and you can enable it.

03:45 And so something I do is you just hit like that dictation key twice, and you can just speak your prompt.

03:51 And it helps a lot to have specific prompts. So this is actually pretty awesome.

03:55 You can just talk to Claude Code like you would another engineer, and you don’t have to type a lot of code.

04:00 So when you’re starting out with Claude Code, it’s so freeform and it can do everything.

04:08 What do you start with? The thing I recommend above everything else is starting with CodeBase Q&A.

04:13 So just asking questions to your CodeBase.

04:16 This is something that we teach new hires at Anthropic.

04:19 So on the first day in technical onboarding, you learn about Claude Code, you download it, you get it set up,

04:24 and then you immediately start asking questions about the code base.

04:28 And in the past when you were doing technical onboarding, it’s something that taxes the team a lot.

04:32 You have to ask other engineers on the team questions.

04:36 You have to look around the code, and this takes a while.

04:38 You have to figure out how to use the tools. This takes a long time.

04:41 With Claude Code, you can just ask Claude Code.

04:44 And it’ll explore the code base, it’ll answer these kind of questions.

04:47 And so at Anthropic, onboarding used to take about two or three weeks for technical hires.

04:51 It’s now about two or three days.

04:55 What’s also kind of cool about Q&A is we don’t do any sort of indexing.

04:59 So there’s no remote database with your code.

05:01 We don’t upload it anywhere. Your code stays local.

05:04 We do not train generative models on the code.

05:07 So it’s there. You control it. There’s no indices or anything like this.

05:11 And what that means is also there’s no setup.

05:13 So you start Claude, you download it, you start it, there’s no indexing.

05:16 You don’t have to wait. You can just use it right away.

05:20 This is a technical talk.

05:22 So I’m going to show some very specific prompts and very specific code samples that you can use

05:26 and hopefully improve and up level your Claude Code experience.

05:29 So some kind of questions that you can ask is, you know, like, how is this particular piece of code used?

05:35 Or how do I instantiate this thing?

05:37 And Claude Code, it won’t just do like a text search and try to answer this.

05:39 It’ll often go a level deeper.

05:41 And it’ll try to find examples of how is this class instantiated?

05:44 How is it used?

05:45 And it’ll give you a much deeper answer.

05:47 So something that you would get out of a wiki or documentation.

05:50 Instead of just like command F.

05:52 Something that I do a lot also is ask it about git history.

05:57 So, for example, you know, why does this function have 15 arguments?

06:01 And why are the arguments named this weird way?

06:03 And this is something I bet in all of our code bases you have some function like this or some class like this.

06:08 And Claude Code can look through git history.

06:11 And it’ll look to figure out how did these arguments get introduced and who introduced them and what was the situation?

06:16 What are the issues that those commits linked to?

06:18 And it’ll look through all this and summarize it.

06:20 And you don’t have to tell it that in all this detail.

06:23 You just ask it.

06:24 So just say look through git history and it’ll know to do this.

06:27 The reason it knows, by the way, is not because we prompted it to.

06:30 There’s nothing in the system prompt about looking through git history.

06:33 It knows it because the model is awesome.

06:35 And if you tell it to use git, it’ll know how to use git.

06:38 So we’re lucky to be building on such a good model.

06:41 I often ask about GitHub issues.

06:45 So, you know, it can use web fetch and it can fetch issues and look up context on issues too.

06:50 And this is pretty awesome.

06:52 And this is something that I do every single Monday in our weekly standup is I ask what did I ship this week?

06:59 And Claude Code looks to the log, it knows my username, and it’ll just give me a nice readout of everything I shipped.

07:04 And I’ll just copy and paste that into a document.

07:11 So yeah, that’s tip number one.

07:12 For people that have not used Claude Code before, if you’re just showing it to someone for the first time,

07:16 onboarding your team, the thing we definitely recommend is start with codebase Q&A.

07:20 Don’t start by using fancy tools, don’t start by editing code.

07:23 Just start by asking questions about the codebase.

07:25 And that’ll teach people how to prompt.

07:27 And it’ll start teaching them this boundary of like, what can Claude Code do?

07:30 What is it capable of?

07:31 What do you need to hold its hand with a little bit more?

07:34 What can be one-shotted?

07:35 What can be two-shotted, three-shotted?

07:37 What do you need to use interactive mode for in a REPL?

07:42 Once you’re pretty comfortable with Q&A, you can dive into editing code.

07:46 This is the next thing.

07:48 And the cool thing about any sort of agentic, you know, like using an LM in an agentic way,

07:54 is you give it tools and it’s just like magical.

07:56 It figures out how to use the tools.

07:58 And with Claude Code, we give it a pretty small set of tools.

08:00 It’s not a lot.

08:01 And so it has a tool to edit files.

08:03 It has a tool to run bash commands.

08:05 It has a tool to search files.

08:07 And it’ll string these together to explore the code, brainstorm, and then finally make edits.

08:13 And you don’t have to prompt it specifically to use this tool and this tool and this tool.

08:17 You just say, you know, do this thing and it’ll figure out how to do it.

08:20 It’ll string it together in the right way that makes sense for Claude Code.

08:27 There’s a lot of ways to use this.

08:29 Something I like to do sometimes is before having Claude jump in to write code,

08:34 I’ll ask it to brainstorm a little bit or make a plan.

08:37 This is something we highly recommend and something I see sometimes is people, you know,

08:41 they take Claude Code and they ask it, hey, implement this enormous like 3000 line feature.

08:47 And sometimes it gets this right on the first shot.

08:49 But sometimes what happens is the thing that it builds is not at all the thing that you wanted.

08:53 And the easiest way to get the result you want is ask it to think first.

08:58 So brainstorm ideas, make a plan, run it by me, ask for approval before you write code.

09:03 And you don’t have to use plan mode, you don’t have to use any special tools to do this.

09:07 All you have to do is ask Claude and it’ll know to do this.

09:10 So just say, before you write code, make a plan. That’s it.

09:15 This is also, I want to think with this one, this commit push PR,

09:18 this is a really common incantation that I use.

09:20 There’s nothing special about it, but Claude is kind of smart enough to interpret this.

09:23 So it’ll make a commit, it’ll push it to the branch, make a branch, and then make a pull request from you on GitHub.

09:27 You don’t have to explain anything. It’ll look through the code, it’ll look through the history,

09:31 it’ll look through the Git log by itself to figure out the commit format and all the stuff.

09:35 And it’ll make the commit and push it the right way.

09:39 Again, we’re not system prompting to do this, it just knows how to do this. The model is good.

09:44 As you get a little bit more advanced, you’re going to want to start to plug in your team’s tools.

09:50 And this is where Claude Code starts to really shine.

09:53 And there’s generally two kinds of tools.

09:55 So one is bash tools.

09:56 And an example of this, I just made up this like, barley CLI, this isn’t a real thing.

10:00 But you can say, use the CLI to do something.

10:03 And you can tell Claude Code about this.

10:05 And you can tell it to use, for example, like —help to figure out how to use it.

10:09 And this is efficient.

10:11 If you find yourself using it a lot, you can also dump this into your Claude MD,

10:14 which we’ll talk about in a bit, so Claude can remember this across sessions.

10:17 But this is a common pattern we follow at Anthropic, and we see external customers use too.

10:22 And same thing with MCP.

10:24 Claude Code can use bash tools, it can use MCP tools.

10:27 So, you know, just tell it about the tools and you can add the MCP tool and you can tell it how to use it.

10:32 And it’ll just start using it.

10:35 And this is extremely powerful.

10:37 Because when you start to use code on a new code base, you can just give it all of your tools.

10:42 All the tools your team already uses for this code base.

10:45 And Claude Code can use it on your behalf.

10:52 There’s a few common workflows.

10:55 And this is the one that I talked about already.

10:57 So kind of do a little bit of exploration, do a little bit of planning,

11:00 and ask me for confirmation before you start to write code.

11:04 These other two on the right are extremely powerful.

11:07 When Claude has some way to check its work, so for example by writing unit tests or screenshotting in Puppeteer,

11:13 or screenshotting in the iOS simulator, then it can iterate.

11:17 And this is incredible, because if you give it, for example, a mock, and you say build this web UI,

11:22 it’ll get it pretty good.

11:24 But if you had it iterate two or three times, often it gets it almost perfect.

11:28 So the trick is give it some sort of tool that it can use for feedback to check its work.

11:33 And then based on that, it will iterate by itself, and you’re going to get a much better result.

11:37 So whatever your domain is, if it’s unit tests or integration tests or screenshots for apps or web or anything,

11:43 just give it a way to see its result, and it’ll iterate and get better.

11:50 So these are the next steps.

11:52 Teach Claude how to use your tools and figure out the right workflow.

11:55 If you want Claude to jump in a code, if you want it to brainstorm a little bit, make a plan,

11:59 if you want it to iterate, kind of have some sense of that, so you know how to prompt Claude to do what you want.

12:04 As you go deeper, beyond tools, you want to start to give Claude more context.

12:12 And the more context, the smarter the decisions will be, because as an engineer working in a codebase,

12:16 you have a ton of context in your head about your systems and all the history and everything else.

12:21 So there’s different ways to give this to Claude.

12:23 And as you give Claude more context, it’ll do better.

12:26 There’s different ways to do this.

12:29 The simplest one is what we call Claude.md.

12:31 And Claude.md is the special file name.

12:35 The simplest place to put it is in the project root.

12:38 So the same directory you start Claude in, put a Claude.md in there.

12:42 And that’ll get automatically read into context at the start of every session.

12:45 And essentially the first user turn will include the Claude.md.

12:50 You can also have a local Claude.md.

12:52 And this one you don’t usually check into source control.

12:55 So Claude.md, you should check into source control, share with your team so that you can write it once

13:00 and share it with your team.

13:02 This one you don’t check in.

13:04 It’s just for you.

13:05 The kinds of things you put in Claude.md, it’s like common bash commands, common MCP tools,

13:10 architectural decisions, important files, anything that you would kind of typically need to know in order to work in this codebase.

13:17 Try to keep it pretty short, because if it gets too long it’s just going to use up a bunch of context.

13:21 And it’s usually not that useful.

13:23 So just try to keep it as short as you can.

13:25 And for example in our codebase we have common bash commands, we have a style guide, we have a few core files, kind of things like that.

13:33 All the other Claude.mds you can put them in other nested child directories, and Claude will pull them in on demand.

13:39 So these are the Claude.mds that will get pulled in automatically.

13:43 But then also you can put Claude.md in nested directories and those will get automatically pulled when Claude works in those directories.

13:53 And of course if you’re a company, maybe you want a Claude.md that’s shared across all the different codebases and you want to manage it on behalf of your users,

14:00 you can put it in your enterprise route and that will get pulled in automatically.

14:04 There’s a ton of ways to pull in context. I actually had a lot of trouble putting this slide together just to communicate the breadth of ways you can do this.

14:14 But Claude.md is pulled in automatically.

14:17 You can also use slash commands. So this is .claude slash commands and this can be in your home directory or it can be checked into your project.

14:24 And this is for slash commands.

14:26 And over here we have a few examples of the slash commands that we have in Claude Code itself.

14:33 And so for example if you’re in the Claude Code repo and you see issues getting labeled, that’s actually this workflow running here.

14:40 It’s labeled GitHub issues.

14:42 And we have a GitHub action running, the same one we talked about this morning, where Claude Code will run this command and it’s just a slash command.

14:49 It’ll run and it’ll label the issues so humans don’t have to. It just saves us a bunch of time.

14:54 And of course you can add mention files to pull them into context.

14:58 And like I said before, Claude MDs in a nested directory get pulled in when Claude works in that directory.

15:05 So give Claude more context and it’s definitely worth taking the time to tune context.

15:13 You can run it through a prompt improver, consider who the context is for, if you want to pull it in every time, if you want to pull it in on demand, if you want to share it with a team, if it’s a personal preference.

15:23 Definitely take the time to tune it. This will improve performance dramatically if you do it right.

15:28 As you get more advanced, you’re going to want to think about this a little bit more of this kind of hierarchy of different ways to pull in everything.

15:39 So like not just Claude MD, but also config and kind of everything about Claude you can pull in in this hierarchical way.

15:47 So projects are specific to your Git repo and this you can check in or you can make it just for you.

15:53 You can also have global configs that are across all your projects or you can have enterprise policies.

15:58 And this is essentially a global config that you roll out for all of your employees, everyone on your team automatically.

16:03 And this slide is like pretty information dense, but the point is this applies to a lot of stuff.

16:09 So you can do this for slash commands, you can do it for permissions.

16:12 So for example, if you have a bash command that you would run for all your employees, like all your employees use this like test command for example.

16:19 You can actually just check it into this enterprise policies file and then any employee when they run this command it will be auto approved, which is pretty convenient.

16:28 And you can also use this to block commands.

16:30 So for example, let’s say there’s a URL that should never be fetched.

16:33 Just add it to this config and that’ll make it so an employee cannot override it.

16:38 And that URL can never be fetched.

16:40 So pretty convenient both to unblock people and also just to keep your code base safe.

16:44 And then same thing for MCP servers.

16:47 Have a MCP JSON file, check it into the code base.

16:49 That way anytime someone runs Claude Code in your code base, they’ll be prompted to install the MCP servers and share it with the team.

17:00 If you’re not sure which of these to use, this is like a kind of an insane matrix because we support a lot of stuff and engineer workflows are very flexible and every company is different.

17:08 So we kind of want to support everything.

17:09 So if you’re not sure how to get started, I would recommend start with shared project context.

17:14 You write this once and then you share it with everyone on the team and you get this kind of network effect where, you know, someone does a little bit of work and everyone on the team benefits.

17:21 There’s a lot of tools built into Claude to manage this.

17:27 So as an example, if you run slash memory, you can see all the different memory files that are getting pulled in.

17:33 So maybe I have an enterprise policy, I have my user memory, I have project Claude MD, and then maybe there’s a nested Claude MD that’s only pulled in for certain directories.

17:42 And then similarly when you do slash memory, you can edit particular memory files.

17:48 When you type pound sign to remember something, you can pick which memory you want it to go to.

17:56 So yeah, that’s the next step. Take the time to configure Claude Code, MCP servers, all the stuff that your team uses so that you can use it once, configure it once, and then share it with everyone.

18:07 An example of this is in our apps repo for Anthropic.

18:13 This is like the repo that we have all of our web and apps code in.

18:18 There’s a puppeteer MCP server and we share this with the team.

18:21 And there’s an MCP JSON checked in, so any engineer working in that repo can use puppeteer in order to pilot end-to-end tests and to screenshot automatically and iterate so that every engineer doesn’t have to install it themselves.

18:32 This is a talk about pro tips. I just want to take a quick interlude to talk about some common key bindings that people may not know.

18:42 It’s very hard to build for terminal. It’s also very fun. It feels like rediscovering this new design language.

18:48 But something about terminals, it’s extremely minimal. And so sometimes it’s hard to discover these key bindings.

18:54 Here’s just a quick reference sheet. So anytime you can hit shift tab to accept edits.

19:00 And this switches you into auto-accepted edits mode. So bash commands still need approval, but edits are auto-accepted.

19:05 And you can always ask Claude to undo them later.

19:08 For example, I’ll do this if I know Claude’s on the right track or if it’s writing unit tests and iterating on tests.

19:13 I’ll usually just switch into auto-accept mode. So I don’t have to okay every single edit.

19:17 Anytime you want Claude to remember something, so for example if it’s not using a tool correctly and you want it to use it correctly from then on,

19:25 just type the pound sign and then tell it what to remember and it’ll remember it. It’ll incorporate it into Claude Code automatically.

19:32 If you ever want to drop down to bash mode, so just run a bash command, you can hit the exclamation mark and type in your command.

19:38 That’ll run locally, but that also goes into the context window. So Claude will see it on the next turn.

19:44 And this is pretty good for long-running commands if you know exactly what you want to do or any command that you want to get into context.

19:49 And Claude will see the command and the output.

19:52 You can add mention files and folders. Anytime you can hit escape to stop what Claude is doing.

19:58 No matter what Claude is doing, you can always safely hit escape. It’s not going to corrupt the session. It’s not going to mess anything up.

20:04 So maybe Claude is doing a file edit. I’ll hit escape. I’ll tell it what to do differently.

20:08 Or maybe it suggested a 20 line edit and I’m like, actually 19 of these lines look perfect, but one line you should change.

20:14 I’ll hit escape. I’ll tell it that. And then I’ll tell it to redo the edit.

20:19 You can hit escape twice to jump back in history.

20:22 And then after you’re done with the session, you can start Claude with —resume to resume that session if you want.

20:27 Or —continue.

20:29 And then anytime if you want to see more output, hit Ctrl+R.

20:33 And that’ll show you the entire output, the same thing that Claude sees in its context window.

20:44 The next thing I want to talk about is the Claude Code SDK.

20:46 So we talked about this at the top.

20:48 Right after this, Sid is doing a session, I think just across the hallway, and he’s going to go super deep on the SDK.

20:54 If you hadn’t played around with this, if you used the -p flag in Claude, this is what the SDK is.

21:00 And we’ve been planning a bunch of features over the last few weeks to make it even better.

21:05 So yeah, you can build on top of this. You can do cool stuff.

21:08 This is exactly the thing that Claude Code uses. It’s exactly the same SDK.

21:13 And so for example, something you can do is Claude dash P, so this is the CLI SDK.

21:17 You can pass a prompt. You can pass some allowed tools, which could include specific bash commands.

21:24 And you can tell it which format you want.

21:26 So you might want JSON, or you might want streaming JSON, if you want to process this somehow.

21:31 So this is awesome for building on. We use this in CI all the time.

21:35 We use this for incident response. We use this in all sorts of pipelines.

21:38 So really convenient. Just think of it as like a Unix utility.

21:41 You give it a prompt, it gives you JSON. You can use this in any way.

21:44 You can pipe into it, you can pipe out of it.

21:50 The piping is also pretty cool. So you can use like, for example, git status and pipe this in.

21:55 And you know, use jq to select the result.

21:58 The combinations are endless. And it’s sort of this new idea.

22:01 It’s like a super intelligent Unix utility.

22:03 And I think we’ve barely scratched the surface of how to use this.

22:06 We’re just figuring this out.

22:08 You can read from like a GCP bucket. Read, you know, like a giant log and pipe it in.

22:13 And tell Claude to figure out what’s interesting about this log.

22:16 You can fetch data from like the Sentry CLI.

22:20 You can also pipe it in and have Claude do something with it.

22:28 The final thing, and this is probably like the most advanced use case as we see.

22:32 I’m sort of a Claude normie. So I’ll have usually like one Claude running at a time.

22:36 And maybe I’ll have like a few terminal tabs for a few different repos running at a time.

22:40 When I look at power users in and out of Anthropic, almost always they’re going to have like SSH sessions.

22:46 They’ll have like Tmux tunnels into their Claude sessions.

22:49 They’re going to have a bunch of checkouts of the same repo so that they can run a bunch of Claude in parallel in that repo.

22:54 Or they’re using Git work trees to have some kind of isolation as they do this.

22:58 And we’re actively working on making this easier to use.

23:01 But for now, like these are some ideas for how to do more work in parallel with Claude.

23:07 You can run as many sessions as you want.

23:09 And there’s a lot that you can get done in parallel.

23:15 So, yeah, that’s it. I wanted to also leave some time for Q&A.

23:19 So I think this is the last slide that I have.

23:22 And yeah, if folks have questions, there’s mics on both sides.

23:25 And yeah, we’d love to answer any questions.

23:28 I did.

23:43 Hey, Boris. Thanks for building a Claude Code.

23:52 Thanks for building a Claude Code.

23:53 And I was wondering what was the hardest implementation,

23:56 like part of the implementation for you of building it?

24:01 I think there’s a lot of tricky parts.

24:05 I think one part that is especially tricky

24:08 is the things that we do to make bash commands safe.

24:12 Bash is inherently pretty dangerous,

24:13 and it can change system state in unexpected ways.

24:16 But at the same time,

24:17 if you have to manually approve every single bash command,

24:22 it’s super annoying as an engineer,

24:24 and you can’t really be productive

24:25 because you’re just constantly approving every command.

24:27 And just kind of navigating how to do this safely

24:29 in a way that scales across the different kinds of code bases people have,

24:33 because not everyone runs their code in a Docker container,

24:36 was pretty tricky.

24:38 And essentially the thing we landed on

24:39 there’s some commands that are read-only,

24:41 there’s some static analysis that we do

24:43 in order to figure out which commands can be combined in safe ways,

24:46 and then we have this pretty complex tiered permission system

24:49 so that you can allow list and block list commands at different levels.

24:55 Hi, Boris.

24:56 You mentioned giving an image to Claude Code,

24:59 which made me wonder if there’s some sort of multimodal functionality

25:03 that I’m not aware of.

25:04 Are you just pointing it at an image on the file system or something?

25:07 Yeah, so Claude Code is fully multimodal.

25:10 It has been from the start.

25:11 It’s in a terminal, so it’s a little hard to discover.

25:13 But yeah, you can take an image and just drag and drop it in.

25:17 That’ll work.

25:18 You can give it a file path.

25:19 That’ll work.

25:20 You can copy and paste the image in, and that works too.

25:25 So I’ll use this pretty often for if I have a mock of something,

25:28 I’ll just drag and drop in the mock.

25:30 I’ll tell it to implement it.

25:31 I’ll give it a tier server so it can iterate against it.

25:34 And yeah, it’s just fully automated.

25:35 Hey, why did you build a CLI tool instead of an IDE?

25:45 Yeah, it’s a good question.

25:46 I think there’s probably two reasons.

25:47 One is we started this at Anthropic,

25:51 and at Anthropic people use a broad range of IDEs.

25:53 And some people use VS Code.

25:55 Other people use Zed or Xcode or Vim or Emacs.

26:00 And it was just hard to build something that works for everyone.

26:03 And so terminal is just a common denominator.

26:05 The second thing is at Anthropic,

26:08 we see up close how fast the model is getting better.

26:13 And so I think there’s a good chance that by the end of the year,

26:15 people aren’t using IDs anymore.

26:17 And so we want to get ready for this future,

26:19 and we want to avoid overinvesting in UI and other layers on top,

26:23 given that the way the models are progressing,

26:26 it just may not be useful work pretty soon.

26:29 Thank you.

26:33 Yeah.

26:34 How much have you…

26:35 I don’t know if this is…

26:36 Is this on?

26:37 How much have you used Claude Code for machine learning modeling

26:40 and also that AutoML experience?

26:42 I was curious what the experience has been so far with that.

26:46 Yeah, I think the question was,

26:48 how much are we using Claude Code for machine learning and modeling?

26:52 We actually use it for this a bunch.

26:54 So both engineers and researchers at Anthropic use Claude Code every day.

26:58 I think about 80% of people at Anthropic that are technical use Claude Code every day.

27:03 And hopefully you can see that in the product

27:05 and kind of the amount of love and dog fooding we’ve put into it.

27:08 But this includes researchers who use tools like the notebook tool to edit and run notebooks.

27:13 Thanks.

27:15 Okay, very cool.

27:16 Thank you.

27:17 All right.

27:18 I think that’s it.

27:19 Thanks.

27:20 You can look back.

27:21

27:21

27:21 You can look back.

27:22 You can look back.

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23

27:23 Let’s go.

27:53 Let’s go.

27:53 Let’s go.

视频时长 27分57秒 · 消耗 140 积分 · 积分余额 60


内容效果不满意?点此反馈

输入关键词开始搜索