CLAUDE.md
CLAUDE.md is a project-level context configuration file for the Claude AI coding assistant, typically placed in the root directory of a code repository. Written in Markdown format, the file is used to provide Claude with project background, technical specifications, coding conventions, and specific instructions, enabling it to follow project-specific rules and context during code generation and development assistance, thereby improving collaboration efficiency and output quality.
Core Facts
The core carrier of Claude Code's Skills is the CLAUDE.md file, placed in the project root directory or a specific directory.
AGENTS.md is a common naming convention that has emerged in the AI programming tools ecosystem, and tools such as OpenAI Codex and Cursor also recognize this file to varying degrees.
The design inspiration for CLAUDE.md comes from the concept of project-level configuration files such as .editorconfig and .eslintrc
Timeline (last 90 days)
CLAUDE.md has four scopes: enterprise managed policy, personal files in the user's home directory, project files committed for the team, and CLAUDE.local.md which is not checked into git; they are concatenated from broadest to most specific rather than overriding one another.
Anthropic recommends keeping each CLAUDE.md file under 200 lines.
Using @import in CLAUDE.md to split into multiple files does not save tokens, because imported files are loaded together with the importer at the same cost.
Anthropic's official documentation notes that longer instruction files encroach on context and lower instruction-following rates.
Skills are suitable for encapsulating workflows that have many steps but are not used in every conversation, whereas behavioral constraints that need to be always present should remain in global configuration such as CLAUDE.md.
CLAUDE.md is a Markdown file placed in the project root directory, loaded automatically at startup, and used to declare long-term context such as the tech stack, coding standards, and directory conventions.
CLAUDE.md should serve as a table of contents rather than a repository, keeping only content that Claude cannot learn from the codebase, such as brand voice, error message style, non-obvious architectural decisions, and pointers to detailed content in skill files.
Writing a specification file for a project (such as AGENTS.md, CLAUDE.md, etc.) can be read by most AI coding tools, thereby reducing the context cost of switching between tools.
It is recommended to keep CLAUDE.md within 200 lines and to move lengthy workflows into skills that load on demand.
In Claude Code, CLAUDE.md manages persistent background, Skills manage reusable workflows, Hooks manage mandatory checkpoints, and MCP manages external data access.
40 more timeline events
All Facts (20)
The core carrier of Claude Code's Skills is the CLAUDE.md file, placed in the project root directory or a specific directory.
90%VerifiedAGENTS.md is a common naming convention that has emerged in the AI programming tools ecosystem, and tools such as OpenAI Codex and Cursor also recognize this file to varying degrees.
85%VerifiedThe design inspiration for CLAUDE.md comes from the concept of project-level configuration files such as .editorconfig and .eslintrc
80%VerifiedClaude Code supports multi-level CLAUDE.md instruction files, including three levels: global (~/.claude/CLAUDE.md), project root directory, and subdirectory.
80%VerifiedAGENTS.md is an emerging practice in which developers place a Markdown file in the project root directory to communicate coding conventions, architectural preferences, and workflow requirements to AI coding agents.
80%VerifiedClaude Code's memory system is divided into three levels: session memory (short-term), project memory (via the CLAUDE.md configuration file), and global memory (cross-project user preferences).
80%VerifiedCLAUDE.md is a project-level configuration file supported by Claude Code, launched by Anthropic.
80%VerifiedCLAUDE.md supports multi-level configuration: the CLAUDE.md in the project root directory applies to the entire project, those in subdirectories can override or supplement higher-level configurations, and a global CLAUDE.md can be placed in the user's home directory.
80%VerifiedClaude Code's memory system simulates cross-session memory by writing key information to external files and injecting it into the context at the start of each session.
80%VerifiedCLAUDE.md文件让Claude Code在每次启动时自动读取项目规范,实现跨会话的记忆功能
80%VerifiedClaude Code's /init command can scan the current project's file structure and automatically generate a CLAUDE.md suitable for that project.
80%VerifiedAI programming assistant configuration files (such as CLAUDE.md and .cursorrules) are essentially an engineering practice of prompt engineering, solidifying scattered prompts into standardized files that can be version-controlled and shared across teams.
75%VerifiedThe claude.md file is the core configuration file for Claude Code projects and should include the tech stack, project structure, code style conventions, and prohibited items.
75%VerifiedCLAUDE.md is Claude Code's persistent system prompt mechanism, which automatically injects the file's contents to the very front of the context at startup.
75%VerifiedThe default behavior gives priority to CLAUDE.md: as long as a CLAUDE.md exists in the repository, Claude Code will not read AGENTS.md.
65%VerifiedClaude Code can use a CLAUDE.md in the repository root to carry the same project conventions as Cursor rules.
65%VerifiedAGENTS.md and CLAUDE.md are persistent system prompts written for AI agents, placed in the root directory of the code repository, and automatically read by the tool at the start of each session to load project conventions and architectural rules.
65%VerifiedClaude Code's official documentation explicitly states that it reads CLAUDE.md, not AGENTS.md.
65%VerifiedClaude Code's compatibility strategy is to read CLAUDE.md first and fall back to AGENTS.md when it is absent.
65%VerifiedAn AI tool reading a context configuration file at startup is equivalent to injecting a project-level system prompt into the model before each conversation, thereby reducing low-quality modifications caused by a lack of background knowledge.
65%