Install the collective system in any project with a single command:
npx claude-code-collective initInstallation Options:
# Full installation (recommended)
npx claude-code-collective init
# Minimal installation (core agents only)
npx claude-code-collective init --minimal
# Interactive configuration
npx claude-code-collective init --interactive
# Testing framework only
npx claude-code-collective init --testing-only
# Hook system only
npx claude-code-collective init --hooks-onlyVerify your installation:
npx claude-code-collective status
npx claude-code-collective validateThe collective uses a hub-and-spoke coordination pattern:
- Hub:
@routing-agent- Central coordination point - Spokes: Specialized agents for different tasks
- Flow: All requests → Hub → Appropriate Spoke Agent
The system operates under behavioral directives in CLAUDE.md:
- NEVER IMPLEMENT DIRECTLY - Always route through specialized agents
- COLLECTIVE ROUTING PROTOCOL - Central hub coordination required
- TEST-DRIVEN VALIDATION - Every handoff validated through contracts
The system understands natural language and converts it to structured commands:
# Natural language → Command translation
"show system status" → /collective status
"list all available agents" → /agent list
"validate quality gates" → /gate validate
"spawn a testing agent" → /agent spawn testing
"check system health" → /van check
"route this to research agent" → /collective route research/collective status # Show overall system health
/collective agents # List all available agents
/collective route <request> # Route request to appropriate agent
/collective metrics # Display performance metrics
/collective validate # Run system validation
/collective help # Command help/agent list # List all agents
/agent spawn <type> [params] # Create new agent instance
/agent status <name> # Show specific agent status
/agent route <request> # Test routing logic
/agent help # Agent command help/gate status # Show quality gate status
/gate validate [phase] # Run phase validation
/gate bypass <gate> <reason> # Emergency gate bypass
/gate history # Gate validation history
/gate help # Gate command help/van check # Run health checks
/van repair # Auto-repair issues
/van optimize # Performance optimization
/van full # Complete maintenance
/van report # Generate maintenance report
/van schedule # Configure scheduled maintenance
/van help # Maintenance helpQuick shortcuts for common operations:
# Short aliases
/c status # → /collective status
/a list # → /agent list
/g validate # → /gate validate
/v check # → /van check
# Ultra-short
/status # → /collective status
/route # → /collective route
/spawn # → /agent spawnCore Coordination:
routing-agent- Central hub coordinatorenhanced-project-manager-agent- Multi-phase project management
Implementation Specialists:
behavioral-transformation-agent- CLAUDE.md behavioral OStesting-implementation-agent- Jest framework and TDDhook-integration-agent- Directive enforcement scriptsnpx-package-agent- NPX distribution packagescommand-system-agent- Natural language parsingmetrics-collection-agent- Research validationdynamic-agent-creator- Runtime agent spawningvan-maintenance-agent- Self-healing ecosystem
Cross-Cutting Support:
research-agent- Technical research and analysisquality-agent- Code review and validationcomponent-implementation-agent- UI componentsfeature-implementation-agent- Business logicinfrastructure-implementation-agent- Build systems
# Route complex requests
/collective route "I need to implement authentication with OAuth2"
# → Routes to @feature-implementation-agent or @research-agent
# Route UI requests
/collective route "Create a login form component with validation"
# → Routes to @component-implementation-agent
# Route research requests
/collective route "What's the best way to handle WebSocket connections?"
# → Routes to @research-agent
# Route quality requests
/collective route "Review this code for security issues"
# → Routes to @quality-agentCreate specialized agents on-demand:
# Spawn agents with templates
/agent spawn research data-analysis
/agent spawn testing integration
/agent spawn implementation frontend
# Interactive agent creation
/agent spawn --interactive
# Clone existing agents
/agent spawn --clone existing-agent-id --name new-agentThe system validates three core hypotheses:
H1: JIT Context Loading
- Theory: On-demand loading is more efficient than preloading
- Metrics: Load times, memory usage, context relevance
- Target: 30% load time reduction, 25% memory savings
H2: Hub-and-Spoke Coordination
- Theory: Centralized routing outperforms distributed communication
- Metrics: Routing accuracy, coordination overhead, error rates
- Target: 90% routing accuracy, <10% coordination overhead
H3: Test-Driven Development
- Theory: Contract-based handoffs improve quality
- Metrics: Success rates, error detection, validation coverage
- Target: 80% handoff success, 95% validation coverage
# View metrics dashboard
/collective metrics
# Detailed research data
/collective metrics --detailed
# Export metrics for analysis
/collective metrics --export research-data.json# Quick health check
/van check
# Detailed health report
/van check --detailed
# Specific component checks
/van check --component hooks
/van check --component agents
/van check --component tests# Auto-repair common issues
/van repair
# Dry run (show what would be fixed)
/van repair --dry-run
# Repair specific issues
/van repair --missing-files
/van repair --permissions
/van repair --configurations# Run optimization routines
/van optimize
# Specific optimizations
/van optimize --cache-cleanup
/van optimize --test-optimization
/van optimize --agent-archival
/van optimize --metrics-cleanup# View maintenance schedule
/van schedule
# Configure automated maintenance
/van schedule --hourly health-check
/van schedule --daily full-maintenance
/van schedule --weekly optimization# System validation
/collective validate
# Quality gate validation
/gate validate
# Component-specific tests
/gate validate --phase behavioral
/gate validate --phase testing
/gate validate --phase hooksThe system uses contract-based validation for all agent interactions:
# View handoff contracts
ls .claude-collective/tests/contracts/
# Manual contract validation
/gate validate --contracts
# Handoff success metrics
/collective metrics --handoffsMain configuration files:
.claude/settings.json- Hook configurationCLAUDE.md- Behavioral operating system.claude/agents/- Agent definitions.claude-collective/- Testing framework
# View current configuration
npx claude-code-collective status --config
# Update installation
npx claude-code-collective update
# Repair corrupted installation
npx claude-code-collective repair
# Clean installation (reset to defaults)
npx claude-code-collective clean --confirmCommand not found:
# Check installation
npx claude-code-collective status
# Reinstall if needed
npx claude-code-collective init --forceHooks not working:
# Check hook status
/van check --component hooks
# Repair hook permissions
/van repair --permissions
# Note: Hook changes require Claude Code restartAgent routing issues:
# Test routing logic
/agent route "test request"
# Check agent registry
/agent list --detailed
# Validate agent definitions
/gate validate --agentsPerformance issues:
# Run optimization
/van optimize
# Check system health
/van check --performance
# View resource usage
/collective metrics --resources# Command-specific help
/collective help
/agent help
/gate help
/van help
# System diagnostics
npx claude-code-collective validate --verbose
# Generate support report
/van report --support# Full system validation
/collective validate --comprehensive
# Component validation
/gate validate --component behavioral
/gate validate --component testing
/gate validate --component hooks
/gate validate --component distribution
/gate validate --component commands
/gate validate --component metrics
/gate validate --component agents
/gate validate --component maintenanceThe collective is distributed as an NPX package for easy installation:
# Anyone can install with:
npx claude-code-collective init
# Package information
npm info claude-code-collective
# Version management
npx claude-code-collective@latest init# Add to existing projects
cd your-project
npx claude-code-collective init
# Integration validation
npx claude-code-collective validate --integrationEnable detailed metrics collection:
# Enable research tracking
/collective metrics --research-mode on
# Configure experiment tracking
/collective metrics --experiment "feature-comparison"
# Export research data
/collective metrics --export --format researchCreate your own agent templates:
# Create custom template
/agent template create my-custom-agent
# Use custom template
/agent spawn my-custom-agent specialized-task
# Share templates
/agent template export my-custom-agent# Real-time performance monitoring
/collective metrics --live
# Performance profiling
/van check --profile
# Resource optimization
/van optimize --resources# Installation
npx claude-code-collective init
# Health check
/van check
# Route requests
/collective route "<your request>"
# System validation
/collective validate
# Get help
/<namespace> helpCLAUDE.md- Behavioral operating system.claude/settings.json- Hook configuration.claude/agents/- Agent definitions.claude-collective/- Testing framework
- System validation:
/collective validate - Health diagnostics:
/van check --detailed - Support report:
/van report --support
The Claude Code Sub-Agent Collective provides a powerful, self-healing ecosystem for AI-assisted development with hub-and-spoke coordination, natural language interfaces, and comprehensive research validation capabilities.