Skip to content

CLAUDE.md Vault

The definitive collection of CLAUDE.md configurations, templates, and best practices for optimizing your OpenAI Codex experience.

What is CLAUDE.md?

CLAUDE.md is a special configuration file that helps OpenAI Codex understand your project better. It provides:

  • Project Context: Architecture, patterns, and conventions
  • Custom Instructions: Specific guidance for your codebase
  • Tool Preferences: Testing frameworks, linting rules, deployment configs
  • Domain Knowledge: Business logic and industry-specific information

Quick Start

Basic CLAUDE.md Template

markdown
# Project: Your App Name

## Architecture
- **Framework**: React + TypeScript
- **Backend**: Node.js + Express
- **Database**: PostgreSQL
- **Deployment**: Vercel

## Conventions
- Use functional components with hooks
- Follow Airbnb ESLint config
- Use Jest for testing
- Prefer named exports

## Domain Context
This is a task management application for remote teams.
Users can create projects, assign tasks, and track progress.

## Testing Strategy
- Unit tests: Jest + React Testing Library
- E2E tests: Playwright
- Coverage target: 80%

## Deployment
- Staging: `npm run deploy:staging`
- Production: `npm run deploy:prod`
- Database migrations: `npm run migrate`

Template Library

🏗️ Architecture Templates

Microservices CLAUDE.md:

markdown
# Microservices Architecture

## Services
- **user-service**: Authentication and user management
- **order-service**: Order processing and management
- **payment-service**: Payment processing
- **notification-service**: Email and SMS notifications

## Communication
- **Synchronous**: REST APIs with OpenAPI specs
- **Asynchronous**: RabbitMQ message queues
- **Service Discovery**: Consul
- **API Gateway**: Kong

## Data Strategy
- Each service owns its data
- Event sourcing for audit trails
- CQRS for read/write separation

## Deployment
- **Containers**: Docker with multi-stage builds
- **Orchestration**: Kubernetes
- **CI/CD**: GitLab CI with automated testing
- **Monitoring**: Prometheus + Grafana

Monolith CLAUDE.md:

markdown
# Monolithic Application

## Structure

src/ ├── controllers/ # Route handlers ├── services/ # Business logic ├── models/ # Data models ├── middleware/ # Express middleware ├── utils/ # Helper functions └── tests/ # Test files


## Patterns
- **MVC Architecture**: Clear separation of concerns
- **Repository Pattern**: Data access abstraction
- **Dependency Injection**: Constructor injection
- **Error Handling**: Centralized error middleware

## Database
- **ORM**: Sequelize with PostgreSQL
- **Migrations**: Version-controlled schema changes
- **Seeding**: Development and test data

🌐 Frontend Templates

React Application:

markdown
# React + TypeScript Application

## Tech Stack
- **Framework**: React 18 with TypeScript
- **State Management**: Redux Toolkit + RTK Query
- **Styling**: Styled-components + Material-UI
- **Testing**: Jest + React Testing Library
- **Build**: Vite

## Component Structure

components/ ├── ui/ # Reusable UI components ├── features/ # Feature-specific components ├── layouts/ # Page layouts └── pages/ # Route components


## Conventions
- Use functional components with hooks
- Props interfaces in same file as component
- Custom hooks for reusable logic
- Lazy loading for route components

## State Management
- **Global State**: Redux for shared application state
- **Server State**: RTK Query for API data
- **Local State**: useState for component-specific state
- **Form State**: React Hook Form for complex forms

## Styling
- **Theme**: Material-UI theme provider
- **Responsive**: Mobile-first approach
- **Accessibility**: WCAG 2.1 AA compliance
- **Icons**: Material-UI icons

Vue.js Application:

markdown
# Vue 3 + TypeScript Application

## Tech Stack
- **Framework**: Vue 3 with Composition API
- **State Management**: Pinia
- **Router**: Vue Router 4
- **Styling**: SCSS + Vuetify
- **Testing**: Vitest + Vue Test Utils

## Project Structure

src/ ├── components/ # Reusable components ├── views/ # Page components ├── stores/ # Pinia stores ├── composables/ # Composition functions ├── utils/ # Helper functions └── types/ # TypeScript definitions


## Conventions
- Use Composition API with `<script setup>`
- TypeScript interfaces for all props
- Composables for reusable logic
- Single File Components (SFC)

🔧 Backend Templates

Node.js API:

markdown
# Node.js REST API

## Tech Stack
- **Runtime**: Node.js 18+
- **Framework**: Express.js
- **Database**: PostgreSQL with Prisma ORM
- **Authentication**: JWT with refresh tokens
- **Validation**: Joi
- **Documentation**: Swagger/OpenAPI

## Architecture
- **Controllers**: Handle HTTP requests/responses
- **Services**: Business logic implementation
- **Repositories**: Data access layer
- **Middleware**: Authentication, validation, logging
- **Models**: Database entity definitions

## Security
- **CORS**: Configured for production domains
- **Rate Limiting**: Express-rate-limit
- **Input Validation**: Joi schemas
- **SQL Injection**: Parameterized queries with Prisma
- **XSS Protection**: Helmet.js

## Testing
- **Unit Tests**: Jest for business logic
- **Integration Tests**: Supertest for API endpoints
- **Database Tests**: In-memory SQLite for fast tests

Python FastAPI:

markdown
# FastAPI Application

## Tech Stack
- **Framework**: FastAPI
- **Database**: PostgreSQL with SQLAlchemy
- **Authentication**: OAuth2 with JWT
- **Testing**: pytest + httpx
- **Documentation**: Auto-generated OpenAPI

## Project Structure

app/ ├── api/ # API route definitions ├── core/ # Configuration and security ├── models/ # SQLAlchemy models ├── schemas/ # Pydantic models ├── services/ # Business logic └── tests/ # Test files


## Conventions
- **Type Hints**: Use throughout codebase
- **Pydantic Models**: For request/response validation
- **Dependency Injection**: FastAPI's Depends system
- **Async/Await**: For database operations

📱 Mobile Templates

React Native:

markdown
# React Native Application

## Tech Stack
- **Framework**: React Native with TypeScript
- **Navigation**: React Navigation 6
- **State Management**: Redux Toolkit
- **HTTP Client**: Axios with interceptors
- **Styling**: Styled-components + React Native Elements

## Platform Considerations
- **iOS**: Follow Human Interface Guidelines
- **Android**: Follow Material Design principles
- **Responsive**: Use Dimensions API for screen sizes
- **Performance**: FlatList for large datasets

## Native Modules
- **Camera**: react-native-camera
- **Maps**: react-native-maps
- **Push Notifications**: react-native-push-notification
- **Biometrics**: react-native-biometrics

Advanced Configurations

🔧 Development Workflow

markdown
# Development Workflow Configuration

## Git Workflow
- **Main Branch**: `main` (protected)
- **Feature Branches**: `feature/description`
- **Hotfix Branches**: `hotfix/description`
- **Release Branches**: `release/version`

## Code Review Process
- All changes require pull request
- Minimum 2 approvals for production code
- Automated CI checks must pass
- Security review for authentication/authorization changes

## Development Commands
- **Start**: `npm run dev`
- **Test**: `npm run test:watch`
- **Lint**: `npm run lint:fix`
- **Type Check**: `npm run type-check`
- **Build**: `npm run build`

## Environment Variables
```env
# Development
DATABASE_URL=postgresql://localhost:5432/myapp_dev
API_BASE_URL=http://localhost:3001
LOG_LEVEL=debug

# Production
DATABASE_URL=postgresql://prod-db:5432/myapp
API_BASE_URL=https://api.myapp.com
LOG_LEVEL=info

### 🏢 **Enterprise Configuration**

```markdown
# Enterprise Application Configuration

## Compliance Requirements
- **SOC 2 Type II**: Security controls implementation
- **GDPR**: Data privacy and user rights
- **HIPAA**: Healthcare data protection (if applicable)
- **SOX**: Financial reporting controls (if applicable)

## Security Standards
- **Authentication**: SSO with SAML/OIDC
- **Authorization**: RBAC with fine-grained permissions
- **Encryption**: TLS 1.3 in transit, AES-256 at rest
- **Audit Logging**: All user actions and system events

## Performance Requirements
- **Response Time**: 95th percentile < 200ms
- **Availability**: 99.9% uptime SLA
- **Scalability**: Auto-scaling based on CPU/memory
- **Monitoring**: Comprehensive metrics and alerting

## Development Standards
- **Code Review**: Security team review for sensitive changes
- **Testing**: 90% code coverage minimum
- **Documentation**: Architecture decision records (ADRs)
- **Deployment**: Blue-green deployment strategy

Best Practices

CLAUDE.md Do's

  1. Be Specific: Include exact versions, configurations, and commands
  2. Update Regularly: Keep information current with project evolution
  3. Include Context: Explain why certain decisions were made
  4. Document Patterns: Show examples of preferred code patterns
  5. Environment Details: Specify development, staging, and production differences

CLAUDE.md Don'ts

  1. Don't Include Secrets: Never put API keys, passwords, or tokens
  2. Don't Over-Specify: Avoid excessive detail that becomes outdated quickly
  3. Don't Forget Updates: Stale information can mislead OpenAI Codex
  4. Don't Skip Examples: Abstract descriptions without examples are less helpful

🎯 Optimization Tips

Focus on High-Impact Areas:

  • Project architecture and patterns
  • Testing strategies and frameworks
  • Deployment and CI/CD processes
  • Security and compliance requirements

Keep It Actionable:

  • Include specific commands and scripts
  • Provide code examples and snippets
  • Document common troubleshooting steps
  • Link to relevant documentation

Community Contributions

Submit Your CLAUDE.md

Share your configurations with the community:

  1. Fork the CodexLog repository
  2. Add your CLAUDE.md to /vault/templates/
  3. Include a description and use case
  4. Submit a pull request

Template Categories

  • Industry-Specific: E-commerce, Healthcare, Finance, Education
  • Technology-Specific: Framework combinations, cloud platforms
  • Company-Specific: Internal tools, team conventions
  • Project-Specific: Open source projects, personal projects

Ready to optimize your OpenAI Codex experience? Start with our basic template and customize it for your needs!