UPDATED IN SEPTEMBER 2026

CLAUDE.md with basic project info

A lean, repo-specific CLAUDE.md committed to version control is the single highest-leverage context engineering investment - it gives every AI agent the minimum viable information about what your project is and how it works.

L2 · DELEGATEDWhat this level takes
MUSTNot met, not at this level
  • CLAUDE.md or equivalent exists with project description, tech stack, and top conventions
  • Written coding conventions document exists and is referenced from agent instruction files
  • Agent instruction files are committed to the repository (not local-only)
SHOULDExpected in practice, not required
  • CLAUDE.md includes explicit prohibitions (banned libraries, anti-patterns)
  • Agent instruction files are reviewed as part of the standard PR process
EVIDENCEHow you would check
  • CLAUDE.md, .cursorrules, or .github/copilot-instructions.md in repository root
  • Coding conventions document accessible from agent instruction files
  • Commit history showing agent instruction file updates

What It Is

CLAUDE.md is a special file that Claude Code reads automatically when it starts a session in your repository. It's the AI equivalent of the onboarding document you wish you'd had on your first day: it tells the agent what the project is, how to run it, what the tech stack looks like, and what conventions to follow. Other tools have their own equivalents: .cursorrules for Cursor, .github/copilot-instructions.md for GitHub Copilot, AGENTS.md for OpenAI Codex.

The concept is simple: a markdown file in your repository root that provides project-level context to any AI agent that reads it. Before this file exists, every agent session starts from zero - the agent knows nothing about your project beyond the file currently open. After this file exists, every session starts with the minimum viable context: what this project is, how it fits together, and what the agent needs to know to not make obvious mistakes.

At L2 (Delegated), the CLAUDE.md file typically contains basic project information: the tech stack, how to install and run the project, a brief architectural overview, key directories and their purposes, and the most important do's and don'ts. It doesn't need to be comprehensive to be valuable - even a 200-line CLAUDE.md dramatically improves suggestion quality compared to no file at all.

The transition from L1 to L2 is largely defined by the creation of this file. It's the first act of intentional context engineering: the team explicitly decides what information the agent needs and writes it down in a form the agent can use.

Why It Matters

The impact of a CLAUDE.md file is disproportionate to its size. A few hundred lines of well-chosen content can prevent thousands of wrong suggestions across the team:

  • Eliminates the most common class of wrong suggestions - tech stack mismatches, wrong import paths, missing required configuration, use of deprecated APIs
  • Applies to all developers on the team - unlike a developer's personal "context preamble" habit, a committed CLAUDE.md benefits everyone who opens the repo
  • Persists across sessions - context you've written down doesn't disappear when you close the chat window
  • Scales with the team - new developers get better AI suggestions from day one, without learning what manual context to provide
  • Creates a foundation for L3 - the CLAUDE.md file is the substrate on which more sophisticated context engineering builds

The measurable impact shows up in the code rather than on the vendor dashboard: within the first week, suggestions stop violating project conventions and start following them, which reaches the team as fewer correction passes in review. Do not try to read that change off suggestion acceptance rate - DECODE's instrumented study of 53.6K in-IDE edits found 31% of accepted completions deleted outright, most of them within fifteen minutes, so the number rises whether or not the suggestions were worth keeping.

August produced the first large-sample evidence that committing the file is the part that counts, not merely writing one. A study of 441 repositories (arXiv 2608.25241, August 26) found that agents produced 28-38% more commits, and that repositories without committed AI configuration saw twice the cognitive-complexity increase - +53% against +27% - along with 1.7x the static-analysis warnings. The same study found that 73.8% of AI configuration files were committed once and never touched again, which is precisely the staleness failure this guide warns about below.

TIP

Write your CLAUDE.md as if you're briefing a capable contractor who is starting work on your codebase tomorrow. They're smart and experienced, but they know nothing about your project. What do they absolutely need to know in the first 10 minutes?

Getting Started

  1. Create the file - Add CLAUDE.md to your repository root. For Cursor users, add .cursorrules instead (or in addition). For GitHub Copilot, add .github/copilot-instructions.md. For Codex and the growing set of tools that read AGENTS.md, a symlink keeps one file authoritative: Anthropic closed the native-support request on August 17 without adding native support, and the symlink is the accepted answer.
  2. Write the project overview section - One paragraph: what this project does, what problem it solves, what kind of application it is. Include the primary language and framework.
  3. Document the tech stack - List the key dependencies with a one-line description of each. Include version constraints if they matter (e.g., "We use React 18 - do not suggest React 19 features").
  4. Add setup and run instructions - The commands needed to install dependencies, run tests, and start the development server. Keep these in sync with the README.
  5. Capture the top 5 conventions - What are the most important rules that aren't enforced by linters? Architecture patterns, naming conventions, module boundaries, state management rules. These are the ones agents most commonly violate.
  6. Add a "what not to do" section - Explicit don'ts prevent agents from confidently suggesting patterns you've rejected. "Do not use any types in TypeScript." "Do not add new npm dependencies without team discussion." "Do not write SQL queries outside of the repository layer."

Common Pitfalls

Making it too long too fast. The temptation is to document everything at once. A 3,000-line CLAUDE.md that takes weeks to write and never gets committed is worse than a 200-line file committed today. Start minimal: project overview, tech stack, setup instructions, top 5 conventions. Add to it as you discover what's missing.

Letting it go stale. A CLAUDE.md that describes the wrong tech stack is worse than no CLAUDE.md - it gives agents incorrect context confidently. Add a "last updated" date and a team norm that architecture changes require a CLAUDE.md update alongside the code change.

Treating it as a style guide. Style guide content (use 2-space indentation, sort imports alphabetically) belongs in linter configuration, not CLAUDE.md. The CLAUDE.md is for semantic conventions the linter can't enforce: when to use a service vs. a repository, how to structure feature modules, what belongs in shared utilities vs. domain logic.

Not committing it to the repo. CLAUDE.md files stored locally on one developer's machine don't help the team. Commit it to version control so every developer - and every agent session - benefits.

Forgetting that committed agent config is executable. The ChainDrop compromise on August 4 planted persistence in .vscode/tasks.json (runOn: folderOpen) and .claude/settings.json (SessionStart), so opening the repository or starting an agent session ran the payload with no npm install involved. The moment you commit agent configuration, it joins the set of files that execute on someone else's machine. Put .claude/, .vscode/, .cursor/ and .gemini/ on a mandatory-diff path in code review, and disable auto-run hooks for workspaces you did not write.

How Different Roles See It

BobHEAD OF ENGINEERING

Bob's team has been complaining that AI suggestions are inconsistent - they work great for some developers and not others. He suspects it has to do with the senior engineers' habit of providing detailed context in their prompts, while junior engineers just describe the immediate task. He's right, but he doesn't know how to systematize it.

What Bob should do: Bob should sponsor a "CLAUDE.md sprint" - one dedicated afternoon where one senior engineer per team produces the first version of a CLAUDE.md for their primary repository. Bob's goal for this sprint is not perfection; it's existence. A basic CLAUDE.md committed to every main repository within the quarter. He should then compare the teams that complete the sprint against those that haven't on signals that survive review - how often an AI-assisted change comes back for a correction pass, and the static-analysis warning count on new code - which gives him the ROI data he needs to continue investing in context engineering.

SarahPRODUCTIVITY LEAD

Sarah has been trying to understand why AI adoption is so uneven across teams. She runs a survey and finds that developers in teams without shared context files (CLAUDE.md, .cursorrules) rate AI tools much lower than developers in teams that have them. The pattern is clear, but she hasn't been able to make the business case for investing time in these files.

What Sarah should do: Sarah should calculate the "context tax" - the time each developer spends per week manually providing project context in prompts before the agent can help effectively. Even if the estimate is rough (say, 15 minutes per developer per day in a team without CLAUDE.md), the math quickly justifies the one-time investment of writing the file. A 10-person team spending 15 minutes/day = 2.5 engineer-hours per day = 600+ engineer-hours per year spent on a problem a 200-line file could fix.

VictorSTAFF ENGINEER - AI CHAMPION

Victor has been the unofficial "AI whisperer" on his team - developers come to him when they're getting bad suggestions, and he shows them the right context to provide. He's been doing this for months and realizes he's essentially teaching the same 10 things over and over.

What Victor should do: Victor's teaching material is the content of a CLAUDE.md file. He should take the 10 things he consistently explains, write them up as a structured context file, commit it to the main repositories, and point developers to it instead of repeating himself. Then he should go further: write a brief guide for the team on how to interpret and extend the CLAUDE.md file, and propose a quarterly review process where the team discusses what should be added based on recent agent errors. Victor is the right person to drive this from technical judgment; Bob should provide the organizational mandate.

How This Guide Changed

What each edition changed in this guide, newest first.

  1. V1.6September 2026LATEST

    Two August findings pull this practice in opposite and equally useful directions. A study across 441 repositories found that repos without committed AI configuration accumulated cognitive complexity twice as fast as those with it, +53% against +27%, which is the strongest argument yet that the file belongs in version control rather than in one developer's home directory - and in the same breath found that 73.8% of those files were committed once and never edited again. Meanwhile the ChainDrop supply-chain attack planted its persistence in .claude/settings.json and .vscode/tasks.json, so merely opening the repository executed it. Committed agent configuration is code that runs on other people's machines, and this guide now says so, with a review-path pitfall to match.

  2. V1.5August 2026

    Anthropic's July 24 context engineering guidance marks the direction of travel for this practice: prune CLAUDE.md down to repo-specific gotchas only - the things an experienced engineer would still get wrong on day one - and stop hand-maintaining everything else. Auto-memory now replaces much of the manual curation loop (the "add what the agent got wrong" ritual happens automatically), and rich references beat prose: pointing the agent at real code, test suites, and executable examples specifies behavior better than markdown descriptions of it. The basics below still apply at L2 - a CLAUDE.md is still the highest-leverage first step - but write it lean from the start rather than growing it into a 3,000-line manual you will later have to cut.

  3. V1.3June 2026

    A month of housekeeping. Three references had moved: Cursor's rules documentation, the community collection of CLAUDE.md examples now maintained outside Anthropic's org, and Sourcegraph's write-up on context files, which had been folded into a broader piece on the anatomy of a coding assistant. The guidance itself stood.

  4. V1.0March 2026

    The opening entry framed CLAUDE.md as the onboarding document you wish somebody had handed you on your first day, written for a reader who arrives with no memory whatsoever. Its claim was about the L1 to L2 boundary rather than about file format: the moment a team decides what an agent needs to know and writes it down is the moment context engineering becomes intentional. Two hundred lines was the size suggested, a number later editions would argue down.

Where does your team actually sit on this?

This guide describes one level of one area. Run the assessment to place your team across all 16 areas, see which gates you have passed, and get a report you can take to your stakeholders.

Start the assessment