Team Collaboration - robwhite4/claude-memory GitHub Wiki
This guide covers how teams can effectively use Claude Memory for shared AI context and knowledge management.
Claude Memory can enhance team development by maintaining shared project knowledge, decisions, and patterns. However, it requires coordination to avoid conflicts and maintain useful context.
Best for: Small teams, clear hierarchy
One team member manages all memory updates:
# Memory Keeper updates after team discussions
cmem decision "Use PostgreSQL" "Team agreed on ACID compliance" "MongoDB"
cmem knowledge add "db_connection" "postgresql://..." --category infrastructure
Pros:
- No merge conflicts
- Consistent memory style
- Clear responsibility
Cons:
- Single point of failure
- Keeper must attend all meetings
- Potential bottleneck
Best for: Open source projects, distributed teams
Memory updates happen via pull requests:
## PR Description
Implemented user authentication system using JWT tokens.
### Memory Updates
- Decision: JWT over sessions (stateless architecture)
- Pattern: Middleware for auth validation
- Knowledge: Auth endpoints documented
Pros:
- Memory changes reviewed
- Clear audit trail
- No direct conflicts
Cons:
- Manual process
- Memory might lag behind code
Best for: Collaborative teams, frequent pairing
All team members update memory:
# .gitignore configuration
.claude/sessions/
.claude/backups/
.claude/memory.json
.claude/config.json
!.claude/context/
Pros:
- Real-time knowledge sharing
- Distributed responsibility
- Rich context
Cons:
- Merge conflicts possible
- Requires discipline
- Can become cluttered
Use prefixes to identify context source:
# Team-wide patterns
cmem pattern add "[TEAM] Code review required" "All PRs need approval"
# Personal patterns
cmem pattern add "[JOHN] Debug with logs" "Add console.logs first"
# Component-specific
cmem pattern add "[AUTH] Token expiry" "Set to 24 hours"
Agree on knowledge categories:
# Standard categories
- architecture
- infrastructure
- security
- performance
- decisions
- conventions
# Usage
cmem knowledge add "api_rate_limit" "100 req/min" --category performance
Standardize decision format:
cmem decision "<WHAT>" "<WHY>" "<ALTERNATIVES>"
# Examples
cmem decision "React over Vue" "Team expertise, ecosystem" "Vue,Angular,Svelte"
cmem decision "Monorepo structure" "Shared code, easier deployment" "Multirepo"
# Start of sprint
cmem session start "Sprint 23 - User Dashboard"
# Add sprint goals as tasks
cmem task add "Dashboard layout component" --priority high --assignee Sarah
cmem task add "User metrics API" --priority high --assignee John
cmem task add "Dashboard tests" --priority medium --assignee Mike
During code reviews, capture patterns:
# Reviewer finds issue
cmem pattern add "[REVIEW] Unhandled promise rejection" \
"Always use try-catch with async operations" \
--effectiveness 0.9 \
--priority high
Document major decisions:
# After architecture meeting
cmem decision "Microservices architecture" \
"Scale teams independently, service isolation" \
"Monolith,Modular monolith"
cmem knowledge add "service_boundaries" \
"Auth, Users, Orders, Payments, Notifications" \
--category architecture
Share discoveries and learnings:
# After debugging session
cmem knowledge add "memory_leak_cause" \
"Event listeners not removed in useEffect cleanup" \
--category debugging
cmem pattern add "React hook cleanup" \
"Always return cleanup function from useEffect" \
--effectiveness 1.0
When conflicts occur in context files:
# Option 1: Meeting to resolve
git status # See conflicts
# Team discusses conflicting updates
# Manually merge maintaining both insights
# Option 2: Temporal resolution
git checkout --theirs .claude/context/ # Take newer
cmem knowledge add "merge_conflict_note" "Merged from main, see PR #123"
# Option 3: Reset and rebuild
git checkout --ours .claude/context/
cmem export team-backup.json # Save current state
# Team reviews and re-adds important items
-
Pull frequently
git pull origin main
-
Small, focused updates
# Not this cmem knowledge add "everything" "long multi-topic update..." # But this cmem knowledge add "api_auth" "Bearer token in header" cmem knowledge add "api_base" "https://api.example.com/v2"
-
Coordinate major updates
- Announce in team chat before big memory updates
- Do memory cleanup sessions together
- ✅ Document decisions promptly
- ✅ Use clear, descriptive keys
- ✅ Remove outdated information
- ✅ Share useful patterns
- ✅ Keep knowledge factual
- ❌ Store personal preferences as team patterns
- ❌ Commit sensitive information
- ❌ Make breaking changes without discussion
- ❌ Use memory for task management (use proper tools)
- ❌ Let memory grow unbounded
# .github/workflows/memory-check.yml
name: Memory Check
on: [pull_request]
jobs:
check-memory:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm install -g claude-memory
cmem stats
cmem context --dry-run
# Post daily memory stats
cmem stats | slack-cli post "#dev-team"
# Share new decisions
DECISION=$(cmem decision "..." "..." "...")
echo "New decision: $DECISION" | discord-webhook send
Create an onboarding checklist:
- Read CLAUDE.md for project overview
-
Review recent decisions
cmem decision list --recent 10
-
Understand current patterns
cmem pattern list --priority high
-
Check active tasks
cmem task list
-
Browse knowledge base
cmem knowledge list --category architecture
Schedule monthly memory cleanup:
# Review and resolve old patterns
cmem pattern list --age 90d
# Archive completed decisions
cmem decision list --resolved
# Clean up outdated knowledge
cmem knowledge list --category deprecated
Include in sprint retrospectives:
- What patterns emerged?
- What decisions were made?
- What knowledge was gained?
- What should be cleaned up?
Keep team memory guide updated:
- Agreed categories
- Naming conventions
- Update procedures
- Conflict resolution
Track memory health:
# Create team dashboard
cmem stats --json > stats.json
# Monitor growth
cmem export | wc -l # Track size over time
# Pattern effectiveness
cmem pattern list --sort effectiveness
See also:
- Multi-Machine-Setup - Personal multi-machine use
- Contributing-Guidelines - Contributing to projects
- Basic-Usage-Guide - Individual usage