Generate CLAUDE.md project memory files by exploring codebases...
Generate comprehensive CLAUDE.md project memory files by exploring and analyzing codebases.
Invoke this skill when:
Identify project root markers:
.git/ directorypackage.json, Cargo.toml, pyproject.toml, go.mod, etc.Makefile, CMakeLists.txt, build.gradleMap directory structure:
tree -L 3 -d --dirsfirst
# Or for large projects:
find . -type d -maxdepth 3 | head -50
Identify key directories:
src/, lib/, app/, pkg/tests/, test/, __tests__/, spec/config/, .github/, .vscode/docs/, doc/, documentation/Language detection:
# Count files by extension
find . -type f -name "*.py" | wc -l
find . -type f -name "*.go" | wc -l
find . -type f -name "*.rs" | wc -l
find . -type f -name "*.ts" -o -name "*.tsx" | wc -l
Framework detection:
Dependency analysis:
requirements.txt, pyproject.tomlpackage.json, package-lock.jsonCargo.toml, go.modArchitecture patterns:
Code conventions:
Testing patterns:
test_*.py, *_test.go)Application entry points:
main.py, app.py, index.tscmd/, bin/ directoriesMakefile targetsBuild/run commands:
# [Project Name]
## Overview
[1-2 sentence project description based on README or package metadata]
## Tech Stack
- **Language**: [Primary language and version]
- **Framework**: [Main framework if applicable]
- **Key Dependencies**: [Important libraries]
- **Testing**: [Test framework]
- **Build Tool**: [npm, cargo, make, etc.]
## Project Structure
[Simplified tree showing key directories]
### Key Directories
- `src/` - [Description]
- `tests/` - [Description]
- [Other important directories]
## Development Commands
```bash
# Install dependencies
[command]
# Run tests
[command]
# Run application
[command]
# Build
[command]
[Brief description of how code is organized - modules, packages, layers]
| File | Purpose |
|---|---|
| [file1] | [purpose] |
| [file2] | [purpose] |
## Customization
Tailor the generated CLAUDE.md based on:
### For ML/AI Projects
- Add sections on:
- Model architecture locations
- Training scripts
- Dataset handling
- Experiment tracking
### For Web Applications
- Add sections on:
- API endpoints
- Frontend structure
- Database schema location
- Authentication flow
### For Libraries/Packages
- Add sections on:
- Public API surface
- Versioning approach
- Breaking change policy
- Example usage
### For Monorepos
- Add sections on:
- Package/workspace structure
- Shared dependencies
- Inter-package relationships
- Build order
## Usage Example
When user says:
- "Generate memory for this project"
- "Create CLAUDE.md for this repo"
- "Help me understand this codebase"
Execute exploration process and generate CLAUDE.md:
```bash
# Step 1: Basic structure
ls -la
tree -L 2 -d --dirsfirst 2>/dev/null || find . -type d -maxdepth 2
# Step 2: Detect language/framework
cat package.json 2>/dev/null | head -30
cat pyproject.toml 2>/dev/null | head -30
cat Cargo.toml 2>/dev/null | head -30
cat go.mod 2>/dev/null
# Step 3: Read existing docs
cat README.md 2>/dev/null | head -100
# Step 4: Sample source files to understand patterns
# Find representative files and read them
# Step 5: Generate CLAUDE.md
./CLAUDE.md (project root, version controlled)./.claude/CLAUDE.md (claude-specific directory)./CLAUDE.local.md (gitignored, personal notes)Ask user preference if unclear.