Claude Tips mascot
Claude Tips & Tricks
Claude Code beginner Featured

Write a CLAUDE.md for Every Project

A CLAUDE.md file gives Claude persistent context about your project's conventions, architecture, and preferences.

Create a CLAUDE.md at your project root. Claude Code reads it automatically on every conversation:

# Project: Payments API

## Stack
- Go 1.22, Chi router, PostgreSQL 16
- Tests: go test with testcontainers

## Conventions
- Error handling: always wrap with fmt.Errorf("context: %w", err)
- Never use panic in production code
- All HTTP handlers return structured JSON errors
- Database queries use sqlc-generated code

## Architecture
- /cmd — entrypoints
- /internal/api — HTTP handlers
- /internal/domain — business logic (no DB imports)
- /internal/store — database layer

This eliminates repetitive context-setting and ensures Claude follows your team’s patterns from the first message.

Paste into Claude Code
Create a CLAUDE.md file for this project. Analyze the codebase to determine the stack, conventions, architecture, and any project-specific patterns. Include build/test/lint commands.