Use CLAUDE.md to Set Project Context
A CLAUDE.md file in your project root is automatically loaded into every Claude Code conversation. Use it to define your stack, conventions, and common commands so you never have to re-explain them.
# CLAUDE.md
## Stack
- PHP 8.4, Laravel 13, Livewire 4, Tailwind CSS v4
## Commands
- `php artisan test --compact` — run tests
- `vendor/bin/pint --dirty` — format code
## Conventions
- All PHP files must use `declare(strict_types=1);`
- Use Pest for testing, not PHPUnit directly
- Service layer handles business logic — controllers handle HTTP only
Claude Code looks for CLAUDE.md in two places: the project root (loaded for every session in that directory) and the global ~/.claude/CLAUDE.md (loaded for every session, everywhere). Put project-specific rules in the project file and universal preferences in the global one.
You can also create nested CLAUDE.md files in subdirectories for more specific context — useful in monorepos where different packages have different conventions. Claude picks up the most relevant one based on the files you're working with.
Keep it concise — think of it as a cheat sheet for Claude, not a novel. A well-maintained 30-line CLAUDE.md beats a 300-line one nobody keeps up to date.
The best CLAUDE.md is the one that reflects how your project actually works today — not how it worked six months ago.
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.