CLAUDE.md Isn't Working — What's Going On?
One of the most common frustrations for Claude Code users is setting up a CLAUDE.md file, only to find that Claude Code seems to completely ignore it. Coding conventions get skipped, project-specific instructions are forgotten, and it feels like all that effort writing the file was wasted.
The good news is that this is almost always caused by one of a handful of fixable issues. This guide walks through each one systematically.
Common symptoms include:
- Coding conventions you defined aren't being followed
- Project-specific instructions (library names, naming conventions, etc.) are ignored
- Settings don't carry over between sessions
- Global and project-level settings seem to conflict with each other
Let's work through the most common causes in order of frequency.
Cause 1: CLAUDE.md Is in the Wrong Location
This is the single most common cause. CLAUDE.md must be placed in the root of the directory where you launch Claude Code. Here are the most frequent mistakes:
# ❌ Common mistakes
~/Projects/my-app/src/CLAUDE.md # placed inside src/
~/Projects/my-app/docs/CLAUDE.md # placed inside docs/
~/Projects/my-app/.claude/CLAUDE.md # placed in .claude/ (that's for config, not CLAUDE.md)
# ✅ Correct placement
~/Projects/my-app/CLAUDE.md # project rootYou can quickly verify this with:
# Run this in the directory where you launch Claude Code
ls -la | grep CLAUDE
# → If CLAUDE.md shows up, you're goodIf you launch Claude Code with cd ~/Projects/my-app && claude, then CLAUDE.md must live at ~/Projects/my-app/CLAUDE.md. If you're running from a subdirectory, either place a CLAUDE.md there or change your working directory when starting Claude Code.
Cause 2: Instructions Are Too Vague or Poorly Formatted
Even a correctly placed CLAUDE.md can fail to produce results if the instructions aren't written in a way Claude Code can act on clearly.
What works well:
## Coding Conventions
- Use TypeScript only (no plain JavaScript)
- Function names must use camelCase (e.g., getUserData)
- Write comments in English
- Always wrap async calls in try-catch with proper error messages
## Off-limits
- No console.log statements in commits
- No use of the `any` type
- No implementation without corresponding tests
## Project Context
This is a Next.js 15 + TypeScript + Supabase SaaS application.
All utility functions should live in src/lib/.What doesn't work as well:
Please write clean code. Use TypeScript. Handle errors properly.
Make sure to write tests too.The difference is specificity. Use bullet points, section headers, and concrete examples. Declarative statements ("use X", "don't use Y") work much better than vague suggestions.
Also keep an eye on file size. When CLAUDE.md gets too long, it consumes a significant portion of the context window and important instructions near the bottom may get less attention. Aim for under 500 lines, putting your most critical instructions at the top.
Cause 3: Global and Project Settings Are Conflicting
There are three levels of CLAUDE.md configuration:
- Global (
~/.claude/CLAUDE.md): Applies to all projects - Project (
{project-root}/CLAUDE.md): Applies to this project only - Subdirectory (
{subdirectory}/CLAUDE.md): Layered on top when working in that subdirectory
Problems arise when global and project-level settings contradict each other. For example, if your global CLAUDE.md says "write comments in English" and your project CLAUDE.md says "write comments in Japanese," the behavior can be unpredictable.
# Check your global settings
cat ~/.claude/CLAUDE.md
# Check your project settings
cat ./CLAUDE.mdThe safest approach is to keep your global CLAUDE.md minimal — just broad preferences that apply everywhere — and put all project-specific instructions in the project-level CLAUDE.md. This avoids conflicts and makes your setup easier to reason about.
Cause 4: You Edited CLAUDE.md Without Restarting Claude Code
If you edit CLAUDE.md while a Claude Code session is already running, the changes won't be picked up until you restart. CLAUDE.md is read when the session begins.
The fix is straightforward:
# After editing CLAUDE.md, restart Claude Code
exit
# Then start a new session
claudeAlternatively, the /clear command within a session may trigger a context reset that re-reads CLAUDE.md, depending on your version of Claude Code. However, restarting the session is the most reliable way to ensure changes take effect.
Cause 5: Context Compaction Is Diluting Your Instructions
During long sessions, Claude Code automatically compacts older parts of the context window when it fills up. While CLAUDE.md content is generally preserved, instructions from the beginning of a long session can gradually carry less weight as the session grows.
Here's how to handle this:
# Ask Claude Code to re-read your instructions mid-session
# Type this in the Claude Code prompt:
# "Please review the CLAUDE.md instructions and apply them going forward."
# Or use /compact to manually trigger context cleanup
/compact
# Start a fresh session to reset everything cleanly
/newPlacing your most critical instructions at the top of CLAUDE.md helps ensure they survive compaction and remain prominent throughout the session.
Quick Diagnostic Checklist
Run through these steps in order when CLAUDE.md doesn't seem to be working:
Step 1: Confirm the file exists in the right place
ls -la $(pwd)/CLAUDE.md
# → File not found? Create it or move it to the current directoryStep 2: Review the content
cat CLAUDE.md | head -50
# → Check that key instructions are near the topStep 3: Check for global setting conflicts
cat ~/.claude/CLAUDE.md 2>/dev/null || echo "No global CLAUDE.md found"
# → Look for anything that contradicts your project settingsStep 4: Restart Claude Code
# After any CLAUDE.md edit, restart the session
exit && claudeFollowing these steps in order resolves the issue in the vast majority of cases.
Looking back
When CLAUDE.md doesn't seem to be working, the cause usually falls into one of five categories: wrong file location, vague or poorly formatted instructions, conflicts between global and project settings, not restarting after edits, or context compaction during long sessions.
Work through the diagnostic checklist above and you'll identify the culprit quickly in most cases. Getting CLAUDE.md right pays dividends over the lifetime of a project — Claude Code will consistently follow your conventions without you having to repeat them in every prompt.
For a deeper look at what you can put in CLAUDE.md and how to structure it well, check out the CLAUDE.md and AGENTS.md Complete Guide.