Custom instructions that Claude Code reads automatically.
Custom instructions that coding agents read automatically.
Codex CLI · Gemini CLI · Cursor · OpenCode
Models can only follow a few instructions before failing.
If you tell someone 100 things, they'll struggle to remember them all.
Models don't "think" - they generate text based on previous text.
What the model sees:
Confusing or unrelated content increases entropy - the model has more noise to work through.
Be concise. Only include what the model truly needs.
Start fresh often. Use /new or exit and relaunch sessions frequently.
/new
Every instruction competes for the model's attention.
~/.claude/CLAUDE.md # Always loaded (personal prefs) ~/pla/CLAUDE.md # Loaded when you start a session here ~/pla/CLAUDE.local.md # Personal additions (gitignored)
All files are loaded and appended. Treat changes like code review.
Add CLAUDE.md files in subdirectories - loaded only when working there.
project/ ├── CLAUDE.md # Build commands, architecture ├── src/ │ ├── CLAUDE.md # Code patterns │ └── models/ │ └── CLAUDE.md # Model conventions ├── tests/ │ └── CLAUDE.md # Test utilities └── docs/ └── CLAUDE.md # Doc style
tests/CLAUDE.md loads only when working in tests/.
tests/CLAUDE.md
tests/
npm run dev
zar migrate
# Project Name Laravel 11 + Livewire 3. SingleStore database. ## Commands - `zar migrate` - Run migrations - `zex vendor/bin/pint --dirty` - Format code ## Patterns - Multi-tenant: filter by tenant_id
# tests/CLAUDE.md ## Multi-tenancy Call `createNewTenantAndSetAsCurrent()` in beforeEach(). ## Factories Located in `database/factories/`.
~/.claude/CLAUDE.md
./CLAUDE.md
./dir/CLAUDE.md
**/CLAUDE.local.md