CLAUDE.md Templates for Beginners — Copy and Use These

Writing a CLAUDE.md from scratch is harder than it sounds. You know you need one, but you’re not sure what format to use, what sections to include, or how specific to get.

The fastest way past that friction: start with a real template.

This article gives you ready-made CLAUDE.md templates for the most common project types — with real content, not placeholders. Copy the one that matches your project, fill in the parts that need your specific details, and you’re done.

📋 TL;DR
– Five complete templates: general web project, Next.js/React, Python, Laravel/PHP, and solo founder/MVP
– Each template includes real content you can use immediately
– Every template has a “customize this” guide so you know exactly what to change
– Templates follow all the best practices from What to Put in Your CLAUDE.md (With Real Examples)
– Start with the template closest to your project, then evolve it over time

This is part of our complete CLAUDE.md — The Complete Beginner’s Guide (2026).


How to Use These Templates

Each template below is ready to copy. Here’s the process:

  1. Find the template that most closely matches your project type
  2. Copy the entire block into a new CLAUDE.md file in your project root
  3. Replace anything in [square brackets] with your actual details
  4. Delete any section that doesn’t apply to your project
  5. Add any section that’s missing but relevant to your setup

Don’t aim for perfection. A template that’s 80% right is already massively more useful than an empty file. You can refine it as you go.


Template 1: General Web Project (Any Stack)

This template works for any web project where you’re not sure which of the more specific templates applies. Start here if you’re a beginner.


# [Project Name] — Claude Code Instructions

## Project Overview
[One to two sentences describing what this project does and who uses it.]
[Note anything that should shape technical decisions: security requirements,
performance needs, user base size, or stage of development.]

## Tech Stack
- Primary language: [e.g. JavaScript / TypeScript / Python]
- Framework: [e.g. Express, Next.js, Django, Rails]
- Database: [e.g. PostgreSQL / MySQL / MongoDB / SQLite]
- Styling: [e.g. Tailwind CSS / SCSS / Bootstrap / CSS Modules]
- Authentication: [e.g. JWT / Passport.js / Auth0 / none]
- Testing: [e.g. Jest / Pytest / RSpec / none yet]
- Hosting: [e.g. Vercel / Railway / AWS / Heroku]

## Coding Standards
- Indentation: [2 spaces / 4 spaces / tabs]
- Quotes: [single / double]
- Semicolons: [yes / no]
- [Add your most important style rules here — be specific]
- [e.g. "Use descriptive variable names — no single letters except in loops"]
- [e.g. "Every function needs a comment explaining what it does"]

## Folder Structure
- `/src` or `/app` — [describe main source folder]
- `/[your folder]` — [what lives here]
- `/[your folder]` — [what lives here]
- `/tests` — [test files]

## Commands
- Start dev server: `[your command]`
- Run tests: `[your command]`
- Lint: `[your command]`
- Build: `[your command]`

## Constraints
- Never modify: [list any files or folders Claude should not touch]
- Always ask before: [e.g. installing packages, changing the database schema]
- Never do: [e.g. hardcode credentials, use deprecated APIs]

Customize this: Everything in square brackets. Focus most on the Tech Stack and Coding Standards sections — those have the most immediate impact on Claude’s output quality.


Template 2: Next.js / React Project

Use this if you’re building with Next.js (App Router or Pages Router) or a React-based project. Framework-specific templates produce significantly better results because Claude knows exactly which patterns apply.

For a deeper version of this template with more React-specific guidance, see CLAUDE.md for React/Next.js Projects.


# [Project Name] — Claude Code Instructions

## Project Overview
This is a [describe your app] built for [describe your users].
Using Next.js 14 with the App Router.
[State the primary technical priority: performance / rapid iteration / security]

## Tech Stack
- Language: TypeScript [strict mode enabled / loose mode]
- Framework: Next.js 14 — App Router [delete if using Pages Router]
- Styling: Tailwind CSS v3
- State management: [Zustand / Redux Toolkit / React Query / Context API only]
- Data fetching: [React Query / SWR / native fetch in Server Components]
- Database: [PostgreSQL / MySQL / MongoDB] via [Prisma / Drizzle / Mongoose]
- Authentication: [NextAuth.js / Clerk / Supabase Auth]
- Testing: [Vitest / Jest] + React Testing Library
- Deployment: [Vercel / AWS / other]

## Coding Standards

### TypeScript
- [Strict mode: no `any` allowed / `any` only as last resort]
- All component props must have a typed interface
- Named exports only — no default exports for components
- Use `type` for unions/intersections, `interface` for object shapes

### React / Next.js Patterns
- Server Components by default — use `'use client'` only when necessary
- All data fetching in Server Components or API routes
- No `useEffect` for data fetching — use Server Components or React Query
- One component per file
- Props interface named `[ComponentName]Props` at top of file

### Formatting
- 2-space indentation
- Single quotes
- No semicolons
- Trailing commas in multi-line structures

### Naming
- Components: PascalCase
- Functions/variables: camelCase
- Constants: UPPER_SNAKE_CASE
- Booleans: `is`, `has`, or `should` prefix

## Folder Structure

src/

├── app/ # Next.js App Router

│ ├── (auth)/ # Authenticated routes

│ ├── (public)/ # Public routes

│ └── api/ # API route handlers

├── components/

│ ├── ui/ # Generic reusable UI (Button, Input, Modal)

│ └── features/ # Feature-specific components

├── lib/

│ ├── db/ # Database client and queries

│ └── utils/ # Helper functions

├── hooks/ # Custom React hooks

├── types/ # Shared TypeScript types

└── config/ # Constants and configuration



Rules:
- Database queries in `lib/db/` only — never in components or pages
- Generic components in `components/ui/`, feature components in `components/features/`
- Shared types in `types/` — don't duplicate interfaces across files

## Commands
- Dev server: `npm run dev`
- Tests: `npm run test`
- Type check: `npm run typecheck`
- Lint: `npm run lint`
- Full validation: `npm run validate` (type + lint + test)
- Build: `npm run build`
- DB migrations: `npx prisma migrate dev`

## Architecture Notes
- Server Components fetch data; Client Components handle interaction
- All business logic in `lib/` — components should be thin
- Authentication via [NextAuth / Clerk] — never access session directly in components, use the provided hooks/helpers
- Environment variables in `.env.local` — never hardcode

## Constraints
- Never modify `/[legacy folder]` if applicable
- Always ask before adding new npm packages
- Never use inline styles — Tailwind only
- Never use `any` in TypeScript
- Never commit `.env.local` or any file with credentials

Template 3: Python Project

Use this for Python web apps, scripts, data pipelines, APIs, or any Python-based project. Covers both web frameworks (Django, Flask, FastAPI) and standalone Python scripts.

For a more detailed version, see CLAUDE.md for Python Projects.


# [Project Name] — Claude Code Instructions

## Project Overview
[One to two sentences describing the project and its purpose.]
[Note whether this is a web app, script, data pipeline, API, or CLI tool.]

## Tech Stack
- Language: Python [3.10 / 3.11 / 3.12]
- Framework: [Django / Flask / FastAPI / none — pure Python script]
- Database: [PostgreSQL / MySQL / SQLite] via [SQLAlchemy / Django ORM / psycopg2]
- Task queue: [Celery / RQ / none]
- Testing: pytest
- Linting: [ruff / flake8] + [black / none for formatting]
- Type checking: mypy [strict / standard]
- Package management: [pip + requirements.txt / Poetry / uv]
- Deployment: [Railway / Heroku / AWS / Docker]

## Coding Standards

### Python Style
- Follow PEP 8
- 4-space indentation
- Maximum line length: [88 for black / 79 for PEP 8]
- Use type hints on all function signatures — inputs and return types
- Prefer f-strings over `.format()` or `%` formatting
- Use dataclasses or Pydantic models for structured data — not plain dicts

### Naming
- Functions and variables: snake_case
- Classes: PascalCase
- Constants: UPPER_SNAKE_CASE
- Private methods/attributes: leading underscore (`_method_name`)

### Error Handling
- Never use bare `except:` — always catch specific exceptions
- Use custom exception classes defined in `[exceptions.py / errors.py]`
- Log errors with the `logging` module — not `print()`

### Code Structure
- Functions should do one thing — if a function is over 20 lines, consider splitting
- Write docstrings for all public functions and classes (Google style)
- Separate concerns: data access, business logic, and I/O in separate layers

## Folder Structure

src/ (or project name as package)

├── [app_name]/

│ ├── models/ # Data models / database schemas

│ ├── services/ # Business logic

│ ├── [routes/ or views/] # API endpoints or view functions

│ └── utils/ # Helper functions

├── tests/

│ ├── unit/ # Unit tests

│ └── integration/ # Integration tests

├── config/ # Configuration management

└── scripts/ # One-off utility scripts



## Commands
- Run app: `[python app.py / uvicorn main:app --reload / python manage.py runserver]`
- Run all tests: `pytest`
- Run with coverage: `pytest --cov=[app_name]`
- Lint: `ruff check .`
- Format: `black .`
- Type check: `mypy [app_name]/`
- Install dependencies: `pip install -r requirements.txt`

## Constraints
- All credentials and secrets via environment variables — use python-dotenv
- Never modify `/[frozen folder]` if applicable
- Always ask before adding new dependencies to requirements.txt
- Tests required for all new service functions
- No hardcoded file paths — use `pathlib.Path` and config variables

Template 4: Laravel / PHP Project

Use this for Laravel applications, PHP APIs, or PHP-based projects. See CLAUDE.md for Laravel/PHP Projects for an extended version.


# [Project Name] — Claude Code Instructions

## Project Overview
[Describe what this Laravel application does and who uses it.]
[Note the Laravel version and any significant packages in use.]

## Tech Stack
- Language: PHP [8.1 / 8.2 / 8.3]
- Framework: Laravel [10 / 11]
- Frontend: [Blade templates / Livewire / Inertia.js + Vue / Inertia.js + React]
- Database: [MySQL / PostgreSQL] via Eloquent ORM
- Cache: [Redis / Memcached / file]
- Queue: [Redis + Laravel Horizon / database queue]
- Authentication: [Laravel Breeze / Jetstream / Sanctum / Passport]
- Testing: PHPUnit + Pest
- CSS: [Tailwind CSS / Bootstrap]
- Build tool: Vite

## Coding Standards

### PHP / Laravel Style
- Follow PSR-12 coding standards
- 4-space indentation
- Use strict types: `declare(strict_types=1)` at top of all PHP files
- Return type declarations on all methods
- Type hints on all function parameters

### Naming
- Classes: PascalCase
- Methods and variables: camelCase
- Database tables: snake_case plural (matching Laravel convention)
- Constants: UPPER_SNAKE_CASE
- Blade templates: kebab-case (`user-profile.blade.php`)

### Laravel Patterns
- Thin controllers — business logic goes in Service classes, not controllers
- Use Form Requests for input validation — never validate in controllers
- Use Resource classes for API responses — never return raw Eloquent models
- Events and Listeners for side effects — don't add side effects in controllers
- Repositories for complex database queries [if we use this pattern / skip if not]

### Database
- Always use migrations — never modify the database manually
- Model relationships must be defined with proper return types
- Eager load relationships — no N+1 queries
- Use database transactions for multi-step writes

## Folder Structure

app/

├── Console/Commands/ # Artisan commands

├── Http/

│ ├── Controllers/ # Thin controllers

│ ├── Requests/ # Form Request classes

│ └── Resources/ # API Resource classes

├── Models/ # Eloquent models

├── Services/ # Business logic

├── Events/ & Listeners/ # Event-driven logic

└── Repositories/ # [Include if using repository pattern]

database/

├── migrations/ # Never edit existing migrations

└── seeders/

resources/views/ # Blade templates

tests/

├── Feature/ # Feature tests

└── Unit/ # Unit tests



## Commands
- Dev server: `php artisan serve`
- Queue worker: `php artisan queue:work`
- Run tests: `php artisan test` or `./vendor/bin/pest`
- Run specific test: `php artisan test --filter=TestClassName`
- Clear cache: `php artisan cache:clear && php artisan config:clear`
- Migrate: `php artisan migrate`
- Rollback: `php artisan migrate:rollback`
- Generate code: `php artisan make:[controller/model/migration/etc]`

## Constraints
- Never edit existing migration files — only create new ones
- Always ask before adding new Composer packages
- No direct database queries in controllers or Blade templates
- All user input must go through Form Request validation
- Never expose sensitive data in API responses — use Resource classes

Template 5: Solo Founder / MVP Project

This template is for non-technical founders and solo builders who are building an MVP and using Claude Code to move fast. Less technical detail, more product and business context.


# [App Name] — Instructions for Claude Code

## What We're Building
[Describe your product in plain English — what it does, who it's for,
what problem it solves. 2-4 sentences. No technical jargon required.]

## Who Our Users Are
[Describe your target user — their job, their pain point, their technical level.]
[Example: "Small business owners who are not technical and need to track expenses
without using complicated accounting software."]

## Current Stage
[Choose one: Early prototype / MVP with early users / Production with paying customers]
[If you're pre-revenue, note that speed of iteration matters more than perfection.]

## Tech Stack
(If you know it — leave blank if Claude is helping you choose)
- Framework: [e.g. Next.js, Bubble, Webflow + custom code]
- Database: [e.g. Supabase, Firebase, PlanetScale]
- Auth: [e.g. Supabase Auth, Clerk, Auth0]
- Payments: [e.g. Stripe, Lemon Squeezy]

## What I'm Focused On Right Now
[Describe the specific thing you're trying to build or fix this session.]
[The more specific, the better: "I'm building the onboarding flow — the 3 steps
after a user signs up for the first time."]

## My Technical Comfort Level
[Be honest: Complete beginner / Some coding experience / Comfortable with code]
[Ask Claude to explain things if you're a beginner — it will adjust its communication.]

## Business Priorities
1. [Your #1 priority — e.g. "Get to first paying customer as fast as possible"]
2. [Your #2 priority — e.g. "Don't break the payment flow — Stripe is critical"]
3. [Your #3 priority — e.g. "Mobile experience must be excellent — 80% of users on mobile"]

## Things to Avoid
- [e.g. "Don't add features I haven't asked for — scope creep is a real problem"]
- [e.g. "If something would take weeks to build, suggest a simpler version first"]
- [e.g. "Don't suggest enterprise-level architecture — I'm a team of one"]

## Credentials / Services I'm Using
(Do not put actual API keys here — just note what services exist)
- [e.g. "Stripe account exists — test keys in .env"]
- [e.g. "Supabase project is set up — connection string in .env"]

💡 Pro Tip: If you’re a non-technical founder, the “Business Priorities” and “Things to Avoid” sections often deliver more value than the technical sections. Claude is good at figuring out technical details — it needs your business context, which only you can provide.


Template 6: Global CLAUDE.md (Personal Preferences)

This template is for your global CLAUDE.md — the one in your home directory that applies to every project. Keep it focused on how you want Claude to work, not on project-specific details.


# My Global Claude Code Preferences

## How I Want Claude to Work
- Always explain what you're going to do before you write or edit code
- If a task is ambiguous or has more than one reasonable approach, briefly explain
  the options and tell me which you'd recommend and why
- Ask clarifying questions when you're uncertain — don't guess and proceed
- Stay focused on what I asked — don't expand scope without flagging it

## My General Coding Preferences
- I value readable code over clever code
- Always include error handling — never swallow exceptions silently
- Write descriptive names — `getUserById` beats `getUser` beats `g`
- Comments explain *why*, not *what* — the code shows what
- Prefer simple solutions over elegant but complex ones

## Communication Style
- Keep responses concise — I don't need long preambles or summaries
- When listing steps, use numbered lists so I can track progress
- If something will take multiple steps, tell me the plan first
- Flag risks and tradeoffs — I'd rather know upfront than discover problems later

## Things I Always Want
- Tests alongside new utility functions
- Error handling on all async operations
- Explicit types on all function signatures (in typed languages)

## Things I Never Want
- Hardcoded credentials in any file
- Explanations of things I already know — skip basics unless I ask
- Unnecessary verbosity — say what needs to be said, then stop

Choosing the Right Template

Your Situation Template to Use
Not sure where to start Template 1: General Web Project
Building with Next.js or React Template 2: Next.js / React
Python project of any kind Template 3: Python
Laravel or PHP project Template 4: Laravel / PHP
Non-technical, building an MVP Template 5: Solo Founder / MVP
Setting global preferences Template 6: Global CLAUDE.md

Key Takeaways

  • Start with a template** — a copied template you customize in 10 minutes is better than a blank file you procrastinate for days
  • Replace everything in square brackets** — placeholder text in your CLAUDE.md helps nobody, including Claude
  • Delete sections that don’t apply** — a shorter, accurate CLAUDE.md beats a long, irrelevant one
  • The business context section** (especially in Template 5) is underused and surprisingly powerful — Claude makes better decisions when it understands your goals
  • Templates are starting points** — evolve your CLAUDE.md as your project and preferences change

Next Steps

Return to CLAUDE.md — The Complete Beginner’s Guide (2026) for the full picture.