Project Guides
A well-structured CLAUDE.md file serves as the definitive guide for how Claude should interact with your codebase. This documentation helps Claude understand your project architecture, coding conventions, and desired interaction patterns.
Purpose of CLAUDE.md
Provides context about your project structure and architecture
Establishes coding conventions and style guidelines
Defines preferred interaction patterns with Claude
Improves code generation accuracy and quality
Creates consistent documentation for new team members
CLAUDE.md Structure
A comprehensive CLAUDE.md should include these sections:
Project Overview
Architecture
Code Style Guidelines
File Organization
Common Patterns
Testing Conventions
API Documentation
Examples
Known Limitations/Edge Cases
Template with Examples
Here's a template you can use as a starting point for your own CLAUDE.md file:
/src /components # UI components /services # Business logic /models # Data models /utils # Helper functions /infrastructure # IaC files /tests # Test files /docs # Documentation
Pattern 2: [Name]
[Description and example of the pattern]
Testing Conventions
Unit Tests
[Describe approach to unit testing]
Integration Tests
[Describe approach to integration testing]
API Documentation
External APIs
[Document external APIs used]
Internal APIs
[Document key internal APIs]
Examples
Example 1: [Name]
[Complete example with explanation]
Example 2: [Name]
[Complete example with explanation]
Known Limitations/Edge Cases
[List known issues or limitations]
/src /cli # Command-line interface /adapters # Cloud provider adapters /resources # Resource type implementations /state # State management /templates # IaC templates /tests # Test files /docs # Documentation /examples # Example configurations
Pattern 2: Command Pattern
Used to encapsulate requests as objects.
Testing Conventions
Unit Tests
Each component should have comprehensive unit tests with mocked dependencies.
Integration Tests
Tests that verify interactions between components use moto for AWS mocking.
Known Limitations/Edge Cases
GCP adapter doesn't support all resource types yet
State management can get out of sync with actual cloud state
Rate limiting isn't implemented for bulk operations
Using CLAUDE.md with Claude
When working with Claude on your project, you can reference CLAUDE.md:
By maintaining a detailed CLAUDE.md, you create a single source of truth for both Claude and your team, ensuring consistent, high-quality code generation that follows your project's established patterns and practices.
Additional Resources
Last updated