CLAUDE.md Configuration Guide for Engineering Teams
Learn how to structure CLAUDE.md files for your engineering team. A practical guide for technical leads using Claude Code across a shared codebase.
TL;DR: Learn how to structure CLAUDE.md files for your engineering team. A practical guide for technical leads using Claude Code across a shared codebase.
A CLAUDE.md file is a configuration document that sits in your repository root and instructs Claude Code how to behave in that project. It defines what conventions to follow, what directories to avoid, what commands require human review, and what testing requirements apply before any change is considered complete. Without it, Claude Code operates on defaults, and those defaults know nothing about your stack, your standards, or your client commitments.
The practical consequence of a missing CLAUDE.md is output variance at scale. Each engineer in a 15-person team running Claude Code without shared configuration is effectively setting their own rules through ad hoc prompts and personal habits. The same refactoring task produces different results in different styles. A project-level CLAUDE.md eliminates that variance by establishing a consistent floor of behaviour across every session, every machine, and every engineer on the project.
Where CLAUDE.md Files Live
Claude Code reads instruction files from three locations, each with a different scope.
The repository root is where your primary CLAUDE.md should live. This is the project-level file that every team member gets automatically when they run Claude Code inside the repo. It is committed to version control like any other configuration file, which means changes are reviewed, versioned, and visible.
Subdirectory CLAUDE.md files can override or extend the root file for specific parts of the codebase. If your monorepo has a backend service with different conventions from your frontend, each subdirectory can carry its own instructions. Claude Code merges these contextually based on which files it is currently working with.
The user home directory (~/.claude/CLAUDE.md) holds personal preferences that apply across all repos on a developer's machine. This is the right place for individual style preferences, tool configuration, or personal conventions. It does not belong in version control and should not override project-level rules.
For a 10 to 20 person engineering team, the project-level file at the repo root is the one that matters most. Start there.
What Your CLAUDE.md Should Contain
The goal is to give Claude Code enough context to make good local decisions without requiring a prompt every time. There are four core categories.
Project context covers what the codebase is, what it does, and how it is structured. Claude Code should know whether it is working in a Django monolith, a Next.js frontend with a separate API layer, or a microservices architecture. Include the main directories, the primary language and framework versions, and any architecture decisions that affect how code should be written.
Coding conventions are the rules your team already enforces through review. Naming conventions, file structure expectations, preferred patterns for async handling, rules around comments, and formatting standards all belong here. If you run ESLint with a specific config, say so. If you use a particular approach to dependency injection, document it. Claude Code will follow explicit conventions more reliably than it will infer them from surrounding code.
Testing approach tells Claude how your team writes and runs tests. Which framework do you use? Do you write tests alongside implementation or after? Are there test utilities or factories it should reuse? Is there a naming convention for test files? Without this, Claude will generate tests in whatever style feels natural to the model, which may not match what your CI pipeline expects.
Prohibited actions are explicit constraints. These might include: do not modify the database migration files directly, do not add new third-party dependencies without flagging them, do not remove error logging, do not refactor code outside the scope of the current task. Prohibited actions are where you prevent the class of well-intentioned Claude mistakes that are hardest to catch in review.
Structuring the File for a Team of 10 to 20
Length matters. A CLAUDE.md file that runs to 500 lines gets ignored, partially read, or quietly deprioritised by the model when context pressure increases. Aim for clarity over completeness.
A practical structure for a mid-sized engineering team looks like this: open with a two to three sentence description of the project and its stack. Follow with a bulleted list of coding conventions, grouped by area (naming, structure, async, error handling). Add a short testing section. Close with a list of hard constraints under a "Prohibited Actions" or "Hard Rules" heading.
Use bullet points rather than prose for anything that functions as a rule. Claude Code parses structured lists more reliably than paragraph-form instructions when applying them to specific code changes.
Keep the file under 300 lines. If it is growing beyond that, consider whether some content belongs in subdirectory files for specific modules, or whether you are trying to solve a documentation problem through AI configuration.
Common Mistakes That Reduce Effectiveness
Too vague: Writing "follow best practices" or "write clean code" gives Claude nothing actionable. Specify what best practice means in your context. "Use named exports, not default exports" is a rule Claude can apply. "Write clean code" is not.
Not updated after architecture changes: CLAUDE.md becomes a liability if it describes a stack you moved away from six months ago. Assign ownership. When a team lead merges an architecture change, updating CLAUDE.md should be part of the same pull request, not a follow-up task.
Confusing global and project config: Personal preferences (preferred terminal tools, personal style choices) belong in the home directory file, not in the project-level file. Mixing them adds noise for the model and creates friction for teammates who do not share those preferences.
Missing the scope of autonomous actions: If your team uses Claude Code in agentic mode for longer tasks, your CLAUDE.md should explicitly state what Claude is and is not allowed to do without human confirmation. Running tests without prompting is fine. Deleting files is not. State this explicitly.
The Global vs. Project Distinction in Practice
For most engineering teams, the clearest mental model is this: the global file at ~/.claude/CLAUDE.md is what you tell Claude about yourself as a developer. The project file at the repo root is what you tell Claude about the codebase it is working in.
Both files are read and merged. Project-level rules take precedence when there is a conflict. This means you can configure personal workflow preferences globally without polluting the shared project config, and project rules will always win when they matter most.
A 15-person engineering team that invests two hours in a well-structured CLAUDE.md will recoup that time within a week in reduced review corrections and fewer sessions where Claude drifts from team conventions. It is operational configuration, not documentation.
Ready to evaluate how well your team is currently set up for Claude Code adoption? Start with the AI Readiness Assessment.
FAQ
Does every developer on the team need to do anything for CLAUDE.md to take effect?
No. Once the file is committed to the repository root, Claude Code reads it automatically for any session run inside that repo. Developers do not need to configure anything individually. The file applies to every session on every machine.
Can we have different CLAUDE.md rules for different branches?
Yes, because CLAUDE.md is a committed file like any other. If you check out a feature branch that has a modified CLAUDE.md, Claude Code will use that version. This means you can experiment with new conventions in a branch before merging them into the main config.
How do we handle secrets or sensitive context in CLAUDE.md?
Do not put secrets in CLAUDE.md. The file is committed to version control and will appear in logs. If Claude Code needs to know about external services, reference them by name and pattern, not by credential. Secrets management stays in your existing secrets infrastructure.
Further Reading
- Claude Code Extended Thinking for SME Teams: How extended thinking mode affects output quality and when engineering teams should use it.
- Claude Code Agent Mode and Autonomous Workflows: A guide to running Claude Code in agentic mode for longer, multi-step development tasks.
- Claude Code Team Evaluation Scorecard: A structured framework for evaluating whether Claude Code is delivering value across your team.
- How Technical Leaders Should Choose an AI Coding Agent: A decision framework for engineering leads comparing AI coding tools on criteria that matter for team adoption.

