A minimal but effective CLAUDE.md that you can adapt for any project.
# [Your Project Name]
> Brief description of what this project does
## Tech Stack
- **Framework**: [e.g., Next.js 14, Express, Django]
- **Database**: [e.g., PostgreSQL, MongoDB, SQLite]
- **Language**: [e.g., TypeScript, Python, Go]
## Project Structure
/src /components - UI components /lib - Utilities and helpers /api - API routes/handlers /types - TypeScript types /tests - Test files /docs - Documentation
## Quick Commands
```bash
npm run dev # Start development server
npm run test # Run tests
npm run build # Build for production
npm run lint # Check code style
- Write tests for new features
- Use TypeScript strict mode
- Follow existing code patterns
- Keep functions small and focused
- Add dependencies without good reason
- Skip error handling
- Use
anytype - Leave console.logs in production code
{
success: boolean;
data?: T;
error?: string;
}// components/FeatureName/index.tsx - Main export
// components/FeatureName/FeatureName.tsx - Component
// components/FeatureName/FeatureName.test.tsx - Tests
## Customization Tips
### For a React/Next.js Project
Add:
```markdown
## State Management
- Use React Query for server state
- Use Zustand for client state
- Avoid prop drilling - use context
## Styling
- Tailwind CSS for all styling
- Use cn() helper for conditional classes
- Design tokens in tailwind.config.ts
Add:
## API Design
- RESTful endpoints
- Versioning: /api/v1/...
- Auth: Bearer token in Authorization header
## Error Handling
- Use custom error classes
- Log all errors to monitoring
- Return consistent error formatAdd:
## CLI Structure
- Commands in /src/commands
- Use Commander.js for parsing
- All output through logger utility
## Testing
- Unit tests for each command
- Integration tests in /tests/integration
- Mock filesystem in tests- Context - Claude knows your tech stack immediately
- Structure - Claude can navigate your codebase
- Commands - Claude can run your scripts
- Guidelines - Claude follows your conventions
- Patterns - Claude produces consistent code
Start with this template and expand as you notice:
- Questions Claude keeps asking → Add to CLAUDE.md
- Patterns Claude should follow → Document them
- Decisions Claude should know → Write them down
See also: CLAUDE.md Principles