When your global and project-level CLAUDE.md conflict, Claude picks one silently. Here are the 5 patterns that cause it and a layered ownership model that eliminates them.
When your Claude Code agent starts doing the wrong thing, the first suspect is always your CLAUDE.md.
But there's a conflict most developers miss: **your global `CLAUDE.md` and your project-level `CLAUDE.md` can actively fight each other** — and Claude will silently pick one, or blend both in unpredictable ways.
Here's what that looks like in practice:
~/.claude/CLAUDE.md # global: "always use TypeScript strict mode" ./CLAUDE.md # project: "use loose types for prototyping"
You get inconsistent behavior. Sometimes strict. Sometimes loose. The agent acts like it's having a bad day, but it's just confused by contradictory instructions.
Claude Code loads CLAUDE.md files from multiple locations:
1. **Global** (`~/.claude/CLAUDE.md`) — applies to every project
2. **Project root** (`./CLAUDE.md`) — project-specific overrides
3. **Subdirectory** (`./src/CLAUDE.md`) — scoped to that folder
When these conflict, there's no explicit "last one wins" rule you can count on. Claude tries to reconcile them, which means sometimes it merges, sometimes it overrides, sometimes it ignores one silently.
# Global CLAUDE.md Always write concise, minimal code. No comments unless critical. # Project CLAUDE.md Document every function with JSDoc. Explain reasoning in comments.
**Result:** Agent alternates between documented and undocumented code within the same session.
# Global CLAUDE.md Prefer functional programming. Avoid classes. # Project CLAUDE.md This is an OOP codebase. Use classes and inheritance patterns.
**Result:** Agent writes hybrid code — functional methods inside classes, or breaks existing patterns.
# ~/.claude/CLAUDE.md When in doubt, ask before making changes. # ./CLAUDE.md Move fast. Make the change, then explain it.
**Result:** Agent hesitates unpredictably. Sometimes asks. Sometimes acts. No reliable behavior.
# Global: Use 2-space indentation # Project: Use 4-space indentation
**Result:** Mixed indentation across files generated in the same session.
Your global CLAUDE.md accumulates instructions over months. Older rules about past projects start leaking into your current one.
The cleanest structure that eliminates conflicts:
**Global CLAUDE.md — identity only, no project opinions:**
## Agent Identity - You are a senior developer helping me ship production code - Be direct. Skip unnecessary explanations. - When uncertain about scope, ask one clarifying question. ## Universal Rules - Never commit secrets or API keys - Always run linters before reporting "done" - Prefer reversible changes
**Project CLAUDE.md — project facts + explicit overrides:**
## Project: [Name] Stack: Next.js 14, TypeScr
// artículos relacionados
Twitter/X: 🚀 While you’re sleeping, the market is printing. I’m a futures trader, sharing my personal high…
Twitter/X: anthropic is literally crushing the new model benchmark https://t.co/Mhyy2SZtUQ
Twitter/X: EU regulator evaluating implications of Anthropic Mythos curbs after US directive https://t.co/FE…