Nest CLAUDE.md Files for Monorepo Context
If your project has multiple distinct areas — a frontend, a backend, and a shared library — a single top-level CLAUDE.md can only do so much. Claude Code reads CLAUDE.md files from the current directory upward, so you can layer them.
my-monorepo/
├── CLAUDE.md # General project rules and conventions
├── frontend/
│ └── CLAUDE.md # React + Tailwind specifics
└── api/
└── CLAUDE.md # Laravel API conventions
When Claude Code is running inside the api/ directory, it picks up both the root CLAUDE.md and the api/ one automatically, merging the context. The subdirectory file wins for any conflicts.
Use this to encode module-specific rules that would be noise everywhere else — things like "always use the Repository pattern here", "this service uses snake_case for routes", or "never import directly from the database layer."
my-monorepo/api/CLAUDE.md
---
- Use the Repository pattern for all database access
- Routes follow snake_case naming (e.g. /user_accounts, not /userAccounts)
- All controllers extend BaseApiController
Stack your CLAUDE.md files like config files — general at the root, specific where it counts.
Log in to leave a comment.
The autoUpdatesChannel setting pins Claude Code to a stable release track that skips versions with major regressions.
The language setting makes Claude respond in your preferred language by default, across every session and project.
The attribution setting lets you customize or completely remove Claude's Co-Authored-By trailer from git commits and pull requests.