A comprehensive guide to structuring your Claude Code projects for maximum productivity and team collaboration.
This repository demonstrates the optimal file and folder structure for projects using Claude Code β Anthropic's official CLI, desktop app, and IDE extension for AI-powered development.
Whether you're working solo or on a team, proper project structure helps Claude Code:
- Understand your codebase faster
- Follow your coding standards automatically
- Remember team conventions across sessions
- Execute custom workflows with slash commands
- Use specialized skills and agents for specific tasks
Claude Code loads configuration files at the start of each session. A well-structured project means:
β
Consistent behavior - Claude follows the same rules every time
β
Faster onboarding - New team members get instant context
β
Reusable workflows - Create slash commands for common tasks
β
Specialized agents - Deploy focused agents for review, security, testing
β
Personal flexibility - Local overrides for individual preferences
β
Better results - Claude understands your architecture, conventions, and rules
claude-code-project-structure/
βββ README.md # This file
βββ CLAUDE.md # Shared project documentation (committed)
βββ CLAUDE.local.example.md # Example personal preferences (not committed)
βββ .mcp.example.json # Example MCP server configuration
β
βββ .claude/ # Claude Code configuration directory
β βββ settings.json # Shared project settings (committed)
β βββ settings.local.example.json # Example local settings (not committed)
β β
β βββ commands/ # Reusable slash commands
β β βββ review.md # /review - Code review workflow
β β βββ deploy.md # /deploy - Deployment checklist
β β βββ fix-issue.md # /fix-issue - Bug fix workflow
β β
β βββ skills/ # Specialized knowledge modules
β β βββ testing-patterns/
β β βββ SKILL.md # Testing best practices
β β
β βββ agents/ # Specialized sub-agents
β βββ code-reviewer.md # Code quality agent
β βββ security-auditor.md # Security scanning agent
β
βββ .gitignore # Protects secrets and local files
Purpose: Onboarding documentation loaded in every Claude Code session.
What to include:
- Project overview and goals
- Tech stack and architecture
- Coding conventions and standards
- Testing requirements
- Git workflow rules
- Security guidelines
- Documentation standards
When Claude uses it: Automatically loaded at session start to understand project context.
Purpose: Personal preferences and workflow notes (not committed to git).
What to include:
- Your preferred terminal commands
- Local environment setup
- Personal formatting preferences
- Custom shortcuts or reminders
- Notes specific to your development setup
When Claude uses it: Loaded alongside CLAUDE.md but overrides take precedence for your local workflow.
Purpose: Example configuration for MCP (Model Context Protocol) servers.
What it enables:
- Connect Claude Code to GitHub, Jira, Slack, databases
- Access external tools and services
- Extend Claude's capabilities beyond the filesystem
How to use:
- Copy
.mcp.example.jsonto.mcp.json - Add your real credentials and endpoints
- Never commit the real
.mcp.jsonfile
Purpose: Project-wide settings shared with the team.
What to configure:
- Tool permissions (which commands are auto-allowed)
- Hooks (commands that run before/after Claude actions)
- PreToolUse/PostToolUse validations
- Git workflow enforcement
- Linting and formatting checks
Example use cases:
- Auto-run tests before commits
- Enforce branch naming conventions
- Validate no secrets in code
- Run linters on file changes
Purpose: Personal overrides (not committed).
What to override:
- Additional tool permissions
- Local-only hooks
- Development shortcuts
- Personal automation preferences
Slash commands are reusable workflows stored in .claude/commands/.
How to use: Type /command-name in Claude Code to invoke.
Analyzes changed files for code quality, security issues, test coverage, and improvement suggestions.
Usage: /review
Usage: /review --strict
Validates environment config, runs tests, checks deployment risks, creates deployment checklist.
Usage: /deploy
Usage: /deploy production
Structured approach to understanding, fixing, and testing bugs with minimal changes.
Usage: /fix-issue "User login fails on mobile"
Skills are specialized knowledge modules loaded when relevant.
Provides testing best practices, patterns for unit/integration tests, mocking strategies, and edge case handling.
When Claude uses it: When writing or reviewing tests, or when you explicitly invoke testing-related tasks.
Agents are specialized sub-agents with focused roles.
Focused on code quality, maintainability, performance, and best practices.
When to use: Spawn with Agent tool for independent code reviews.
Specialized in security scanning, secrets detection, vulnerability analysis, and security best practices.
When to use: Spawn with Agent tool for security reviews before merging.
-
Clone this repository:
git clone https://github.com/yourusername/claude-code-project-structure.git cd claude-code-project-structure -
Open it in Claude Code (CLI, desktop app, or IDE extension)
-
Explore each file to understand its purpose
-
Try the slash commands:
/review,/deploy,/fix-issue
-
Copy the structure:
# Copy .claude/ folder to your project cp -r .claude/ /path/to/your/project/ # Copy CLAUDE.md and customize it cp CLAUDE.md /path/to/your/project/
-
Customize for your project:
- Edit
CLAUDE.mdwith your tech stack, conventions, and rules - Modify
.claude/settings.jsonfor your team's workflow - Create custom commands in
.claude/commands/ - Add project-specific skills in
.claude/skills/
- Edit
-
Set up local overrides:
# Create your personal local files (not committed) cp CLAUDE.local.example.md CLAUDE.local.md cp .claude/settings.local.example.json .claude/settings.local.json cp .mcp.example.json .mcp.json -
Commit team files, ignore personal files:
git add CLAUDE.md .claude/ git add .gitignore git commit -m "Add Claude Code project structure"
Share with the team (committed):
CLAUDE.md- Project knowledge.claude/settings.json- Shared workflows.claude/commands/- Team slash commands.claude/skills/- Shared knowledge modules.claude/agents/- Specialized agents
Keep personal (not committed):
CLAUDE.local.md- Personal notes.claude/settings.local.json- Personal preferences.mcp.json- Your credentials
Result: Everyone gets consistent Claude behavior while maintaining personal flexibility.
Every project should have a CLAUDE.md that explains:
- What the project does
- How it's structured
- What the conventions are
- What Claude should know
If you do something more than twice, make it a slash command:
- Code reviews
- Deployment prep
- Migration scripts
- Testing workflows
- Documentation generation
When Claude needs specialized knowledge (testing patterns, security rules, API conventions), create a skill module.
Use specialized agents for:
- Independent code reviews
- Security audits
- Performance analysis
- Documentation review
Always use .example files for templates and never commit:
.mcp.jsonCLAUDE.local.md.claude/settings.local.json- Any files with real credentials
The better documented your project is, the better Claude performs. Include:
- Architecture decisions
- Coding standards
- Testing requirements
- Security rules
- Git workflow
Your Claude Code structure will evolve. Update files as you discover what works best for your team.
Never commit:
- Real API keys or credentials
- Database connection strings
- Environment-specific secrets
- Personal access tokens
Always commit:
- Example configuration files (
.examplesuffix) - Documentation explaining what goes where
- Team-shared workflows and conventions
Use .gitignore:
This repository includes a .gitignore that protects local files. Review it and adapt for your stack.
If you have suggestions for improving this structure:
- Open an issue with your idea
- Submit a pull request with improvements
- Share your own best practices
MIT License - feel free to use this structure in your projects.
Created to help developers get the most out of Claude Code. Share this repository with anyone who wants to improve their AI-assisted development workflow.
Ready to supercharge your development workflow?
β Star this repository if you find it helpful
π Share on LinkedIn to help other developers
π¬ Open an issue if you have questions
Happy coding with Claude! π