Team Workflows Advanced
Scale Claude Code across your team with shared standards, custom workflows, structured onboarding, and organization-wide settings that ensure consistent, high-quality AI-assisted development.
Shared CLAUDE.md Standards
Every repository should have a team-approved CLAUDE.md that all team members use:
# Project Name ## Team Standards - Follow our style guide: docs/STYLE_GUIDE.md - All PRs require tests (minimum 80% coverage for new code) - Use conventional commits: feat:, fix:, docs:, refactor:, test: - Database migrations must be reversible ## Code Review Checklist When reviewing code, check for: 1. Security (no hardcoded secrets, proper auth checks) 2. Error handling (custom error classes, no swallowed errors) 3. Tests (unit + integration for new features) 4. Performance (no N+1 queries, proper indexing) ## Do NOT - Modify files in src/legacy/ (being deprecated) - Add new dependencies without team approval - Change database schema without a migration
Custom Slash Commands
Create team-specific slash commands in the .claude/commands/ directory:
# Code Review Command Review the current git diff against main. Check for: 1. **Security**: SQL injection, XSS, auth bypasses, exposed secrets 2. **Performance**: N+1 queries, missing indexes, unnecessary computation 3. **Error handling**: Uncaught exceptions, missing error boundaries 4. **Tests**: New code has tests, edge cases covered 5. **Naming**: Clear, descriptive names following our conventions Format as: - CRITICAL: Must fix before merge - WARNING: Should fix, but not blocking - SUGGESTION: Nice to have improvements Do NOT flag: formatting, import ordering, or style preferences (ESLint handles those).
# PR Description Generator Generate a pull request description based on the current branch changes. 1. Run `git log --oneline main..HEAD` to get commit list 2. Run `git diff main...HEAD --stat` to get file change summary 3. Generate a PR description with these sections: ## Summary One paragraph explaining the change. ## Changes - Bullet list of key changes ## Testing - How to test these changes - What automated tests were added ## Screenshots (Leave blank if no UI changes)
# Team members use custom commands like: > /review # Runs the team's standard code review > /pr # Generates a PR description
Code Review Process with AI
Establish a structured process for AI-assisted code reviews:
-
Developer creates PR
Developer uses
/prcommand to generate a description, then pushes the branch. -
Automated AI review (CI)
A GitHub Action runs Claude Code to post an initial review comment on the PR.
-
Human reviewer uses Claude
The reviewer checks out the branch and uses
/reviewto get AI-assisted analysis. -
Human makes final decision
The reviewer approves or requests changes based on both AI analysis and human judgment.
Onboarding New Developers
Claude Code accelerates onboarding dramatically:
# New developer onboarding prompts # Day 1: Understand the project > Give me an overview of this project's architecture. What are the main components > and how do they interact? Include the key files I should read first. # Day 2: Set up development environment > Walk me through setting up the development environment. What do I need to install? > How do I run the project locally? # Day 3: First task > I need to add a "last login" timestamp to the user profile. Walk me through which > files I need to modify and what patterns to follow. Don't make the changes yet, > just explain the plan. # Ongoing: Understanding unfamiliar code > Explain what src/services/recommendation-engine.ts does. I'm new to the team > and need to understand the recommendation algorithm.
Git Workflow Integration
# Branch Workflow When starting a new feature: 1. Create a branch from main: git checkout -b feature/[name] 2. Make changes in small, logical commits 3. Use conventional commit messages 4. Run tests before pushing 5. Create PR with /pr command Branch naming: feature/, fix/, refactor/, docs/, test/
Pair Programming with Claude
Use Claude Code as a pair programming partner for knowledge sharing:
- Senior + Claude: Senior developer guides Claude through complex architecture changes, explaining decisions aloud. This creates a natural documentation trail.
- Junior + Claude: Junior developer uses Claude to understand existing code, with Claude explaining patterns and conventions. Senior reviews the output.
- Two developers + Claude: Both developers discuss with Claude in the same session, using it as a mediator for technical decisions.
Organization Settings
| Setting | Purpose | Recommended |
|---|---|---|
| Shared API key pool | Track team-wide usage | Use per-team keys with spending limits |
| CLAUDE.md templates | Consistency across repositories | Create a template repo |
| Custom commands library | Shared team workflows | Maintain in a shared .claude/ directory |
| CI/CD integration | Automated reviews and tests | Use reusable workflow templates |
Security Policies
- API key rotation: Rotate keys monthly, revoke immediately when team members leave.
- Access control: Use separate keys for CI/CD vs developer access.
- Audit trail: Log Claude Code usage for compliance (who, when, what repository).
- Sensitive data: Add rules to CLAUDE.md preventing Claude from reading
.env, credentials, or PII files. - Model restrictions: Some teams restrict Opus usage to reduce costs.
Try It Yourself
Create a .claude/commands/review.md file with your team's code review checklist. Share it with your team as a custom slash command. Next: the comprehensive best practices guide.
Lilly Tech Systems