Glean 拾遗
Daily /2026-06-04 / Turn Claude into a Consistent Assistant with CLAUDE.md: 21 Essential Instructions

Turn Claude into a Consistent Assistant with CLAUDE.md: 21 Essential Instructions

Source x.com Glean’d 2026-06-04 06:00 Read 15 min
AI summary

Every new Claude session starts with zero memory, forcing you to re-explain preferences and correct the same mistakes. CLAUDE.md is a persistent instruction file that Claude automatically reads, providing context, voice, and behavioral rules from the very first message. This guide presents 21 practical instructions grouped into communication style, behavior constraints, personal context, session memory, and developer-specific safeguards. Each instruction includes the rationale and a ready-to-use snippet. By creating a CLAUDE.md file with even a few of these rules, you can dramatically improve output consistency and save hours each week. Ideal for engineers, writers, and anyone who uses Claude professionally.

Original · 15 min
x.com ↗
§ 1

You've been using Claude wrong this whole time. CLAUDE.md fixes everything. Here's how. 👇

你一直以来都用错了 Claude。CLAUDE.md 能解决一切。请看下图 👇

§ 2

Most people using Claude have never heard of it.

The ones who have don't know what to actually put in it.

And that gap is costing people hours every single week. ⏰

Here's the truth — every time you open a new Claude session, it starts with zero memory.

It doesn't know your name. It doesn't know your work. It doesn't know your preferences or how you like things done.

So you spend the first few minutes re-explaining everything from scratch. Or you don't — and Claude gives you something that doesn't fit how you actually work at all.

CLAUDE.md fixes this permanently. 💡

大多数使用 Claude 的人从未听说过它。

知道的人也不知道该往里面放什么。

这一差距每周都在浪费人们数小时。⏰

真相是——每次你打开新的 Claude 会话,它都从零记忆开始。

它不知道你的名字,不知道你的工作,不知道你的偏好或你喜欢怎么做事。

所以你要花开头几分钟从头重新解释一切。或者你不解释——然后 Claude 给出的结果完全不符合你的实际工作方式。

CLAUDE.md 永久解决了这个问题。💡

§ 3

First — this is NOT just a developer tool. 🔥

Writers use it to lock in their voice so Claude never sounds like someone else. Marketers use it to define their audience so Claude stops writing generic copy. Researchers use it to set how they want information structured. Business owners use it to give Claude full company context so every output fits their reality.

Without CLAUDE.md — you start from zero every single session. You repeat yourself. You correct the same mistakes. You explain your preferences for the hundredth time.

CLAUDE.md is the very first thing you should set up before any serious work with Claude. 🎯

首先——这不仅仅是开发者的工具。🔥

写作用它来锁定自己的语气,让 Claude 永远不会听起来像别人。营销人员用其定义受众,让 Claude 停止编写千篇一律的文案。研究人员用它设定信息结构方式。企业主用它为 Claude 提供完整的公司背景,使每个输出符合现实。

没有 CLAUDE.md——你每个会话都从零开始。重复自己,纠正同样的错误,第一百次解释你的偏好。

CLAUDE.md 是在认真使用 Claude 之前应该做的第一件事。🎯

§ 4

How to create it in 2 minutes ⚡

Open your project folder and create a new file. Name it exactly "CLAUDE.md" — capital letters, no spaces.

Open it in any text editor — Notepad, TextEdit, VS Code, whatever you use. Paste your instructions directly into this file in plain text.

Start with 3 or 4 instructions that solve your biggest frustrations first. Save the file. Claude reads it automatically every time you open a session in that folder.

No setup. No extra steps. It just works from the very first message. 💡

如何两分钟创建它 ⚡

打开你的项目文件夹,创建一个新文件。命名为 "CLAUDE.md"——大写字母,无空格。

用任何文本编辑器打开——记事本、TextEdit、VS Code,随便你。直接将你的指令以纯文本形式粘贴到文件中。

从 3 或 4 条能解决你最大困扰的指令开始。保存文件。每次你在该文件夹打开会话时,Claude 会自动读取它。

无需设置,无需额外步骤。从第一条消息开始就生效。💡

§ 5

⚡ PART 1: How Claude Talks to You

  1. Kill the filler forever. 🚫

Claude's default is to open every single response with — "Great question!" "Of course!" "Certainly!" "Absolutely!"

Phrases that add absolutely nothing and waste your time every single day.

One instruction eliminates this permanently. Every response starts directly with the answer. No warmup. No performance of helpfulness. Just what you asked for — immediately.

"Never open responses with filler phrases like 'Great question!', 'Of course!', 'Certainly!', or similar warmups. Start every response with the actual answer. No preamble. Just the information."

⚡ 第一部分:Claude 如何与你对话

  1. 永远消除废话。🚫

Claude 的默认行为是以“好问题!”、“当然!”、“没问题!”、“绝对!” 来开场——

这些短语毫无意义,每天浪费你的时间。

一条指令就能永久消除这一行为。每个回应直接从答案开始。没有热身,没有表现助人的表演,只有你想要的——立刻。

“永远不要用‘好问题!’、‘当然!’、‘没问题!’或类似的热场短语来开场。每个回应直接从实际答案开始。没有前言,只有信息。”

§ 6
  1. Always show options before acting. 🎯

Claude picks one approach and runs with it by default.

You ask it to rewrite a paragraph and it changes the entire tone of the piece. You ask it to restructure a document and it reorganizes things in a way that doesn't match how you think at all.

Now you're correcting something you never asked to change. 😤

This instruction fixes that completely. Before any significant task, Claude shows you 2-3 ways it could approach the work. You choose the direction. What follows is exactly what you wanted.

"Before any significant task, always show me 2-3 possible approaches first. Wait for my choice before proceeding."

  1. 行动前始终展示选项。🎯

Claude 默认会选一种方法直接执行。

你让它重写一段,它却改变了整篇文章的语气。你让它重组文档,它却按照完全不符合你思维的方式重新组织。

于是你不得不纠正你从未要求过的改动。😤

这条指令彻底解决了这个问题。在任何重要任务之前,Claude 会展示 2-3 种可能的处理方式。你选择方向,后续的输出就完全是你想要的。

“在任何重要任务之前,始终先向我展示 2-3 种可行的方法。等我选择后再继续。”

§ 7
  1. Be honest when you don't know. 🔍

Claude will give you a confident, detailed, completely wrong answer before it ever admits uncertainty.

It fills gaps with plausible-sounding information — dates, statistics, quotes, facts — that feel true but simply aren't. You use that information and the problem shows up later when it matters most.

This instruction changes that behavior permanently.

"If you are uncertain about any fact, statistic, date, or quote — say so explicitly before including it. 'I'm not certain about this' is always better than presenting a guess as a fact. Never fill gaps with plausible-sounding information."

  1. 不知道时就坦诚。🔍

Claude 会给出自信、详细但完全错误的答案,而不是承认不确定性。

它会用听起来合理的日期、统计、引用、事实来填补空白——这些感觉真实但实际上并不真实。你使用这些信息,问题在关键时刻暴露出来。

这条指令永久改变了这种行为。

“如果你对任何事实、统计、日期或引用不确定——在包含之前明确说出来。‘我不确定这个’总是比把猜测当作事实要好。永远不要用听起来合理的信息填补空白。”

§ 8
  1. Match length to what's actually needed. 📏

Ask Claude a simple question and it writes four paragraphs. Ask it something complex and it gives you a skeleton that looks complete but isn't.

Neither is useful. Response length should match what the task actually requires.

"Match response length to task complexity. Simple questions get short direct answers. Complex tasks get full detailed responses. Never pad responses with restatements or closing sentences that repeat what you just said."

  1. 根据实际需要匹配长度。📏

问 Claude 一个简单问题,它写四段;问复杂问题,它给你一个看似完整但实际空洞的骨架。

两者都没用。回答长度应与任务实际需求匹配。

“根据任务复杂度匹配回答长度。简单问题得到简短直接的回答。复杂任务得到完整详细的回应。永远不要用重复的陈述或结束语来填充回答。”

§ 9

⚡ PART 2: How Claude Behaves

  1. Ask before making big changes. ✋

You ask Claude to fix one paragraph and it rewrites the entire document. You ask it to shorten something and it removes sections you actually needed.

Every time — you lose something you didn't want to lose.

"Before making any change that significantly alters content I've already created — stop completely. Describe exactly what you're about to change and why. Wait for my confirmation before proceeding. 'I think this would be better' is not permission to change it."

⚡ 第二部分:Claude 的行为方式

  1. 在做出重大更改前先询问。✋

你让 Claude 修改一段,它却重写了整篇文档;你让它缩短内容,它却删除了你实际需要的部分。

每次——你都会失去你不愿意失去的东西。

“在做出任何会显著改变我已创建内容的更改之前——完全停下来。准确描述你将要更改的内容及原因。等我确认后再继续。‘我觉得这样更好’并不是更改它的许可。”

§ 10
  1. Stay focused on what was asked.

Ask Claude to fix one thing and it will "improve" five others while it's in there — adjusting your phrasing, reorganizing your structure, rephrasing sentences you were completely happy with.

Now you have to sort through everything just to find what actually changed.

"Only change what I specifically asked you to change. Do not rewrite, rephrase, or 'improve' anything I didn't ask about — even if you think it would be better. If you notice something worth improving elsewhere, mention it at the end. Do not touch it unless I explicitly ask."

  1. 专注于被要求的内容。

让 Claude 修复一件事,它却“改进”了其他五件事——调整你的措辞、重组结构、改写你完全满意的句子。

现在你必须筛选所有内容才能找到实际的变化。

“只更改我特别要求你更改的内容。不要重写、改写或‘改进’任何我没要求的东西——即使你认为这样更好。如果你在其他地方发现值得改进之处,在末尾提一下。除非我明确要求,否则不要碰它。”

§ 11
  1. Always tell me what you changed. 📋

Claude finishes a task and you're left scanning the output trying to figure out what's different from what you had before.

Which sections changed? Did it cut anything? Did it add something you never asked for?

"After completing any editing or writing task, always end with a brief summary: What was changed. What was left untouched. What needs my attention. Keep it short — this is a status update, not a recap."

  1. 始终告诉我你改了哪些内容。📋

Claude 完成任务后,你只能扫描输出,试图找出与之前有什么不同。

哪些部分变了?它删了什么?它有没有添加你没要求的内容?

“在完成任何编辑或写作任务后,始终以一个简短总结结束:更改了哪些内容,哪些未动,哪些需要我的注意。保持简短——这是状态更新,不是回顾。”

§ 12
  1. Never take actions on my behalf without asking.

As AI tools become more connected — to your email, calendar, social accounts, documents — the risk of Claude taking an action you didn't fully intend grows with every new integration.

Sending a message. Posting content. Scheduling something. These actions have real consequences and they happen fast.

"Never send, post, publish, share, or schedule anything on my behalf without my explicit confirmation in the current message. 'You mentioned wanting to do this' is not confirmation. I must say yes in the current message."

  1. 未经询问绝不代我行动。

随着 AI 工具越来越连通——你的邮件、日历、社交账户、文档——Claude 采取你未完全意图的行动的风险随每次新集成而增加。

发送消息、发布内容、安排事情——这些行动有真实后果,而且发生很快。

“未经我在当前消息中的明确确认,永远不要代表我发送、发布、发布、分享或安排任何内容。‘你之前提到想这么做’不算确认。我必须在当前消息中说“是”。

§ 13

⚡ PART 3: Your Context

  1. Tell Claude who you are and what you know.

Claude doesn't know if you're an expert or a beginner, a founder or a freelancer, someone who wants technical depth or plain language.

Without that context — it guesses. And it's wrong as often as it's right.

"About me: Name. Role. Background. Strong in [topics you know well]. Still learning [areas where you need more context]. Adjust the depth of every response to match this background. Never over-explain what I already know."

⚡ 第三部分:你的背景

  1. 告诉 Claude 你是谁、你知道什么。

Claude 不知道你是专家还是新手,是创始人还是自由职业者,是想要技术深度还是通俗语言。

没有这些背景——它只能猜测。而它猜对的几率和猜错一样多。

“关于我:姓名、角色、背景、熟练领域(你熟悉的话题)、仍在学习(你需要更多上下文的领域)。根据这一背景调整每个回答的深度。永远不要过度解释我已经知道的内容。”

§ 14
  1. Give Claude the context of what you're working on.

Every session Claude starts with no idea what you're working on, who it's for, or what actually matters.

It gives you generic output because it has no other choice.

"What I'm working on: Project. Goal. Audience. Tone. What to avoid. Apply this context to every task. When something doesn't fit this picture — flag it before proceeding."

  1. 为 Claude 提供你正在处理的工作背景。

每个会话,Claude 都不知道你在做什么、为谁做、什么真正重要。

它只能给出通用输出,因为它别无选择。

“我正在处理:项目、目标、受众、语气、要避免什么。将此背景应用于每个任务。当某些内容不符合这个框架时——在执行前标记出来。”

§ 15
  1. Lock in your voice and style.

Claude has a default writing style. It's fine. It's also not yours.

Every time you use Claude to write something — you end up editing it back toward your voice anyway.

Define your voice once and Claude writes in it from the very first draft.

"My writing style — always match this: Voice. Sentence length. Words I use. Words I never use. Format preference. When writing anything on my behalf, match this style exactly. Do not default to your own patterns."

  1. 锁定你的声音和风格。

Claude 有默认的写作风格。这没问题,但它不是你的。

每次你用 Claude 写东西——最终你都要把它改回你自己的声音。

一次定义你的声音,Claude 从初稿开始就用它写作。

“我的写作风格——始终匹配:声音、句子长度、我用词、我绝不用的词、格式偏好。当代表我写作时,精确匹配这种风格。不要默认使用你自己的模式。”

§ 16

⚡ PART 4: Memory and Continuity

  1. Make Claude keep a memory file.

Claude forgets everything between sessions. Every conversation starts completely fresh.

But Claude can write files — and files persist.

This instruction tells Claude to maintain a MEMORY.md file with every important decision you make together — what was decided, why, and what alternatives were rejected.

"Maintain a file called MEMORY.md. After any significant decision — add an entry with what was decided, why, and what was rejected. Read MEMORY.md at the start of every session before doing anything."

⚡ 第四部分:记忆与连续性

  1. 让 Claude 保留记忆文件。

Claude 在会话之间忘记一切,每次对话完全重新开始。

但 Claude 可以写文件——文件是持久的。

这条指令让 Claude 维护一个 MEMORY.md 文件,记录你们一起做的每个重要决定——决定了什么、为什么、拒绝了哪些替代方案。

“维护一个名为 MEMORY.md 的文件。在做出任何重要决定后——添加一条记录,包括决定内容、原因和被拒绝的方案。每个会话开始时,在做任何事情之前先读取 MEMORY.md。”

§ 17
  1. End-of-session summary — never lose progress again.

You close the session. You come back two days later. You spend 15 minutes reading old messages trying to remember where you were and what you finished.

This is completely avoidable waste that happens to almost everyone who uses Claude regularly.

"When I say 'session end' or 'let's stop here' — write a session summary to MEMORY.md: What we worked on. What's completed. What's in progress. What decisions were made. What to pick up next session."

  1. 会话结束总结——再也不丢失进展。

你关闭会话,两天后回来,花 15 分钟阅读旧消息试图回忆你当时在哪、完成了什么。

这完全是可避免的浪费,几乎每个经常使用 Claude 的人都会遇到。

“当我说‘会话结束’或‘我们停在这里吧’——向 MEMORY.md 写入会话摘要:我们处理了什么,完成了什么,进行中的工作,做出了什么决定,下个会话从哪继续。”

§ 18
  1. Log what didn't work — stop solving the same problem twice.

You try a prompt approach. It takes four attempts to get something usable. Three weeks later you're back with a similar task and Claude starts over with the exact same bad suggestions.

Same trial and error. Same wasted time. From the beginning. Every time.

"Maintain a file called ERRORS.md. When an approach takes more than 2 attempts to work — log what didn't work, what worked, and what to remember next time. Check ERRORS.md before suggesting approaches to similar tasks."

  1. 记录失败——避免两次解决同一问题。

你尝试一种提示方法,花了四次才得到可用的东西。三周后你回来处理类似任务,Claude 又从头开始给出完全相同的糟糕建议。

同样的试错,同样的浪费时间。每次都从头开始。

“维护一个名为 ERRORS.md 的文件。当一个方法尝试超过两次才成功时——记录哪些没奏效、哪些有效、以及下次要记住什么。在建议类似任务的方法前先检查 ERRORS.md。”

§ 19
  1. Give Claude a list of facts that never change. 📌

Every project has permanent facts — constraints from past decisions, rules that exist for important reasons, things that are always true about your work regardless of the specific task.

Without this — Claude casually suggests things that completely contradict your reality.

"These facts are always true. Apply them to every session without exception: [Your permanent facts here]. If any task conflicts with one of these — flag it before proceeding."

  1. 给 Claude 一份永不改变的事实清单。📌

每个项目都有永久事实——过去决策带来的约束、因重要原因存在的规则、无论什么任务都始终正确的事情。

没有这个——Claude 会随意提出完全违背你现实的事情。

“以下事实始终为真。毫无例外地应用于每个会话:[你的永久事实]。如果任何任务与其中一项冲突——在执行前标记出来。”

§ 20

⚡ PART 5: For Developers

  1. Stay in scope — touch nothing you weren't asked about.

Ask Claude to fix one bug and it will refactor three files, rename your variables, reorganize your imports, and "improve" code you've been working with for months — all without asking.

Some of those changes break things. Some introduce subtle differences that take days to track down.

"Only modify files, functions, and lines of code directly related to the current task. Do not refactor, rename, or 'improve' anything I did not explicitly ask you to change. If you notice something worth fixing elsewhere — mention it. Do not touch it. Ever."

⚡ 第五部分:给开发者

  1. 保持范围——不要碰你没被问到的内容。

你让 Claude 修复一个 bug,它却重构了三个文件、重命名了变量、重新组织了导入,还“改进”了你用了几个月的代码——全都没有询问。

有些改动会破坏东西,有些引入细微差异需要数天追踪。

“只修改与当前任务直接相关的文件、函数和代码行。不要重构、重命名或‘改进’任何我没有明确要求你更改的内容。如果你在其他地方发现值得修复的东西——提一下。但不要碰它。永远不要。”

§ 21
  1. Confirm before anything destructive.

Claude Code will delete files, overwrite functions, and drop database tables without hesitation — because you told it to, even if you didn't fully realize what you were telling it.

One misread instruction and hours of work are completely gone with no undo.

"Before deleting any file, overwriting existing code, dropping database records, or making any change that cannot be trivially undone — stop completely. List exactly what will be affected. Ask for explicit confirmation. Only proceed after I say yes in the current message."

  1. 在破坏性操作前先确认。

Claude Code 会毫不犹豫地删除文件、覆盖函数、删除数据库表——因为你告诉了它,即使你并未完全意识到自己在说什么。

一条指令误读,数小时的工作就完全消失,无法撤销。

“在删除任何文件、覆盖现有代码、删除数据库记录或做出任何无法轻易撤销的更改之前——完全停下来。列出确切会受影响的内容。请求明确确认。只有在我在当前消息中说‘是’后才能继续。”

§ 22
  1. Hard stops — actions that never happen without permission. 🚨

Deploying to production. Running migrations on a live database. Sending API calls to external services.

These are not "be careful" situations. These are full stops.

"The following actions require explicit in-session confirmation before executing — no exceptions: Deploying to any environment. Running migrations on any database. Sending any email or external API call. Executing any command with irreversible external side effects."

  1. 硬停止——未经许可绝不发生的行动。🚨

部署到生产环境、在实时数据库上运行迁移、向外部服务发送 API 调用。

这些不是“小心”的情况,而是“完全停止”。

“以下操作需要明确的会话内确认才能执行——没有例外:部署到任何环境、在任何数据库上运行迁移、发送任何邮件或外部 API 调用、执行任何具有不可逆外部副作用的命令。”

§ 23
  1. Lock your tech stack. 🔧

Without a defined stack — Claude will suggest whatever framework it considers most popular, whatever library it's seen most often, and whatever package manager it defaults to.

Often not what you use, not what your team knows, and not compatible with what you've already built.

"Tech stack — always use these, never suggest alternatives unless I ask: Language. Framework. Package manager. Database. Testing. Linting. If something seems like the wrong tool — flag it. But use it anyway unless I say otherwise."

  1. 锁定你的技术栈。🔧

如果没有定义好技术栈——Claude 会建议它认为最流行的框架、最常见的库、以及它默认的包管理器。

通常不是你用的、不是你的团队知道的、也不兼容你已经构建的内容。

“技术栈——始终使用这些,除非我要求否则不要建议替代品:语言、框架、包管理器、数据库、测试、代码检查。如果某个工具看起来不对——标记出来。但除非我另有说明,否则仍然使用它。”

§ 24
  1. Always show exactly what changed.

Claude finishes a coding task and you're left scanning the output trying to figure out what's different.

Which files changed? Did it touch anything else? Did it leave something unfinished?

"After completing any coding task, always end with: Files changed. What was modified — one line per file. Files intentionally not touched. Follow-up needed. Keep it short — this is a status update, not a recap."

  1. 始终准确展示更改了什么。

Claude 完成编码任务后,你只能扫描输出,试图找出什么不同。

哪些文件变了?它有没有碰其他东西?有没有留下未完成的工作?

“在完成任何编码任务后,始终以以下内容结束:更改的文件、每个文件修改了什么(每文件一行)、有意未修改的文件、需要后续处理的内容。保持简短——这是状态更新,不是回顾。”

§ 25
  1. The 4 rules that made Andrej Karpathy's CLAUDE.md go viral.

Andrej Karpathy — former Director of AI at Tesla, founding member of OpenAI — identified 4 specific behaviors that make Claude Code fail at coding tasks.

A developer distilled them into 4 instructions. That file hit #1 on GitHub Trending and improved coding accuracy from 65% to 94%.

Here they are:

  1. Ask, don't assume — if something is unclear, ask before writing a single line. Never make silent assumptions.

  2. Simplest solution first — always implement the simplest thing that could work. Don't add abstractions that weren't requested.

  3. Don't touch unrelated code — if a file is not directly part of the current task, do not modify it. Ever.

  4. Flag uncertainty explicitly — if you're not confident about an approach, say so before proceeding. Confidence without certainty causes more damage than admitting a gap.

  1. 让 Andrej Karpathy 的 CLAUDE.md 病毒式传播的四条规则。

Andrej Karpathy——前 Tesla AI 总监、OpenAI 创始成员——识别出导致 Claude Code 在编码任务中失败的 4 种特定行为。

一位开发者将其提炼为 4 条指令。这个文件登顶 GitHub Trending,并将编码准确率从 65% 提升到 94%。

它们是:

  1. 询问,不要假设——如果不清楚,在写一行代码之前先询问。永远不要默默假设。

  2. 最简单的方案优先——总是实现可行最简单的东西。不要添加未被要求的抽象。

  3. 不要碰无关代码——如果文件不是当前任务直接相关,不要修改它。永远不要。

  4. 明确标记不确定性——如果你对某个方法没有信心,在执行前说出来。没有把握的自信比承认不足造成更多伤害。

§ 26

The bottom line.

CLAUDE.md is not just a developer tool.

It is a permanent instruction file that anyone who uses Claude seriously should set up before their very first real session.

Instructions 1-4 fix how Claude communicates. Instructions 5-8 stop it from changing things you didn't authorize. Instructions 9-11 give it context to produce output that fits your actual work. Instructions 12-15 give it the closest thing to real memory that currently exists. Instructions 16-21 make Claude Code behave like a precise tool instead of an unpredictable one.

Create the file. Paste in 3 instructions. Add more as you go.

The difference in output quality will be immediate and obvious from the very first session. 🚀

Follow for more systems that actually change how you work with AI. 💯

总结。

CLAUDE.md 不仅仅是开发者的工具。

它是一个永久指令文件,任何认真使用 Claude 的人都应该在第一次真正会话前设置好。

指令 1-4 修复了 Claude 的沟通方式;5-8 阻止它更改你未授权的部分;9-11 提供背景以产出符合实际工作的输出;12-15 给它目前最接近真实记忆的东西;16-21 让 Claude Code 像精确工具而非不可预测的工具。

创建文件,粘贴 3 条指令,然后逐步增加。

输出质量的差异将从第一次会话开始立竿见影。🚀

关注我,获取更多实际改变你与 AI 协作方式的系统。💯

Open source ↗