我的 Claude 使用姿势

我的 Claude 使用姿势

Agent 发展到现在,早已不只是最初给一段对话让它一次执行完成的样子了(那时候每次要写一堆啰嗦的话,项目规范、个人喜好等等)。

如今我们应该有共识,Agent 的能力已经很强了,配合记忆机制、各种好用的 skill 配合起来的使用体验真的很好,以下是我日常开发的配置。

1
claude --dangerously-skip-permissions

这是以无需确认的方式启动 claude, 执行过程中 claude 不再会因为 tool 调用、文件读写这样的事情暂停等待审批,如果担心安全问题,mac/win 可以通过配置 hook 的方式,在 claude 发起审批时发出弹窗提醒。

CLAUDE.md

CLAUDE.md 等价于其它 Agent 通用的 AGENT.md, Claude 每次启动时都会加载其内容到上下文里,适合放一些所有场景通用的内容:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# CLAUDE.md

Behavioral guidelines to reduce common LLM coding mistakes. Merge with project-specific instructions as needed.

**Tradeoff:** These guidelines bias toward caution over speed. For trivial tasks, use judgment.

## 1. Think Before Coding

**Don't assume. Don't hide confusion. Surface tradeoffs.**

Before implementing:
- State your assumptions explicitly. If uncertain, ask.
- If multiple interpretations exist, present them - don't pick silently.
- If a simpler approach exists, say so. Push back when warranted.
- If something is unclear, stop. Name what's confusing. Ask.

## 2. Simplicity First

**Minimum code that solves the problem. Nothing speculative.**

- No features beyond what was asked.
- No abstractions for single-use code.
- No "flexibility" or "configurability" that wasn't requested.
- No error handling for impossible scenarios.
- If you write 200 lines and it could be 50, rewrite it.

Ask yourself: "Would a senior engineer say this is overcomplicated?" If yes, simplify.

## 3. Surgical Changes

**Touch only what you must. Clean up only your own mess.**

When editing existing code:
- Don't "improve" adjacent code, comments, or formatting.
- Don't refactor things that aren't broken.
- Match existing style, even if you'd do it differently.
- If you notice unrelated dead code, mention it - don't delete it.

When your changes create orphans:
- Remove imports/variables/functions that YOUR changes made unused.
- Don't remove pre-existing dead code unless asked.

The test: Every changed line should trace directly to the user's request.

## 4. Goal-Driven Execution

**Define success criteria. Loop until verified.**

Transform tasks into verifiable goals:
- "Add validation" → "Write tests for invalid inputs, then make them pass"
- "Fix the bug" → "Write a test that reproduces it, then make it pass"
- "Refactor X" → "Ensure tests pass before and after"

For multi-step tasks, state a brief plan:
​```
1. [Step] → verify: [check]
2. [Step] → verify: [check]
3. [Step] → verify: [check]
​```

Strong success criteria let you loop independently. Weak criteria ("make it work") require constant clarification.

## 5. My Personal Preferences

* **Global instruction**: Your response needs to be in Chinese. (Keep this as the first rule.)
* **Code line width**: Do not exceed 120 characters per line (use the editor’s margin as a visual guide).
* **Function/method length**: Do not exceed 100 lines (excluding blank lines and comments). If it does, refactor into smaller, single‑responsibility functions.
* **Commit & MR policy**: Each Merge Request (MR) must correspond to exactly **one** final commit, and one MR must equal exactly one requirement/feature (一个 MR = 一个需求). For long‑running tasks with multiple local saves, use `git commit --amend` to squash them into a single commit before pushing to the MR branch. **Concretely when using `superpowers` skills (brainstorming → writing‑plans → executing‑plans → test‑driven‑development, etc.): one spec = one commit.** Within a single spec, the intermediate checkpoints — spec written, plan written, each task finished, tests pass, prompt tuned, docs updated — are NOT commit boundaries. Keep accumulating with `git commit --amend`; do not run `git commit` again until the spec is fully done. Only when switching to a new spec / new requirement is a fresh `git commit` (and thus a new MR) allowed. Claude must not preset commit nodes inside a spec's lifecycle.
* **Interaction mode**: When I choose to need a chat, you must wait for my reply before proceeding to the next option or action. Do not automatically jump to the next selection.
* **Parallel subAgent execution**: If a task can be broken down into sub‑tasks that can be executed in parallel by subAgents, you must proactively ask the user whether they prefer parallel execution. Do not decide autonomously; the user may not care about token cost and may instead prioritize finishing the task as quickly as possible.

---

**These guidelines are working if:** fewer unnecessary changes in diffs, fewer rewrites due to overcomplication, and clarifying questions come before implementation rather than after mistakes.

前四部分来源于 github 上一个非常火的配置,当时好像有 200k+ 的 star,也有人写一些第一性原理的内容。

第五部分是我使用过程的一些个人喜好,解释如下:

  • 用中文回复;
  • coding 时代码不要越过 IDE 的分界线(120列的位置,超出了我经常要向右拖动看代码);
  • 方法和函数的长度(除去空行和注释)不要超过 100 行(一个很长的函数通常被认为功能不够单一);
  • commit 规范,我更喜欢一次 commit 对应一个需求,不喜欢每次 mr 很多 commit,也是一些企业的规范(这里我着重强调了 superpowers skill, 因为它默认把写 spec、写 plan 做分别 commit);
  • superpowers skill 中间会有澄清问题的流程,当我选择我要回复时它会等不及自动执行下一步,导致我只能 Esc 中断;
  • 有的时候 plan 是可以并行执行的,着急的情况下用户不在乎 token 消耗,更希望尽快完成,因此我要求 claude 把并行执行的选择交给用户(注意这里是并行而不是 subAgent 迭代)。

其实 CLAUDE.md 的原则只有一个:把它写入 CLAUDE.md 对你日常的使用体验比需要写到 prompt 里的体验要更好。出于每次启动 CLAUDE 都会加载的缘故,CLAUDE.md 长度 200 行以内为佳。

顺便一提,superpowers 的一些流程是比较重的,小需求其实不需要上 superpowers,有的人更推荐 grill-me,关于二者的使用对比可以参考: Vibe Coding 神器对比:superpowers 和 grill-me 怎么选?一个架构师的实测框架。

task.md

一般来讲,我写任务喜欢写到 md 里,可以充分的描述背景和需求,也可以引用很多文件、路径。

1
2
3
4
5
6
7
8
这是我临时写需求的 md 文档, 不要提交到 git, 也不要在需求中提及关于 Task.md 的字样, 因为随时会修改和删除


代码编写遵循我在 ~/.claude/CLAUDE.md 的规范


我不确定这个任务的工作量, 你根据自己的理解决定是否使用 superpowers skill(大的任务使用 superpowers,
小的任务使用内置的 plan 模型即可 ), docs/superpowers 的文档也不需要提交到 git

使用的时候:完成 @task.md 的任务即可~

至于项目级的约束、规范,可以写到项目的 CLAUDE.md 或本地的 rule 里(java-rule) 等,这是我一个项目里的一些规则示例:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
### 3.5 Form / VO 继承规范(仅新代码生效,不回溯重构存量)

Form 与 VO 是对外契约对象,字段"重复"成本低于"错误抽象"成本,**契约清晰优先于代码复用**。继承仅在满足前提时使用:

**SaveForm / UpdateForm(中性基类方案)**

- 共享可变字段抽中性基类 `XxxForm`;`XxxAddForm extends XxxForm`(+ save 后锁定的不可变字段),`XxxUpdateForm extends XxxForm`(无额外字段,或 + version 等更新专属字段)。禁止 `XxxAddForm extends XxxUpdateForm` 的直接继承("新增是一种更新"语义倒置)
- **前提:update 为全量替换(PUT)语义,共享字段在 save/update 校验注解完全一致**。存在任何"save 必填、update 可选"的字段时,放弃继承,写两个独立 Form
- id 不放 Form:save 由后端生成,update 走路径 `PUT /update/{id}`(呼应 3.1 接口动词规范);
- 复用同一 Form 类同时当 save/update 入参时,命名必须中性(`XxxForm`),禁止 `POST /save` 收 `XxxUpdateForm`
- 子类 Lombok 加 `@EqualsAndHashCode(callSuper = true)`

**DetailVO / ListVO**

- 仅当 detail 字段集**严格超集**且共享字段**形状完全相同**(类型/含义一致,非 list 用 `roleName: String`、detail 用 `roleList: List<Role>` 这类形异字段)时,允许 `XxxDetailVO extends XxxListVO`
- 不满足时写独立 VO;list 专用标记字段(操作列/脱敏差异)与 detail 结构化字段不强塞进继承链

其实还有一些好用的 skill,像 context7、draw.io,可以在 youtube 一些地方关注流行的 skill,能流行起来的都有其值得使用的地方。

当然,随着 llm 越来越强,这些 harness 的能力未来也许全都不再需要,GPT-6 推出以后微信公众号已经看到很多抛弃 superpowers 的帖子了~


我的 Claude 使用姿势
https://zhuwenjie0716.github.io/2026/09/24/我的 Claude 使用姿势/
作者
Wenjie Zhu
发布于
2026年9月24日
许可协议