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.
The design inspiration for CLAUDE.md comes from the concept of project-level configuration files such as .editorconfig and .eslintrc
Claude Code supports multi-level CLAUDE.md instruction files, including three levels: global (~/.claude/CLAUDE.md), project root directory, and subdirectory.
Timeline (last 90 days)
In herdr, the main Claude Code session can automatically hand mechanical work to Codex based on routing rules in CLAUDE.md, open a Codex pane, wait for its status without polling, and stop to ask the user when Codex hits an approval prompt.
CLAUDE.md is a description file placed in the project root directory; the Agent automatically reads it at startup to inject the project structure, coding standards, and points to note.
OpenCode V2 only reads AGENTS.md and is completely incompatible with CLAUDE.md; even putting CLAUDE.md into the instructions setting will not cause it to be loaded.
Markdown files (such as CLAUDE.md) are loaded once at the start of a session and then frozen, making them snapshots rather than memory.
Anthropic's official cost-reduction article recommends running a prompt audit command on instruction files (such as CLAUDE.md) and reports that removing redundant patterns reduces costs by an additional approximately 9%.
The author's standing prefix (containing CLAUDE.md rules, skill descriptions, and tool instructions) has a median of 81,000 tokens, accounting for only 3.2% of the main thread's cache writes.
Keeping CLAUDE.md concise and migrating large workflows to Skills can reduce the baseline context size for everyday conversations.
A lean CLAUDE.md configuration sends 16,500 tokens, while a bloated version (356-line CLAUDE.md, 20 skills, 3 MCP servers) sends 21,500 tokens per message.
In software engineering community practice, files such as agents.md or CLAUDE.md are placed in the root directory of a code repository to provide AI coding agents with project-level context and behavioral specifications.
In the rules-guard hook, if Jev is at least 80% confident that a rule has been violated, the edit is directly blocked and Claude is informed which rule was violated.
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%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%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是Anthropic推出的Claude Code所支持的一种项目级配置文件
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.md文件让Claude Code在每次启动时自动读取项目规范,实现跨会话的记忆功能
80%VerifiedClaude Code 的 /init 指令可以扫描当前项目的文件结构并自动生成一份适合该项目的 CLAUDE.md
80%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.
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%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.
70%VerifiedThe contents of CLAUDE.md are appended to the prompt, becoming the contextual foundation for every conversation.
65%VerifiedAs a project file, CLAUDE.md can be incorporated into the Git version control system, allowing team members to review and iterate on specification content via Pull Requests.
65%VerifiedClaude Code uses the CLAUDE.md file as its memory file, and Cursor uses the .cursorrules file.
65%VerifiedClaude Code's command files can be incorporated into a Git repository for version management, allowing team members to share the same set of workflows.
65%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.
65%UnverifiedCLAUDE.md是Claude在每个会话开始时自动读取的上下文文件,根文件提供全局视图,子目录文件提供本地约定
95%Unverified文章提出 CLAUDE.md 的六段式结构包括:项目概述、功能要求、技术栈、项目目录结构、代码规范、约束条件
95%UnverifiedAnthropic设计了CLAUDE.md的分层配置体系,支持项目根目录、子目录和用户主目录三个层级
90%Unverified作者建议将 CLAUDE.md 控制在 500 字以内,只保留真正影响行为的核心规则
90%