Bible Network Crypto DeFi Onchain RWA AI Agent Stablecoin Chain SAFU CryptoTax DeFAI AGI Claude Me Claude Skill Claude Design Claude Cowork
Independent Media
Not affiliated with any project
Learn Claude Skills. Do Everything Better.
claudeskill-me.com
LATEST
Watching Claude Code Compaction and Hooks Through OpenTelemetry: Reading the compaction, hook_execution_complete and precompute_reuse Fields  ·  Blind Spots in Bash Permission Rules: deny Misses /bin/rm, bash -c and git -C, and devbox run * Lets Any Inner Command Through  ·  CLAUDE.md Too Long? Use .claude/rules/ and paths So Rules Load Only When Claude Touches Matching Files  ·  Chromium Says No usable sandbox! Inside Claude Code's Sandbox: What --no-sandbox, excludedCommands and allowNestedUserNamespaces Each Give Up  ·  Claude Code v2.1.309 Fixes a Batch of Sandbox and Permission Gaps: Startup Files Outside the Sandbox, denyWrite Through Symlinks and More  ·  The auto mode $defaults Trap: Leave One String Out of autoMode.soft_deny and the Built-In Force-Push Rules Disappear
Glossary · Workflow

CLAUDE.md

Workflow beginner

30-Second Version · For the impatient
A persistent instruction file you write for Claude Code, loaded as context at the start of every session; it is context, not enforced configuration, so hard blocks need hooks or Permission Rules.
Full Explanation +
01 · What is this?

What is CLAUDE.md?

CLAUDE.md holds persistent instructions you write for Claude Code, loaded at the start of every session. The official docs say Claude treats it as context, not enforced configuration; to Block an action regardless of what Claude decides, use a PreToolUse hook. The more specific and concise the instructions, the more consistently Claude follows them.

02 · Why does it exist?

Why does it exist?

Every Claude Code session starts with a fresh Context Window and remembers nothing of the last one. The official docs list two mechanisms for carrying knowledge across sessions: the CLAUDE.md you write, and auto memory that Claude writes itself from your corrections. CLAUDE.md is for rules and instructions, auto memory for learned habits and patterns.

03 · How does it affect your decisions?

How is it loaded?

Per the official docs: CLAUDE.md and CLAUDE.local.md in the working directory and every directory above it load at launch, concatenated rather than overriding each other, ordered from the filesystem root down to the working directory, so the closest instructions come last. Files in subdirectories load once Claude reads, writes or edits a file there. @path imports pull in other files, up to four hops deep. Scopes include managed policy, project, user and local (CLAUDE.local.md, which you should add to .gitignore). If only an AGENTS.md exists and no CLAUDE.md, Claude reads AGENTS.md; when both exist it reads only CLAUDE.md.

04 · What should you do?

So what does this mean for me?

The docs advise keeping each CLAUDE.md under about 200 lines, since longer files use more context and reduce adherence; move rules relevant to only part of the codebase into path-scoped rules under .claude/rules/. If instructions contradict each other Claude may pick one arbitrarily, so prune periodically. A huge nested CLAUDE.md causes trouble: since v2.1.309 one over the limit loads only its start, to avoid repeated Compaction. In large monorepos claudeMdExcludes skips other teams' files, and a managed policy CLAUDE.md cannot be excluded.

Sources: How Claude remembers your project - Claude Code Docs, Claude Code changelog - Claude Code Docs
Real-World Example +

From the official docs: run Claude Code in foo/bar/ and it loads foo/bar/CLAUDE.md, foo/CLAUDE.md and any CLAUDE.local.md beside them, with foo/CLAUDE.md appearing before foo/bar/CLAUDE.md. Another: the auto mode classifier reads the same CLAUDE.md content, so a line like "never force push" steers both Claude and the classifier.

Common Misconceptions +
✕ Misconception 1
× Misconception: anything written in CLAUDE.md will be obeyed, when actually: it is context, not enforced configuration; hard blocks need a PreToolUse hook or permission rules
✕ Misconception 2
× Misconception: every subdirectory CLAUDE.md loads at launch, when actually: ancestors load at launch, while subdirectory files load only once Claude reads or writes files there
The Missing Link +
Direct Impact

Pros: one text file gives every session your project rules. Cons: it consumes context, it is advice rather than enforcement, and length or contradictions reduce adherence.

Ask a Question
Please enter at least 10 characters
More Related Topics