Team CLAUDE.md Best Practices
- Document agreed-upon patterns
- Include architecture decisions
- Specify code review focus areas
- List common commands and workflows
- Update based on retrospectives
Scaling Claude Code usage from individual productivity to team excellence requires thoughtful coordination and shared practices. These tips will help you establish effective team workflows, maintain consistency across developers, and maximize the collective benefits of AI-assisted development.
Create a shared knowledge base that benefits everyone:
Structure for Team Use
project/├── CLAUDE.md # Team standards├── CLAUDE.local.md # Personal preferences (git-ignored)├── docs/│ └── claude/│ ├── onboarding.md # New member guide│ ├── patterns.md # Common patterns│ └── troubleshooting.md # Known issues
Version Control Integration
# Add team files to gitgit add CLAUDE.mdgit add .claude/commands/git add .claude/settings.jsongit add .mcp.json
# Ignore personal filesecho "CLAUDE.local.md" >> .gitignoreecho ".claude/personal/" >> .gitignore
Regular Updates
# Team retrospective prompt"Review our CLAUDE.md and suggest improvements based on recent development patterns"
Team CLAUDE.md Best Practices
Example team CLAUDE.md sections:
# Team Coding Standards
## TypeScript- ALWAYS use strict mode- PREFER interfaces over types for objects- REQUIRE explicit return types- USE branded types for IDs
## Testing- MINIMUM 80% coverage for new code- ALWAYS test error paths- USE data-testid for E2E tests- MOCK external services
# Architecture Decisions
## API Design- REST over GraphQL (decided 2024-03)- Versioning via URL path (/v1/, /v2/)- Standard error format (RFC 7807)- Rate limiting on all endpoints
## Database- PostgreSQL for primary data- Redis for caching only- No direct SQL, use Prisma- Soft deletes for audit trail
Standardize common workflows with shared commands:
Start a new feature following team process:
Feature: $ARGUMENTS
1. Create branch from latest main2. Update project board3. Create feature flag (if needed)4. Set up monitoring5. Create initial tests6. Draft PR description
Follow our feature development checklist.
More team command examples:
# .claude/commands/hotfix.md# .claude/commands/release.md# .claude/commands/incident-response.md# .claude/commands/performance-check.md
Create consistent security practices:
{ "allowedTools": [ "Edit", "View", "Create", "Delete", "Bash(*)", "mcp__*" ], "autoAllow": [ "git status", "git diff", "npm test" ]}
{ "allowedTools": [ "View", "Bash(git:*)", "Bash(npm:test)", "mcp__github__*" ], "requireApproval": [ "database migrations", "deployment commands" ]}
{ "allowedTools": [ "View" ], "blocked": [ "all write operations", "all execute operations" ]}
Document permission rationale:
# Permission Guidelines
## Development Environment- Full permissions for rapid development- Auto-allow safe read operations- Manual approval for destructive operations
## Staging Environment- Limited to testing and debugging- No direct database modifications- Deployment requires approval
## Production Environment- Read-only access only- All changes through CI/CD- Emergency access requires two approvals
Use CLAUDE.md to enforce consistency:
# Team Coding Standards
## Naming Conventions- Components: PascalCase (UserProfile, LoginForm)- Utilities: camelCase (formatDate, validateEmail)- Constants: UPPER_SNAKE_CASE (MAX_RETRIES)- Files: kebab-case (user-service.ts)
## Code Organization\`\`\`src/├── components/ # UI components├── services/ # Business logic├── utils/ # Shared utilities├── types/ # TypeScript types└── constants/ # App constants\`\`\`
## Error Handling\`\`\`typescript// ALWAYS use custom error classesclass ValidationError extends AppError { constructor(field: string, message: string) { super(`Validation failed for ${field}: ${message}`); }}
// ALWAYS handle errors explicitlytry { await riskyOperation();} catch (error) { logger.error('Operation failed', { error, context }); throw new OperationError('User-friendly message');}\`\`\`
## Testing Standards- Test file naming: *.test.ts or *.spec.ts- Describe blocks for class/module- It blocks for specific behaviors- AAA pattern: Arrange, Act, Assert
Standardize tool access across the team:
// .mcp.json (checked into git){ "servers": { "github": { "command": "npx", "args": ["@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "${GITHUB_TOKEN}" } }, "jira": { "command": "npx", "args": ["@modelcontextprotocol/server-jira"], "env": { "JIRA_HOST": "company.atlassian.net", "JIRA_EMAIL": "${JIRA_EMAIL}", "JIRA_TOKEN": "${JIRA_TOKEN}" } }, "slack": { "command": "npx", "args": ["@modelcontextprotocol/server-slack"], "env": { "SLACK_TOKEN": "${SLACK_TOKEN}" } } }}
Team MCP Benefits
Help new team members get productive quickly:
# Claude Code Onboarding Guide
## Initial Setup (30 minutes)1. Install Claude Code: `npm install -g @anthropic-ai/claude-code`2. Configure authentication: `claude auth login`3. Clone team repository4. Run setup script: `./scripts/claude-setup.sh`
## First Day Tasks1. Read team CLAUDE.md file2. Try example commands: - `/feature-start my-first-feature` - `/team-standards`3. Pair with team member on real task4. Join #claude-code Slack channel
## Best Practices- Always use `--dangerously-skip-permissions` for efficiency- Clear context between unrelated tasks- Check `/cost` daily to understand usage- Use team commands from `.claude/commands/`
## Common Issues- Permission prompts: Use skip flag- MCP not working: Check environment variables- High costs: Use Sonnet for routine tasks
## Resources- Team knowledge base: /docs/claude/- Video tutorials: /onboarding/claude-code/- Slack channel: #claude-code
Integrate Claude Code into your review process:
name: Claude Code Review
on: pull_request: types: [opened, synchronize]
jobs: review: runs-on: ubuntu-latest steps: - uses: anthropic/claude-code-review@v1 with: focus: | - Security vulnerabilities - Logic errors - Performance issues - Missing tests ignore: | - Style issues - Variable naming - Documentation
# Team review commandReview the PR at $ARGUMENTS focusing on:
1. Business logic correctness2. Security vulnerabilities3. Performance implications4. Test coverage5. Error handling
Ignore style issues - those are handled by linting.Be specific about issues and suggest fixes.
Review insights from teams:
“Claude Code catches bugs we miss. Humans catch design issues Claude misses. Together they’re unbeatable.” - Anthropic Security Team
Create a culture of continuous improvement:
Weekly Tips Session
# Weekly Claude Code Tips- 15-minute team standup- One person shares a discovered technique- Document in team knowledge base- Try the technique together
Workflow Show-and-Tell
# Export conversation for sharing/export > session.md# Share with team for learning
Cost Optimization Reviews
# Monthly cost review"Analyze our team's Claude Code usage and suggest optimization strategies"
Pattern Mining
# Quarterly pattern review"Review our codebase and identify patterns we should add to CLAUDE.md"
Use multiple team members with Claude Code for large projects:
# Microservices Migration Plan
## Team Assignment- Alice: User Service (Terminal 1)- Bob: Order Service (Terminal 2)- Carol: Payment Service (Terminal 3)- Dan: Integration Tests (Terminal 4)
## Coordination1. Morning sync to assign services2. Shared interface definitions in .claude/shared/3. Hourly check-ins on Slack4. End-of-day integration test
## Claude Code Setup\`\`\`bash# Each developerclaude --add-dir ./services/[assigned-service]\`\`\`
## Shared Resources- API contracts: .claude/shared/api/- Test utilities: .claude/shared/testing/- Migration guide: .claude/shared/migration.md
Coordination Tools
Develop commands that match your team’s workflow:
Generate standup report:
What I did yesterday:- Check git commits from last 24 hours- Summarize completed work
What I'm doing today:- Check current branch- List planned tasks
Blockers:- Check for failing tests- Note any technical debt
More team commands:
# Sprint planning.claude/commands/team/sprint-plan.md
# Incident response.claude/commands/team/incident.md
# Release notes.claude/commands/team/release-notes.md
# Technical debt tracking.claude/commands/team/tech-debt.md
Successful team adoption requires more than just technical setup:
Week 1: Individual explorationWeek 2: Share discoveriesWeek 3: Standardize workflowsWeek 4: Full team adoption
Focus: Rapid experimentation
Month 1: Pilot with early adoptersMonth 2: Develop team standardsMonth 3: Gradual rolloutMonth 4: Full adoption
Focus: Standardization
Quarter 1: Pilot teamsQuarter 2: Department rolloutQuarter 3: Organization-wideQuarter 4: Optimization
Focus: Governance and scale
Track these indicators of successful team adoption:
With team collaboration mastered, you’re ready for the final set of tips. Continue to Troubleshooting and Best Practices for common issues and proven patterns for long-term success.