記事一覧へ
# CLAUDE.mdファイルの完全ガイド——Claude Codeを本当に言うことを聞かせる方法
Claude Codeを使っている人の多くは、間違ったやり方をしています。
新しいプロジェクトを開き、プロンプトを打ち始め、なぜClaude がルールを忘れるのか、スタックを無視するのか、頼んでもいないコードを書くのか、と不思議に思っています。
問題はClaudeではありません。
問題は、あなたがClaudeに「自分が何者か」「何を作っているか」「どう振る舞ってほしいか」を一度も伝えていないことです。
そのためにあるのがCLAUDE.mdファイルです。
これはClaude Codeの中で最も過小評価された機能です。一度理解すれば、生のプロンプト入力には戻れなくなります。このガイドでは、CLAUDE.mdとは何か、なぜ重要か、どう構成するか、そして私が自分のプロジェクトで実際に使っているテンプレートをすべて解説します。
## CLAUDE.mdファイルとは何か?
プロジェクトフォルダの中でClaude Codeを実行すると、そのディレクトリのルートにあるCLAUDE.mdというファイルを自動的に探します。
ファイルが見つかれば、他の何よりも先にそのファイル全体を読み込みます。
これはプロジェクトと一緒に持ち運べる永続的なシステムプロンプトだと思ってください。毎回セッションを始めるたびに、Claudeはすでに以下を把握した状態でスタートします。
- プロジェクトが何であるか
- どのスタックを使っているか
- どのコーディング規約に従うか
- 絶対にやってはいけないことは何か
- ゴールは何か
これが、毎回手取り足取り教えが必要な新入社員と、初日からすべてを理解しているベテラン開発者の違いです。
ファイル1つ。永続的なコンテキスト。繰り返しの説明はゼロ。
## なぜほとんどの人がこれをスキップするのか(そしてなぜそれが高くつくのか)
CLAUDE.mdファイルを使わないと何が起きるか、お伝えします。
セッションの最初の5分間、毎回プロジェクトの説明をし直すことになります。Claudeは間違ったフレームワークでコードを書きます。あなたが嫌いな命名規則を使います。頼んでもいないコメントを追加します。3週間前に却下したパッケージを提案します。
修正します。また忘れます。また修正します。
生産性ツールではなく、子守が必要な高速タイピストです。
CLAUDE.mdファイルはこのほぼすべてをなくしてくれます。初日採用の新人として振る舞うClaudeと、数ヶ月チームにいたような人物として振る舞うClaudeの違いです。
良いCLAUDE.mdを書くのに必要な時間への投資は20〜30分です。
それ以降のすべてのセッションで時間が戻ってきます。
## ファイルをどこに置くか
Claude Codeは3つの場所でCLAUDE.mdを探します。
- **プロジェクトルート** — メインのファイル。そのフォルダ内のすべてのセッション開始時にClaudeが読み込みます。
- **サブディレクトリ** — モノレポの場合、各サブフォルダにCLAUDE.mdを置けます。Claudeは作業場所に応じて関連するものを読み込みます。
- **ホームディレクトリ** — すべてのプロジェクトに適用されるグローバルな`~/.claude/CLAUDE.md`。変わらない個人的な好みに最適です。
ほとんどの人はプロジェクトルートから始めてください。永続的な好みがわかったらグローバルのものを追加してください。
## 高パフォーマンスなCLAUDE.mdの解剖学
私が使っている構造を紹介します。各セクションには特定の目的があります。セクションをスキップしないでください。欠けている部分はすべて、Claudeが自分の判断に任せてしまうギャップになります。
### 1. プロジェクト概要
プロジェクトが何であるかをプレーンな英語で説明することから始めます。1〜2段落。冗長な部分は不要です。
```markdown
## Project Overview
This is a crypto signal bot dashboard built with Next.js and Tailwind.
It scans 98 trading pairs every 58 seconds using RSI, MACD, and Bollinger Bands
and displays live signals in a dark-mode UI.
The target user is a retail crypto trader who wants clean, fast signals
without noise. Speed and clarity are the two non-negotiable priorities.
```
これでClaudeはドメイン・ユーザー・優先事項を把握しました。それ以降のあらゆる判断はこのコンテキストを通してフィルタリングされます。
### 2. テックスタック
明示的に書きます。すべてを列挙します。
```markdown
## Tech Stack
- Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS only — no CSS modules, no styled-components
- Language: TypeScript strict mode
- Database: Supabase (Postgres)
- Auth: Supabase Auth
- Deployment: Vercel
- Package manager: pnpm
- State: Zustand
- Charts: Recharts
```
これを書かないと、Claudeが仮定します。正しい時もあります。間違っている時も多いです。
### 3. コーディング規約
ここがほとんどのCLAUDE.mdファイルが足りていない部分です。何を使うかだけでなく、どのようにコードを書くかについて具体的に書く必要があります。
```markdown
## Coding Conventions
- Use named exports for all components — no default exports
- File names use kebab-case: signal-card.tsx, not SignalCard.tsx
- Component names use PascalCase
- All functions use arrow function syntax
- No var — only const and let
- Prefer early returns over nested conditionals
- Add JSDoc comments only for exported utility functions
- Never use any — always type explicitly
- Keep components under 150 lines — extract if larger
- Co-locate types with the file that uses them unless shared across 3+ files
```
これはガイダンスなしにClaudeが常に間違える箇所です。一度書いてしまえば、二度と修正する必要はありません。
### 4. Claudeが絶対にやってはいけないこと
このセクションは使われていないことが多いですが、最も強力な部分の一つです。
```markdown
## Never Do This
- Never install a new package without asking me first
- Never rewrite a component I did not ask you to touch
- Never use useEffect for data fetching — use React Query
- Never add console.log statements to production code
- Never use inline styles
- Never suggest switching the framework or database
- Never add placeholder comments like "// TODO: implement this"
- Never use emojis in code comments
- Never wrap everything in a try/catch without telling me
```
Claudeは本質的に助けようとします。時に**助けすぎる**ほどです。頼んでもいないものをリファクタリングします。望んでいないエラー処理を追加します。タスクの途中で別のアプローチを提案します。
NEVERセクションはこの振る舞いに対して強制停止を設けます。
### 5. ファイル構造
プロジェクトがどう整理されているかをClaudeに見せます。
```markdown
## File Structure
src/
app/ # Next.js App Router pages
components/ # Shared UI components
ui/ # Primitive components (buttons, inputs, etc.)
features/ # Feature-specific components
lib/ # Utility functions and helpers
hooks/ # Custom React hooks
stores/ # Zustand stores
types/ # Shared TypeScript types
styles/ # Global styles only
Do not create new top-level folders without asking.
Do not put components in /app — only pages and layouts go there.
```
### 6. 現在のゴール
これはほとんどの人が忘れるセクションです。今まさに何に取り組んでいるかをClaudeに伝えます。
```markdown
## Current Sprint Goals
- Build the signal card component with RSI, MACD, and BB indicators
- Connect to Supabase real-time for live updates
- Add a filter bar to sort signals by strength and timeframe
- Optimize for mobile — the dashboard must be fully usable on phone
Not working on authentication this sprint. Do not suggest auth-related changes.
```
これでClaudeの集中を維持できます。これがなければ、今取り組もうとしていない問題でもClaudeは喜んで解決しようとします。
### 7. コンテキストと背景
プロジェクトの歴史・すでに決まった決定・制約について、Claudeが知る必要があることを追加します。
```markdown
## Important Context
- We already tried using Socket.io for real-time — it caused memory leaks on Vercel.
We switched to Supabase real-time. Do not suggest Socket.io.
- The Binance API rate limit is 1200 requests per minute per IP.
Always account for this when writing fetch logic.
- The bot currently runs on a $6/month VPS. Keep dependencies lean.
- This project started as a personal tool and is now a paid product on Gumroad.
Code quality matters — this is not a throwaway script.
```
このセクションにより、すでに却下したことをClaudeが提案するのを防ぎます。セッションをまたいで同じことを繰り返さずに済みます。
## コピーして使えるCLAUDE.mdテンプレート
自分のプロジェクト用にカスタマイズできる完全なテンプレートを紹介します。
```markdown
# CLAUDE.md
## Project Overview
[プロジェクトが何をするかを2〜3文で説明。誰のためのもの?どんな問題を解決する?]
## Tech Stack
- Framework: [例: Next.js 14 App Router]
- Styling: [例: Tailwind CSS]
- Language: [例: TypeScript]
- Database: [例: Supabase]
- Auth: [例: Supabase Auth]
- Deployment: [例: Vercel]
- Package manager: [例: pnpm]
- State management: [例: Zustand]
## Coding Conventions
- [命名規則を列挙]
- [構文の好みを列挙]
- [コンポーネント構造のルールを列挙]
- [コメントのルールを列挙]
- [型付けのルールを列挙]
## Never Do This
- Never install packages without asking
- Never rewrite files I did not ask you to touch
- [自分の制約を追加]
## File Structure
[ディレクトリツリーをここに貼り付けて各フォルダに注釈を付ける]
## Current Goals
[今週またはこのスプリントで積極的に構築していることを列挙]
[今はスコープ外であることを明示的に列挙]
## Important Context
[過去の決定・制約・注意点についてClaudeが知る必要があること]
## Communication Style
- Be direct. Skip the preamble.
- If you are unsure about something, ask before writing code.
- When you make a change, tell me what you changed and why in one sentence.
- Flag anything that looks like a potential bug or architectural issue, even if I did not ask.
```
## グローバルCLAUDE.md:個人設定のレイヤー
プロジェクトレベルのCLAUDE.mdファイルをしばらく使っていると、パターンに気づきます。すべてのプロジェクトで使いたい規約、あなたがコードを書く上でのやり方として定着した好み。
それがグローバルCLAUDE.mdの目的です。
```bash
mkdir -p ~/.claude
touch ~/.claude/CLAUDE.md
```
次に普遍的な設定を書き込みます。
```markdown
# Global CLAUDE.md — Cyril's Defaults
## My Defaults Across All Projects
- I prefer TypeScript over JavaScript always
- I use pnpm as my package manager
- I write arrow functions not function declarations
- I prefer explicit types over inferred ones in function signatures
- Keep responses concise — I do not need lengthy explanations unless I ask
- If something I asked for is technically possible but a bad idea, tell me first
## Communication Rules
- Do not start responses with "Great question" or "Certainly"
- Be direct and skip filler sentences
- When writing code, write the code first and explain after if needed
- Do not suggest I read documentation unless you cannot answer the question
## Things I Never Want
- Placeholder comments in code
- Console.log in any code I will deploy
- Unsolicited refactors of things I did not ask about
- Default exports in React components
```
これがすべてのプロジェクトでバックグラウンドとして機能します。プロジェクトレベルのCLAUDE.mdと合わせると、Claudeは常に2層のコンテキストで動作します。
## 応用:コード以外のプロジェクトにCLAUDE.mdを使う
CLAUDE.mdはコードだけのためではありません。
執筆・リサーチ・コンテンツワークフローにClaude Codeを使っている場合も、同じファイルを使ってそれらのコンテキスト向けの行動ルールを設定できます。
コンテンツプロジェクトの例を示します。
```markdown
# CLAUDE.md — Content Operations
## Project Overview
This folder contains my article pipeline for cyrilXBT.
I write about AI tools, crypto trading, and productivity for solo builders.
My audience is intermediate to advanced. They do not need hand-holding.
## Writing Style Rules
- Write in first person
- Use short punchy sentences
- Avoid the word "utilize" — use "use"
- Avoid "leverage" as a verb
- No em dashes
- No bullet points in articles unless it is a list that genuinely needs them
- Capitalization is used for emotional emphasis — LIKE THIS — not randomly
- Conversational but never casual to the point of being sloppy
## What I Never Want in My Articles
- Phrases like "in today's fast-paced world"
- Passive voice where active voice works
- Filler intros that take more than 2 sentences to get to the point
- Conclusions that just summarize what I already said
## Tone
Direct. Opinionated. Personal. Written like someone who has actually done the thing.
Not a tutorial robot. Not a corporate blog. A real person sharing what works.
```
これでClaudeは最初の文からあなたの文体で書きます。毎回。
## CLAUDE.mdでよくある間違い
**間違い1:曖昧すぎる**
悪い例:「クリーンなコードを書く。」
良い例:「named exportを使い、kebab-caseのファイル名にし、default exportは使わない。」
曖昧な指示は何もないよりはましですが、解釈の余地を残しすぎます。具体的に書きましょう。
**間違い2:一度書いて二度と更新しない**
プロジェクトは進化します。CLAUDE.mdもそれに合わせて進化させましょう。大きなアーキテクチャ上の決定を下したり、あるアプローチを却下したりするたびに、ファイルに追記します。
私はスプリントの終わりに毎回更新しています。
**間違い3:コンテキストの代わりにゴールを書く**
CLAUDE.mdはToDoリストではありません。ブリーフィング文書です。ゴールはCurrent Sprintセクションに書くのは良いですが、ファイルの残りは週ごとに変わらない安定したコンテキストであるべきです。
**間違い4:NEVERセクションを忘れる**
経験豊富な開発者にとって最も価値のあるセクションです。あなたはすでに何が嫌いかを知っています。書き留めましょう。Claudeがそれをやらなくなります。
**間違い5:グローバルファイルを持っていない**
プロジェクトレベルのファイルだけを使っているなら、すべてのプロジェクトに同じ設定を書き直しています。グローバルCLAUDE.mdに20分使えば、その設定を二度と書く必要はありません。
## 本当の解放:CLAUDE.md + カスタムコマンド
CLAUDE.mdが固まったら、次のレベルはClaude Codeのスラッシュコマンドと組み合わせることです。
Claude Codeでは`.claude/commands/`にMarkdownファイルとしてカスタムコマンドを作れます。各ファイルが`/command-name`で呼び出せる再利用可能なコマンドになります。
例として`.claude/commands/new-component.md`を作成します。
```markdown
Create a new React component with the following requirements:
- TypeScript functional component
- Named export only
- Tailwind for styling
- Props interface defined above the component
- Place in src/components/features/ unless I specify otherwise
- File name in kebab-case
Ask me for the component name and purpose before writing anything.
```
`/new-component`と入力すれば、Claudeはすでに完全な仕様を把握しています。
CLAUDE.mdがプロジェクト全体のコンテキストを担います。
スラッシュコマンドがタスク固有のワークフローを担います。
組み合わせることで、Claude Codeが本当にチームのベテラン開発者のように感じられるものになります。
## 最後に
Claude Codeから最大の成果を引き出している開発者は、最も巧みなプロンプトを書く人ではありません。
30分投資してCLAUDE.mdを書き、そのファイルにプロンプティングを任せた人たちです。
毎セッション自分を説明するのをやめましょう。
ファイルを書きましょう。コンテキストを固定しましょう。Claudeに働かせましょう。
以上です。

CLAUDE.mdClaude Codeclaude-setup
CLAUDE.mdファイルの完全ガイド——Claude Codeを本当に言うことを聞かせる方法
♥ 294↻ 37
原文を表示 / Show original
CyrilXBT
@cyrilXBT
How to Build a CLAUDE.md File That Makes Claude Code Actually Listen to You - FULL GUIDE
11
43
294
267K
Most people using Claude Code are doing it wrong.
They open a new project, start typing prompts, and wonder why Claude keeps forgetting the rules, ignoring their stack, or writing code that looks nothing like what they asked for.
The problem is not Claude.
The problem is you never told Claude who you are, what you are building, or how you want it to behave.
That is what a CLAUDE.md file is for.
This is the single most underrated feature in Claude Code. Once you understand it, you will never go back to raw prompting. This guide covers everything: what a CLAUDE.md file is, why it matters, how to structure it, and the exact templates I use for my own projects.
Let us get into it.
What Is a CLAUDE.md File?
When you run Claude Code inside a project folder, it automatically looks for a file called CLAUDE.md in the root of that directory.
If it finds one, it reads the entire file before doing anything else.
Think of it as a persistent system prompt that travels with your project. Every time you start a session, Claude already knows:
What the project is
What stack you are using
What coding conventions you follow
What it should never do
What your goals are
This is the difference between a junior dev who needs constant hand-holding and a senior dev who gets it from day one.
One file. Permanent context. Zero repeated instructions.
Why Most People Skip This (And Why That Is Expensive)
Here is what happens when you do not use a CLAUDE.md file.
You spend the first 5 minutes of every session re-explaining your project. Claude writes code using the wrong framework. It uses naming conventions you hate. It adds comments you never asked for. It suggests packages you already decided against three weeks ago.
You correct it. It forgets. You correct it again.
That is not a productivity tool. That is a very fast typist who needs babysitting.
A CLAUDE.md file eliminates almost all of this. It is the difference between Claude acting like a first-day hire and Claude acting like someone who has been on your team for months.
The time investment to write a good CLAUDE.md is 20 to 30 minutes.
The time you get back is EVERY session after that.
Where to Put the File
Claude Code checks for CLAUDE.md in three places:
Project root — The main one. Claude reads this at the start of every session inside that folder.
Subdirectories — If you have a monorepo, you can have a CLAUDE.md in each subfolder. Claude reads the relevant one based on where you are working.
Your home directory — A global ~/.claude/CLAUDE.md that applies to ALL your projects. Great for personal preferences that never change.
For most people, start with the project root. Add a global one once you know your permanent preferences.
The Anatomy of a High-Performance CLAUDE.md
Here is the structure I use. Each section serves a specific purpose. Do not skip sections. Every missing piece is a gap where Claude will default to its own judgment.
1. Project Overview
Start with a plain-English description of what the project is. One or two paragraphs. No fluff.
## Project Overview
This is a crypto signal bot dashboard built with Next.js and Tailwind.
It scans 98 trading pairs every 58 seconds using RSI, MACD, and Bollinger Bands
and displays live signals in a dark-mode UI.
The target user is a retail crypto trader who wants clean, fast signals
without noise. Speed and clarity are the two non-negotiable priorities.
Claude now knows the domain, the user, and the priorities. Every decision it makes will be filtered through this context.
2. Tech Stack
Be explicit. List everything.
## Tech Stack
- Framework: Next.js 14 (App Router)
- Styling: Tailwind CSS only — no CSS modules, no styled-components
- Language: TypeScript strict mode
- Database: Supabase (Postgres)
- Auth: Supabase Auth
- Deployment: Vercel
- Package manager: pnpm
- State: Zustand
- Charts: Recharts
If you leave this out, Claude will make assumptions. Sometimes right. Often wrong.
3. Coding Conventions
This is where most CLAUDE.md files fall short. You need to be specific about how you write code, not just what you use.
## Coding Conventions
- Use named exports for all components — no default exports
- File names use kebab-case: signal-card.tsx, not SignalCard.tsx
- Component names use PascalCase
- All functions use arrow function syntax
- No var — only const and let
- Prefer early returns over nested conditionals
- Add JSDoc comments only for exported utility functions
- Never use any — always type explicitly
- Keep components under 150 lines — extract if larger
- Co-locate types with the file that uses them unless shared across 3+ files
This is the stuff Claude gets wrong constantly without guidance. Write it once. Never correct it again.
4. What Claude Should NEVER Do
This section is underused and it is one of the most powerful.
## Never Do This
- Never install a new package without asking me first
- Never rewrite a component I did not ask you to touch
- Never use useEffect for data fetching — use React Query
- Never add console.log statements to production code
- Never use inline styles
- Never suggest switching the framework or database
- Never add placeholder comments like "// TODO: implement this"
- Never use emojis in code comments
- Never wrap everything in a try/catch without telling me
Claude is helpful by nature. Sometimes TOO helpful. It will refactor things you did not ask it to refactor. It will add error handling you did not want. It will suggest a different approach mid-task.
The NEVER section puts hard stops on this behavior.
5. File Structure
Show Claude how your project is organized.
## File Structure
src/
app/ # Next.js App Router pages
components/ # Shared UI components
ui/ # Primitive components (buttons, inputs, etc.)
features/ # Feature-specific components
lib/ # Utility functions and helpers
hooks/ # Custom React hooks
stores/ # Zustand stores
types/ # Shared TypeScript types
styles/ # Global styles only
Do not create new top-level folders without asking.
Do not put components in /app — only pages and layouts go there.
6. Current Goals
This is the section most people forget. Tell Claude what you are actively working on RIGHT NOW.
## Current Sprint Goals
- Build the signal card component with RSI, MACD, and BB indicators
- Connect to Supabase real-time for live updates
- Add a filter bar to sort signals by strength and timeframe
- Optimize for mobile — the dashboard must be fully usable on phone
Not working on authentication this sprint. Do not suggest auth-related changes.
This keeps Claude focused. Without it, Claude will happily solve problems you are not trying to solve right now.
7. Context and Background
Add anything else Claude needs to know about the project history, decisions already made, or constraints.
## Important Context
- We already tried using Socket.io for real-time — it caused memory leaks on Vercel.
We switched to Supabase real-time. Do not suggest Socket.io.
- The Binance API rate limit is 1200 requests per minute per IP.
Always account for this when writing fetch logic.
- The bot currently runs on a $6/month VPS. Keep dependencies lean.
- This project started as a personal tool and is now a paid product on Gumroad.
Code quality matters — this is not a throwaway script.
This section prevents Claude from suggesting things you already ruled out. It saves you from repeating yourself across sessions.
A Full CLAUDE.md Template You Can Copy
Here is a complete template ready to customize for your own projects.
# CLAUDE.md
## Project Overview
[Describe what the project does in 2 to 3 sentences. Who is it for? What problem does it solve?]
## Tech Stack
- Framework: [e.g. Next.js 14 App Router]
- Styling: [e.g. Tailwind CSS]
- Language: [e.g. TypeScript]
- Database: [e.g. Supabase]
- Auth: [e.g. Supabase Auth]
- Deployment: [e.g. Vercel]
- Package manager: [e.g. pnpm]
- State management: [e.g. Zustand]
## Coding Conventions
- [List your naming conventions]
- [List your syntax preferences]
- [List your component structure rules]
- [List your commenting rules]
- [List your typing rules]
## Never Do This
- Never install packages without asking
- Never rewrite files I did not ask you to touch
- [Add your specific restrictions]
## File Structure
[Paste your directory tree here and annotate each folder]
## Current Goals
[List what you are actively building this week or this sprint]
[List what is explicitly OUT OF SCOPE right now]
## Important Context
[Anything Claude needs to know about past decisions, constraints, or gotchas]
## Communication Style
- Be direct. Skip the preamble.
- If you are unsure about something, ask before writing code.
- When you make a change, tell me what you changed and why in one sentence.
- Flag anything that looks like a potential bug or architectural issue, even if I did not ask.
The Global CLAUDE.md: Your Personal Preferences Layer
Once you have used project-level CLAUDE.md files for a while, you will notice patterns. Conventions you want in EVERY project. Preferences that are just how you code.
That is what the global CLAUDE.md is for.
Create it here:
mkdir -p ~/.claude
touch ~/.claude/CLAUDE.md
Then fill it with your universal preferences:
# Global CLAUDE.md — Cyril's Defaults
## My Defaults Across All Projects
- I prefer TypeScript over JavaScript always
- I use pnpm as my package manager
- I write arrow functions not function declarations
- I prefer explicit types over inferred ones in function signatures
- Keep responses concise — I do not need lengthy explanations unless I ask
- If something I asked for is technically possible but a bad idea, tell me first
## Communication Rules
- Do not start responses with "Great question" or "Certainly"
- Be direct and skip filler sentences
- When writing code, write the code first and explain after if needed
- Do not suggest I read documentation unless you cannot answer the question
## Things I Never Want
- Placeholder comments in code
- Console.log in any code I will deploy
- Unsolicited refactors of things I did not ask about
- Default exports in React components
This runs in the background for every project. Combined with a project-level CLAUDE.md, Claude operates with two layers of context at all times.
Advanced: Using CLAUDE.md for Non-Code Projects
CLAUDE.md is not just for code.
If you are using Claude Code for writing, research, or content workflows, you can use the same file to set behavioral rules for those contexts.
Here is an example for a content project:
# CLAUDE.md — Content Operations
## Project Overview
This folder contains my article pipeline for cyrilXBT.
I write about AI tools, crypto trading, and productivity for solo builders.
My audience is intermediate to advanced. They do not need hand-holding.
## Writing Style Rules
- Write in first person
- Use short punchy sentences
- Avoid the word "utilize" — use "use"
- Avoid "leverage" as a verb
- No em dashes
- No bullet points in articles unless it is a list that genuinely needs them
- Capitalization is used for emotional emphasis — LIKE THIS — not randomly
- Conversational but never casual to the point of being sloppy
## What I Never Want in My Articles
- Phrases like "in today's fast-paced world"
- Passive voice where active voice works
- Filler intros that take more than 2 sentences to get to the point
- Conclusions that just summarize what I already said
## Tone
Direct. Opinionated. Personal. Written like someone who has actually done the thing.
Not a tutorial robot. Not a corporate blog. A real person sharing what works.
Now Claude writes in your voice from the first sentence. Every time.
Common Mistakes People Make With CLAUDE.md
Mistake 1: Being too vague
Bad: "Write clean code."
Good: "Use named exports, kebab-case file names, and no default exports."
Vague instructions are better than nothing but they still leave too much to interpretation. Be specific.
Mistake 2: Writing it once and never updating it
Your project evolves. Your CLAUDE.md should evolve with it. Any time you make a major architectural decision or rule out an approach, add it to the file.
I update mine at the end of every sprint.
Mistake 3: Putting goals in instead of context
Your CLAUDE.md is not a to-do list. It is a briefing document. Goals are fine in the Current Sprint section but the rest of the file should be stable context that does not change week to week.
Mistake 4: Forgetting the NEVER section
This is the most valuable section for experienced developers. You already know what you hate. Write it down. Claude will stop doing it.
Mistake 5: Not having a global one
If you are only using project-level files, you are re-writing the same preferences across every project. Spend 20 minutes on your global CLAUDE.md and you never have to write those preferences again.
The Real Unlock: CLAUDE.md + Custom Commands
Once your CLAUDE.md is solid, the next level is combining it with Claude Code slash commands.
Claude Code lets you create custom commands in .claude/commands/ as markdown files. Each file becomes a reusable command you can call with /command-name.
For example, create .claude/commands/new-component.md:
Create a new React component with the following requirements:
- TypeScript functional component
- Named export only
- Tailwind for styling
- Props interface defined above the component
- Place in src/components/features/ unless I specify otherwise
- File name in kebab-case
Ask me for the component name and purpose before writing anything.
Now type /new-component and Claude already knows the full spec.
Your CLAUDE.md handles the project-wide context.
Your slash commands handle the task-specific workflows.
Together they turn Claude Code into something that actually feels like a senior dev on your team.
Final Thoughts
The developers getting the most out of Claude Code are not the ones with the cleverest prompts.
They are the ones who invested 30 minutes up front to write a CLAUDE.md that does the prompting for them.
Stop explaining yourself every session.
Write the file. Lock in the context. Let Claude work.
That is it.
If this helped you, follow me on X at @cyrilXBT. I post about building with AI, crypto, and how to actually use these tools to ship faster.
Want to publish your own Article?
Upgrade to Premium
11:00 PM · Apr 21, 2026
·
267.2K
Views
11
43
294
982
Read 11 replies