20条Claude.md规则,每周可节省数小时——大多数Claude用户从未设置过
开始之前——如何创建该文件
打开Claude代码。在您工作的文件夹中,创建一个新文件。将其命名为CLAUDE.md——全部大写,不带空格。这是一个扩展名为.md的纯文本文件。
在任何文本编辑器中打开它——记事本、TextEdit、VS Code,任何一款都行。您将直接用纯文本编写您的指令,无需特殊格式。
仔细阅读本文,抄下那些最能反映你最大困扰的规则。你不必全部掌握20条,从3到4条开始即可。尤其是那些让你忍不住想:“每次打字都得输入这个”的规则。
保存该文件。每次您在该文件夹中启动会话时,Claude 都会自动读取它。无需设置,无需额外步骤——您的指令从第一条消息起就已备妥。
第一类 默认
1- 无项目符号
Claude几乎对所有事情都默认使用项目符号。让你它解释某件事——项目符号。让你它给出推荐——项目符号。问题不在于列表看起来不好看,而在于项目符号压缩了推理过程。你得到的只是结论,却失去了让结论变得有用的那种逻辑推理。
只需一行代码,即可解决你未来所有对话中的问题。
代码块
TOML
Never use bullet points or numbered lists unless I explicitly ask.
Default to prose.
If you're about to make a list, write it as a sentence instead.
2- 无序言
每个Claude的回答都以相同的方式开头。你提出一个问题,它会先将问题原封不动地回放给你,然后再作答。你要求它重写,它也会先解释自己即将采取的行动,然后才开始执行。你提出的问题与实际答案之间的这段空白,纯粹是无用的赘余——你读到的不过是些告诉你早已知晓的信息的文字。
你提出了问题。在克劳德切入正题之前,你无需再听回音。一句话就够了,之后便彻底停止。
代码块
Plain Text
Never restate my question or explain what you're about to do.
Start with the answer. Skip the setup.
3- 不做任何规避
克劳德默认会对一切加以限定。这取决于情况。这是一个颇具细微差别的主题。这一点很重要,需要特别留意。这些短语旨在表达谨慎态度,但在实际应用中却会拖延回答,让每一种回应都显得不确定——即使其实根本无需如此。你没要求免责声明,你要求的是答案。
这种规避措施并不会让Claude更准确,只是让它更难阅读。今后每场对话中,只需一行就能将其彻底移除。
代码块
Plain Text
Don't hedge. No "it depends," no "it's important to note," no "this is nuanced."
If something genuinely has exceptions, state the answer first, then note the exception briefly.
4- 响应长度校准
克劳德不会根据你实际提出的问题自然调整回答的长度。一个简单的“是”或“否”问题会得到三段文字的回复;而一项复杂的任务则只给出一个浅层概要。回复的长度应与问题的分量相匹配——而非默认为克劳德自认为足够详尽的长度。
This is one of the first things worth locking in, because it changes the texture of every single response you get.
代码块
Plain Text
Match response length to the complexity of the request.
Short questions get short answers. Complex tasks get full responses.
Never pad an answer to seem thorough.
5- Tone
Claude's default tone is professional, measured, slightly formal. That works for some people and sounds nothing like others. If you write casually, Claude's polished responses feel like a different person wrote them - and anything it drafts in your name immediately needs editing before it sounds like you.
Tell it once how you actually communicate and it stops sounding like a press release every time you ask it to write something.
代码块
Plain Text
My tone is casual, direct, and plain. No corporate language, no filler phrases, no formal sign-offs.
Write the way a smart person talks in a real conversation - not the way a company writes a memo.
When drafting anything in my voice, match how I write in this conversation, not how you default to writing.
6- 先澄清再行动
当请求含糊不清时,Claude的默认做法是选择一种解释并据此执行。有时这样做会成功。但更多时候,你得到的却是一个针对错误问题的完整答案,不得不重新开始。而返工所耗费的时间,往往比提出澄清问题所需的时间还要多。
一条指令即可改变默认设置——Claude会先询问,而不是直接猜测,你只需获得真正需要的输出。
代码块
Plain Text
If my request is ambiguous, incomplete, or could reasonably go in more than one direction,
stop and ask me one clarifying question before you start working.
Just one - the most important one. Don't ask several at once.
Don't guess and produce something I didn't ask for.
7- 语言锁定
如果您粘贴的是法语文本,Claude 会用法语回复。如果您的原始材料是西班牙语,回答可能会偏向西班牙语。Claude 会原封不动地沿用输入内容所使用的语言——理论上这很有用,但实际使用时却可能令人困扰,尤其是当您始终希望输出结果采用同一种语言,而不管输入内容是什么语言时。
一次修复,从此无忧。
代码块
Plain Text
Always respond in English, regardless of the language of any text I paste or reference.
My working language is English.
第二类 行为
8- 直接回击
克劳德经过训练,总是力求言辞得体。当你说了什么错话,它会把纠正说得委婉至极,以至于你可能根本察觉不到它其实并不认同你的观点。当你的计划存在漏洞时,它会先肯定其中的可取之处,再把问题悄悄埋藏在最后。这种做法毫无用处——它只是以一种看似礼貌的方式,白白浪费了你的时间。
明确地表达你的反对意见,你就不会再收到类似鼓励的反馈了。
代码块
Plain Text
If I'm wrong about something, say so directly.
Don't soften disagreement to the point where I miss it.
9- 一个答案,而非五个
你向克劳德寻求推荐,它却给你提供了一些选项。以下是你可以采取的三种方法." "选项A有这些好处,选项B有这些好处。你之所以请求推荐,是因为你想让别人帮你做决定——结果你得到的却是一份菜单,最终的决定权依然掌握在你自己手中。
只需一句话,就能停止通过期权进行对冲,真正锁定一种选择。
代码块
Plain Text
When I ask for a recommendation or a decision, give me one answer -
not a list of options with pros and cons.
Pick the best one and tell me why.
If there's a meaningful reason I might want something different,
mention it in one sentence after your recommendation.
10- 承认不确定性
Claude几乎能对任何问题生成听起来充满自信的回答,甚至包括它实际上并不了解的内容。这些回答看似完整、语气权威,却可能在你采取行动之后才暴露出明显的错误。问题并不在于Claude会出错——而在于它从不会提示自己是在猜测。
一条指令会改变它所告知你的一切的可靠性。这并非因为它让Claude变得更聪明——其实它并没有。而是因为它将不确定性凸显出来,让你能够真正地看到它。
代码块
Plain Text
When you're uncertain about a fact, a date, a name, or any specific claim, say so explicitly before stating it. Use phrases like "I'm not certain, but..."
or "you should verify this, but..." Don't generate authoritative-sounding answers when you're working from incomplete information.
"I don't know" is always
a better answer than a confident guess.
11- 停下来检查长时间运行的任务
当克劳德在一项长任务进行到一半时遇到不清楚的地方,它的默认做法是自行做出判断并继续前行。等它完成时,生成的成果已完整、精良,且建立在你从未同意过的假设之上。此时重新开始,所付出的代价远比任务中途花两秒钟检查一下要高得多。
任务越长,这一假设的成本就越高。这条指令会让Claude在关键时刻暂停,而不是直接向你呈现一个已完成的问题。
代码块
Plain Text
On longer tasks, if you reach a point where you're uncertain about direction,
scope, or a key assumption - stop and ask before continuing.
Don't make a judgment call and build the rest of the task on top of it.
A short check mid-task is always better than a full redo at the end.
12- 换种方式再试一次
当你告诉Claude某件事没有达到预期效果——解释令人困惑,输出偏离了重点——它的本能就是尝试同样的方法,稍作微调。结构不变,用词略有不同,结果却依然如故。它将反馈视为一种优化的信号,而非重新思考的信号。
此指令会中断循环。如果它生成的内容不起作用,那么采取的策略就会改变,而不仅仅是措辞上的调整。
代码块
Plain Text
If I tell you that your response didn't land, was confusing, or missed what I needed,
don't repeat the same approach with minor edits.
Change the angle entirely - different structure, different framing, different level of detail.
Assume the method was wrong, not just the execution.
13- Signal when done
克劳德语调渐渐低了下去。冗长的邮件往往以一段结尾,却戛然而止,仿佛什么都没说,或者只留下一句模棱两可的话:“如果有什么需要调整的,请告诉我。” 你只能猜测:这封邮件到底写完了,还是被中途截断了?是不是遗漏了什么内容,抑或这本来就是全文的结尾?在短任务上几乎无关紧要。但在任何复杂任务上,它都会造成不必要的反复沟通,仅仅为了确认工作已完成。
One instruction and every output has a clear ending.
代码块
Plain Text
When you've completed a task, signal it clearly.
A single line is enough - "Done." or "That's the full [output]."
Don't trail off or end with open-ended offers to adjust.
If there's something genuinely incomplete, flag it specifically.
第三类 记忆(Memory)
14- 你是谁
默认情况下,Claude 根本不知道它在与谁对话。它不了解你的职业、所在行业、从业经验水平,也不知道你实际需要什么样的输出结果。它给出的每一个答案都是针对普通用户的——这意味着它会解释你早已掌握的知识,跳过你需要的背景信息,推荐的解决方案也未必适合你的具体情况。
只需为自己写两句话一次,每次回复都会根据你的真实情况调整。
代码块
Plain Text
About me: I'm a [job title] working in [industry].
I have [beginner/intermediate/expert] knowledge of [relevant areas].
When answering questions, calibrate your explanations to this level - don't over-explain
basics I already know, and don't assume expertise I don't have.
15- 您目前的项目
每次会话,Claude 都完全不知道你正在做什么。你需要粘贴上下文、解释背景、描述你想要实现的目标——然后在下一次会话中再重复一遍。对于那些持续数天或数周的项目,这种反复解释纯粹是无谓的 overhead,对最终成果毫无助益。
只需在CLAUDE.md中写一次,Claude 就能走进每次会议,早已知晓你手头的事项。
代码块
Plain Text
Current projects I'm working on:
16- 你的写作风格
克劳德可以模仿你的口吻写作——但前提是它必须知道你真实的语音特征。如果缺乏这一信息,它就会默认采用自己的风格:结构严谨、平衡得当、略显正式。如果你打算以自己的名义发表或发送克劳德撰写的内容,务必先进行改写,让它听起来更像你本人。 那次编辑完全是因为克劳德在猜测一种它从未被赋予的风格。
<b粘贴你自己的几句话,猜谜就结束了。
代码块
Plain Text
Here is an example of how I write. Match this style whenever you're drafting
anything in my voice:
17- 你所在世界的人们
每次你提到你的经理、客户、同事或合作者时,Claude 都会将他们视作陌生人。结果,你每次都不得不额外添加一行上下文——介绍他们的身份、所从事的工作以及你们之间的关系。持续数周使用下来,这累积起来就是大量重复的解释,却对实际工作毫无助益。
只需写一次关键人物,Claude 从第一次提及起就能知道你在说谁。
代码块
Plain Text
People I work with regularly:
[Name]: [their role and relationship to you in one sentence]
[Name]: [their role and relationship to you in one sentence]
18- 您使用的工具
当你向Claude寻求任务帮助时,它会推荐最常用的解决方案——而这些方案往往并非你所拥有的、你的团队所使用的,也并非你的预算所能负担的。最终,你不得不在这些建议真正派上用场之前,先根据自己的实际情况进行一番筛选。那道过滤步骤是你每次都在默默进行的工作。
<b只需向它说明一次您的堆栈,其推荐设置便会从一开始就完全契合您的配置。
代码块
Plain Text
Tools and platforms I use:
[Category — e.g. writing, project management, communication]: [tool name]
[Category]: [tool name]
When suggesting solutions or workflows, default to these tools.
Don't recommend alternatives unless I ask or unless what I'm trying to do genuinely can't be done with what I have.
19- 坚决拒绝
每种工具都有其默认设置,并非对每个人都适用。Claude 有一些自动执行的功能——它使用的短语、默认采用的结构以及给出的建议——可能恰恰与你的实际情况不符。唯一阻止这些情况的方法,就是在每次使用时及时发现并加以纠正,一次又一次地调整,直到你学会将这些内容添加到 CLAUDE.md 中。
只需编写一次你的硬性规则。它们将永久适用于一切,毫无例外。
代码块
Plain Text
Things to never do, regardless of the request:
- [specific phrase, format, or behavior to avoid]
- [specific phrase, format, or behavior to avoid]
- [specific phrase, format, or behavior to avoid]
These are not preferences. Don't do them even if the request seems to call for it.
20- 运行情况
有些背景信息并非关乎你是谁——而是关乎当下正在发生的事。比如,你正处在求职过程中;你正在努力处理一段棘手的客户关系;又或者,距离产品发布仅剩三周,时间紧迫。这类情境会深刻影响Claude为你提供的所有帮助,但你每次咨询时都必须重新解释一遍,因为Claude完全不记得上次的情况。
把它放在CLAUDE.md中,它就会出现在每次对话中,而无需你特意提起。
代码块
Plain Text
CLAUDE.md 并非面向高端开发者的工具,而是一份永久性的使用说明文件,任何认真使用 Claude 的人都应在首次正式使用前将其设置好。
规则1至4规定了Claude默认的格式和沟通方式。规则5至7确定了您的语气,避免它随意猜测,并确保它使用您的语言。规则8至13改变了它处理分歧、不确定性和长任务的方式。规则14至17为其提供了所需的个人背景信息,使其不再每 session 都将您视作陌生人。规则18至20会告知它你拥有哪些工具、它永远不能做什么,以及当前正在发生什么。