Give Claude permanent context about your project
Every conversation with Claude starts from scratch. No context. No knowledge that you work in Next.js, that you prefer strict TypeScript, that there are specific conventions in your codebase. You have to re-explain everything every time. CLAUDE.md fixes this.
It's a Markdown file that Claude reads automatically at the start of every session. You give it persistent context about your project, your preferences, and your conventions. Once configured, Claude always knows where it is.
Start with the project CLAUDE.md. It's 80% of the value with 20% of the effort.
# [Project name] ## Stack - Framework: Next.js 15 App Router - Language: TypeScript strict (no any) - Styles: Tailwind CSS - DB: Neon Postgres + Prisma ORM - Auth: Clerk ## Code conventions - Components: PascalCase with explicit types - API routes: kebab-case - Hooks: use[Feature] in /src/hooks/ - No obvious comments — only the "why", not the "what" ## Route structure ``` src/app/(marketing)/ → public pages src/app/(platform)/ → authenticated pages src/app/api/ → API routes ``` ## What NOT to do - No any in TypeScript - No hardcoded API keys — always from process.env - No inline styles — always Tailwind - No unprompted features ## Environment variables DATABASE_URL, CLERK_SECRET_KEY, ANTHROPIC_API_KEY
# My global preferences ## Language Always respond in English unless the code requires otherwise. ## Code style - Strict TypeScript always - Small, focused functions (max 30 lines) - Descriptive naming > comments ## How I work best with Claude - Explain the reasoning behind non-obvious decisions - If there are multiple options, recommend one with justification - Concise responses — no filler or unnecessary disclaimers ## My usual tools - Editor: VS Code / Cursor - Terminal: zsh - Package manager: npm
Don't put secrets or API keys in CLAUDE.md — this file will be committed to the repo. Only reference environment variables.
ejercicio
Create your project CLAUDE.md
Create the CLAUDE.md file in the root of your current project. Adapt the template with your real stack and commit it.
# My project ## Stack - [Framework you use] - [Language] - [Styles] - [DB if applicable] ## Code conventions - [Naming conventions] - [Folder structure] - [Patterns you prefer] ## What NOT to do - [Anti-patterns in your project] - [Important constraints] ## Business context [2-3 lines on what your project does and for whom]