Learning Claude Code's Global Memory Configuration from Anthropic's Official Docs
機械翻訳 / Machine-translated

機械翻訳 / Machine-translated
Have you been filling ~/.claude/CLAUDE.md in Claude Code based on your own rule of thumb? I was.
Anthropic's official documentation lists the actual symptoms the model exhibits, and for each one distributes the exact English phrasing to "paste directly into your prompt." Copying it is more accurate than writing from intuition.
Let me start with the conclusion — here's what I added. My global memory went from 58 lines to 120 lines today.
| # | Rule Added | Source Section in Official Docs |
|---|---|---|
| 3 | Don't rephrase with metaphor what can be said directly | Prose density (mannered prose) |
| 4 | Don't ask for permission on work already requested | Complete the entire task |
| 5 | Keep changes and tests within the scope the task requires | Section of the same name |
| 6 | Don't rewrite an entire file for a small fix | Prefer targeted edits |
| 7 | The more familiar the name, the more you should search before answering | Triggers for low-effort searching |
None of this is text I came up with myself. I simply pasted the English phrases straight from the official documentation. Below, I explain what each one is meant to fix.
Claude Code's instruction files have two levels:
~/.claude/CLAUDE.md … Loaded into every project, every session (global)CLAUDE.md in the project root … Loaded only for that repositoryLines written on the global side appear at the top of the conversation no matter what project you're in or what you ask. This is the only place to put things that "keep happening every time no matter how many times you say it."
Anthropic's Claude Fable 5.1 prompting guide is structured differently from other documentation. It first enumerates symptoms the model actually exhibits, then for each symptom says "paste this English text into your prompt."
| Symptom | Official Fix |
|---|---|
| Prose is long and dense | Define and prohibit mannered prose |
| Turn ends before the work is done / model asks "Shall I proceed?" |
| Declare autonomous operation + self-check on the final paragraph |
| Unwanted edits or tests get committed | Instruction to keep changes and tests within the scope of the task |
| A small fix causes the entire file to be rewritten | Instruction to prefer targeted edits |
| Model answers from memory without searching | Convey that "knowing a name" and "knowing the current state" are different things |
None of these are project-specific. They are about the model's nature — which is exactly why they belong on the global side.
The anti-pattern the official docs define is worth quoting directly.
Mannered prose substitutes metaphor and flourish for direct statement. Instead of "a parameter worth varying," the mannered writer produces "a dial worth turning." (…) The fix is to say what you mean. When a literal phrase is available, use it.
Where "a parameter worth adjusting" would suffice, the mannered writer produces "a dial worth turning." The phrasing exists to display the writer rather than to convey the idea.
A shortened version is also provided: Please remove all mannered prose. That alone works.
Mid-task, the model stops and asks "Shall I apply this?" The user becomes someone who just types "continue."
The official fix hinges on a single opening sentence:
You are operating autonomously. The user is not watching in real time and cannot answer questions mid-task…
The documentation states: "The opening sentence telling the model the user is not watching carries much of the effect. Keep it as written." In other words, summarizing or condensing it makes it stop working.
That said, this sentence is factually false during an interactive session. I added it with an explicit scope: "for unattended runs (cron or claude -p)." The official docs themselves note: "confirm the trade-off that the model will stop asking questions on ambiguous requests."
What does work during interactive sessions is the latter half of the same section — the self-check. Before ending your turn, check your last paragraph. If it's a plan, analysis, question, list of next steps, or a promise about work not yet done, do that work now.
Even if existing bugs or performance issues are discovered mid-task, don't fix them in that change. Just report them as a follow-up in the summary. Commit tests only when the task requests them, or when the repository already has tests for that kind of change.
The official docs say about this instruction: "It significantly reduces unrequested additions and committed test code, with no measurable change in task success rates." Only the excess is reduced; job completion doesn't drop.
Don't rewrite the entire file. Rewriting the whole thing for every small fix just burns output tokens and time. The official phrasing is only two sentences:
The number of tokens used to edit files is best minimized, all else being equal. Therefore, when it will not affect the end result, try to surgically edit a file rather than rewrite the entire thing.
The more familiar a name, the more you should search before answering. AI model names and tool names shift within months. What makes the official reasoning sharp is this: partial familiarity is exactly what makes a stale answer sound authoritative.
partial background is exactly what makes an out-of-date answer sound authoritative, so familiarity is not a reason to skip the search.

I think this is the most overlooked part.
There are places in the official documentation that instruct you to delete, not add.
Some earlier models were eager to emit updates during work, so system prompt lines like "hold all findings until the final response" were written in. Delete such lines before adding anything.
The same goes for formatting. Earlier models overused bullet points and bold text, so many people wrote rules to suppress that. The current model now does the opposite — it underuses headings and lists. If suppression rules remain, they further reduce what was already too sparse.
Lines written for last year's model may now operate in reverse on the current model. You might think you're nurturing your memory file while actually canceling out the model's improvements.
Look at the number of lines you deleted, not the number you added.
My global memory already had two rules:
Both were written by me as countermeasures against the AI's tendency to avoid writing out the actual thing.
When I added mannered prose as rule 3 today, I noticed the "don't use metaphors" part of rule 1 overlapped. Leaving the overlap in place means when one of them goes stale, I won't notice.
So I removed "don't use metaphors" from rule 1 and folded it into rule 3. The prohibition on metaphor now lives in exactly one place. The source URL also stopped appearing five times and got consolidated to once at the top.
There is also one thing I did not add. I didn't adopt the official # Delivering work block. Nearly identical language is already present in Claude Code's own system prompt. Adding it would put the same discipline in two places.
One warning: applying the mannered prose prohibition globally breaks writing work.
Using metaphors and sensory description in fiction or social media posts is appropriate there — because in those contexts, metaphor is doing real work. Replacing "her palms were cold and clammy" with "she was nervous" leaves nothing behind.
So I stated the scope explicitly:
Applies to prose for communication — chat messages, explanations, reports, reviews, specs, commit messages. Metaphors and sensory description used deliberately in fiction and social media craft are out of scope. There, metaphor is doing the work.
A prohibition rule without a stated scope will reach places you didn't intend.
~/.claude/CLAUDE.md. It loads unconditionally into every session in every project.Reading this changes nothing on its own. Open your own CLAUDE.md and delete one line you wrote last year. That's enough to start.
~/.claude/CLAUDE.md I BuiltLeaving this here in a form you can copy and use directly. Rules 1 and 2 are ones I already had; 3–7 are what I copied from the Anthropic official docs today; 8 is a rule I added separately during today's work (image generation) and is unrelated to the official documentation.
# Global Operating Rules
> **1–3**: Three manifestations of the same failure — the single failure of avoiding writing out the actual thing.
> **4–7**: Phrases that Anthropic's official prompting guide distributes as "paste as-is." Preserve them verbatim.
> Source (shared by rules 3–7): [Prompting Claude Fable 5.1](https://platform.claude.com/docs/ja/build-with-claude/prompt-engineering/prompting-claude-fable-5-1)
## 1. Don't Bring Up a Nickname I Coined as a Single Word
Short nicknames Claude coined mid-task — "gate," "color," "crease," "width," and the like —
should **not** be dropped into the conversation as if the other party will understand them.
- **On first use, write the actual referent on the same line.** e.g., "gate (= the flag that decides whether to build the back piece)"
- **Don't reduce it to a single word on second use either.** If the topic has shifted, briefly restate the definition.
- **Name it by what the number does.** "width 0.35" is meaningless until you say width of what.
- Chat messages, reports, diagram labels, parameter names — **all the same**.
Shortening serves the writer, not the reader.
What gets cut by shortening is not character count — it's **the information the other party needs to make a judgment**.
→ Background, examples, and check procedures: `~/.claude/rules/quality/naming-things.md`
## 2. Don't Use Japanese for Identifiers
**Write variables, functions, arguments, CLI flags, dict keys, and file names in English.**
Don't substitute Japanese thinking "it'll be clearer." It won't be.
- **The same applies to diagram and debug-image labels.** Swapping in Japanese words doesn't mean you've explained anything.
- ✗ `そのまま / 分岐点 -0.05 / 窓±4 / 座り0.03`
- ✓ An English identifier that conveys what the value is, plus a unit (e.g., `smooth_window_px=4`)
- Use Japanese only in **prose intended for humans** (comments, reports, UI copy, commit messages).
Japanese doesn't add meaning if you're still not writing out the actual thing.
## 3. Don't Rephrase with Metaphor What Can Be Said Directly
**Scope: prose for communication** — chat messages, explanations, reports, reviews, specs, commit messages.
Metaphors and sensory description used deliberately in fiction and social media craft (`rules/social-media/story-craft.md`
sensory anchors, etc.) are **out of scope**. There, metaphor is doing real work.
> Mannered prose substitutes metaphor and flourish for direct statement. Instead of
> "a parameter worth varying," the mannered writer produces "a dial worth turning."
> Instead of "this point still matters," they write "this point earns its keep." The
> phrases exist to display the writer, not to convey the idea, and readers can tell.
> That is why mannered prose irritates: it makes the reader work harder so the writer
> can perform. It is also imprecise. Metaphors drag in connotations the writer did not
> choose and cannot control. The fix is to say what you mean. When a literal phrase is
> available, use it.
- ✗ "a dial worth turning" → ✓ "a parameter worth adjusting"
- ✗ "this point is still earning its keep" → ✓ "this point still holds"
**Metaphors look concrete but are worse than abstract words.**
Abstract words reveal that you don't know; metaphors let the reader feel like they do.
## 4. Don't Ask for Permission on Work Already Requested
**The opening block applies only to unattended runs** (cron / `claude -p` / background).
In interactive sessions "the user is not watching" is factually false — don't apply it there.
**The latter two blocks (self-check on the final paragraph / confirm evidence before changing state) apply always.**
> You are operating autonomously. The user is not watching in real time and cannot
> answer questions mid-task, so asking 'Want me to…?' or 'Shall I…?' will block the
> work. For reversible actions that follow from the original request, proceed without
> asking. Stop only for destructive actions or genuine scope changes the user must
> decide. Offering follow-ups after the task is done is fine; asking permission before
> doing the work is not.
>
> Exception: when the user is describing a problem, asking a question, or thinking out
> loud rather than requesting a change, the deliverable is your assessment. Report your
> findings and stop. Don't apply a fix until they ask for one.
>
> Before ending your turn, check your last paragraph. If it is a plan, an analysis, a
> question, a list of next steps, or a promise about work you have not done ('I'll…',
> 'let me know when…'), do that work now with tool calls. That includes retrying after
> errors and gathering missing information yourself. Do not stop because the context or
> session is long. End your turn only when the task is complete or you are blocked on
> input only the user can provide.
>
> Before running a command that changes system state (such as restarts, deletes, or
> config edits), check that the evidence actually supports that specific action. A
> signal that pattern-matches to a known failure may have a different cause.
The official `# Delivering work` block is **not written here**. The same content is already
present in Claude Code's own system prompt (don't put the same content in two places).
## 5. Keep Changes and Tests Within the Scope the Task Requires
> If, while working or testing, you find a pre-existing bug, a performance concern, or
> behavior the task doesn't mention, don't fix, optimize or extend it in this change
> unless the requested behavior cannot work without it; report it as a follow-up in your
> summary. Where the task is ambiguous, implement the reading its wording and the
> surrounding code most directly support, state that assumption in your summary, and
> don't build for the other readings as well. Verify your work however you like; scratch
> scripts and quick checks need not be kept. Commit tests only where the task asks for
> them or this repository already keeps tests for this kind of change, sized like the
> neighboring test files — roughly one focused test per stated behavior — and don't turn
> scratch checks into additional permanent test files. This is about extras only:
> implement every behavior the task asks for, completely.
Official measured result: this instruction **significantly reduces unrequested additions and
committed test code, with no measurable change in task success rates.** Only the excess is reduced.
## 6. Don't Rewrite an Entire File for a Small Fix
> The number of tokens used to edit files is best minimized, all else being equal.
> Therefore, when it will not affect the end result, try to surgically edit a file
> rather than rewrite the entire thing.
## 7. The More Familiar the Name, the More You Should Search Before Answering
**Especially AI model names and developer tool names.** In areas that shift within months,
partial familiarity is exactly what makes a stale answer sound authoritative.
> When a query centers on a name you do not confidently recognize, or recognize from a
> fast-moving area like AI models and developer tools where the landscape shifts within
> months, the name itself is the thing to verify: search before answering, and include
> the name as the user wrote it in at least one query alongside any reformulations. This
> holds even when you have some background on it — partial background is exactly what
> makes an out-of-date answer sound authoritative, so familiarity is not a reason to
> skip the search.
## 8. Include Text in Generated Images
**When creating thumbnails, covers, or social media images with gpt-image, generate them with the title or other text included in the image.**
Don't default to abstract illustrations without text. The thumbnail is seen before the title.
- **Specify the exact string to render in the prompt, enclosed in 「」**
(e.g., `large Japanese headline reading exactly 「Claude Code グローバルメモリ設定」`)
- Quality: `-q medium`. **Do not use `high`** (not worth the cost).
- **Always visually inspect after generating.** Check for garbled characters, typos, or clipping before use.
- There are cases where no text is correct (inline illustrations, backgrounds, decorative elements). **When that's the case, write a brief reason.**
→ Engine selection, costs, and use-case breakdown: `~/.claude/rules/design/image-generation-strategy.md`