---
title: "Claude Code：来自真正专家的使用秘诀"
url: "https://zuey.me/articles/claude-code-bi-quyet-su-dung-tu-nhung-chuyen-gia-thuc-thu?lang=zh"
locale: zh
access: free
full_text: true
published_at: "2025-08-19T14:16:24.000Z"
tags: ["Claude Code", "AI Agents", "生产力"]
translations:
  en: "https://zuey.me/articles/claude-code-bi-quyet-su-dung-tu-nhung-chuyen-gia-thuc-thu.md?lang=en"
  vi: "https://zuey.me/articles/claude-code-bi-quyet-su-dung-tu-nhung-chuyen-gia-thuc-thu.md?lang=vi"
  ko: "https://zuey.me/articles/claude-code-bi-quyet-su-dung-tu-nhung-chuyen-gia-thuc-thu.md?lang=ko"
  ja: "https://zuey.me/articles/claude-code-bi-quyet-su-dung-tu-nhung-chuyen-gia-thuc-thu.md?lang=ja"
---
# Claude Code：来自真正专家的使用秘诀

> 刚看完 Ray Fernando（前 Apple 工程师）和 Eric Boost 分享他们实战使用 Claude Code 的方法：thinking modes、保护 context window、sub-agents、hooks 和 blind validation。笔记都整理在这儿了！

[YouTube: https://youtu.be/JU8BwMe_BWg](https://youtu.be/JU8BwMe_BWg)

我刚看完 Tool Use 第 52 集里一场超有意思的对谈，两位都是大佬：Ray Fernando（前 Apple 工程师，12 年经验）和 Eric Boost（Anthropic 铁粉）。说实话，从他们使用 Claude Code 的方式里我学到了超多东西！

### 很多人都在遇到的问题

我们当中有多少人遇到过这种情况：手里有个“神一般”的 AI，什么都能做，但真用起来却时灵时不灵？有时候它好用到烧 token 的速度像每小时几百万英里，有时候结果又完全不是你想要的。

这正是这期视频要解决的问题：**如何高效地 leverage 这种智能**。

### 初始设置：打好坚实的基础

#### 1. 聪明的 alias 和快捷方式

Ray 分享了一个好用的小技巧：给字母 `c` 设一个 alias，用 `--dangerously-skip-permissions` flag 来运行 Claude。听起来很“危险”，但这个 YOLO mode 能让 workflow 顺滑很多。

另外，他还用了键盘的文本替换功能：

- `U` → `ultrathink`（让 Claude 在写代码前认真思考）
- `W` → `what happened`（回顾刚才发生了什么）

#### 2. Claude Code docs：改变游戏规则

这是 Eric 最强调的一点：**把 Claude Code docs 安装到本地**。为什么？

- Claude 默认要去 Anthropic 的文档网站 fetch → 浪费时间
- 本地 docs 通过 GitHub Action 每 3 小时自动同步
- 当你问 `/docs` 时，Claude 会在本地查找，而不是上网
- 这能帮助 Claude 更深入地理解它自己的 capabilities

### Thinking modes：不是什么时候都要“ultra”

#### 4 个 thinking 等级

| 等级 | 关键词 | Token 预算 |
| --- | --- | --- |
| 1 | `think` | 约 4,000 tokens |
| 2 | `think hard` | 约 8,000 tokens |
| 3 | `think harder` | 约 16,000 tokens |
| 4 | `ultrathink` | 约 32,000 tokens |

**重要 insight**：Ray 发现并不是什么时候都应该用 `ultrathink`。为什么？

### Context window：沉默的敌人

Ray 对这个问题有一个很棒的可视化：

```mermaid
flowchart TD
  A["Input · 2k tokens"] --> B["Agent thinking · 32k tokens"]
  B --> C["Tool calling + 代码"]
  C --> D["Output"]
  D --> E["用户请求"]
  E --> F["更多 agent thinking"]
  F --> G["更多 tool calling"]
  G --> H["质量下降的 output"]
```

*每一轮 thinking 和 tool calling 都会让 context window 更满一点*

问题在于：**context rot**。当 context window 用到 50% 之后，output 质量会明显下降（根据 ChromaDB 的研究）。

#### 解决方案：有策略地管理 context

#### 1. Conversation isolation

每个对话只专注于一个具体问题

#### 2. Sub-agents

为每个 task 单独 spawn 一个 agent

#### 3. Clear & restart

带着精心整理过的 context 重新开始

### Sub-agents：像经理一样去管理

Eric 和 Ray 都在用 sub-agents，但思路不一样：

#### Eric 的思路：保护 context

- 用 sub-agents 来保住 main context
- 只回传相关信息，而不是全部
- Blind validation：必须由另一个 agent 来验证工作成果

#### Ray 的思路：code review 和调研

- 把 sub-agents 当“实习生”去翻 codebase
- 调研 authentication 是怎么实现的
- 反复检查，避免出现重复的 pattern

### Hooks vs slash commands：什么时候用哪个？

|  | Hooks | Slash commands |
| --- | --- | --- |
| 触发方式 | 有事件时自动触发（文件变更等） | 由用户主动调用 |
| Context | 在 Claude context **之外**运行 → 不会污染 | 优先级**高于** CLAUDE.md 里的 instructions |
| 适合 | 后台任务 | 交互式 workflow |

### Project Index：Eric 的秘密武器

这是 Eric 自己做的工具：一个 hook，能为整个 codebase 生成一份“minified version”：

- 每个文件的 UML 风格抽象
- Import 语句、method signatures、dependencies
- 文件一有变动就自动更新
- 让 Claude 不用加载全部代码也能理解 architecture

### Trust but verify：黄金法则

> **WARN:** Eric 有一个极其重要的 insight：**Claude 说“搞定了”的时候，永远别信**。

解决方案：**blind validation system**。

- Main agent 不能自己验证自己的工作
- 必须有一个单独的 agent，任务是：“You are a blind validator”
- 这个 agent 负责检查截图和 checklist，判断是不是真的完成了

### 给新手的实用建议

Ray 有一条很棒的建议：**如果觉得太 advanced，也别灰心**。他是辍学生，凭着一股韧劲进了 Apple，在工作中边做边学软件工程。

#### 80/20 法则

- [ ] **像真实用户一样使用产品**
- [ ] **找出 workflow 里的痛点**
- [ ] **问 Claude：“怎样才能不再重复这个问题？”**
- [ ] **搭建系统来自动化/验证**

### Key takeaways

#### 1. Protect your context window

像对待亲生头胎一样

#### 2. Think modes strategically

不是什么时候都要 ultra

#### 3. Local docs

必备的 setup

#### 4. Sub-agents

用于具体、隔离的 task

#### 5. Blind validation

用来保证质量

#### 6. Hooks

用于自动化，**slash commands** 用于交互

#### 7. Trust but verify

Always

### 未来：无限可能

Eric 说得太对了：

> There is no reason that tools can’t be constructed at this moment with the technology as it currently is that will reliably let you give it a task and you come back in an hour and the whole thing has been validated.
>
> — Eric Boost

我们正处在一个 **composability** 成为基础功能的时刻。Claude 可以 spawn 自己的其他版本、嵌套 sub-agents、共享 context……可能性真的是无限的。

---

**Bottom line**：Claude Code 不只是一个写代码的工具，它是一个用来构建智能 workflow 的平台。关键在于理解如何“talk to AI in the right way with the right tools”，把这份潜力释放出来。

在用 Claude Code 的朋友们，试试这些技巧吧。我相信你的生产力会提升到一个全新的 level！🚀
