This repository contains workflows and scripts for enabling multiple AI agents to work together collaboratively using Claude Code's MCP (Model Context Protocol) feature.
With this setup, you can orchestrate multiple Claude Code instances that:
- Work on different aspects of a task in parallel
- Share discoveries through a chat room
- Review each other's work
- Automatically iterate until quality standards are met
- Multi-Agent Bug Fix Workflow: Automated investigation → implementation → review → fix cycles
- Multi-Agent Investigation Workflow: Parallel investigation of complex systems with specialized agents
- Cost Optimization: 85%+ token cost reduction through prompt caching
- Quality Assurance: Automated code review with iterative improvements
git clone https://github.com/mkXultra/claude_code_setup
cd claude_code_setupIn your working project directory:
ln -s /path/to/claude_code_setup guideFrom your project root:
./guide/mcp_add.shThis installs:
- Chat MCP: For agent communication
- CCM (Claude Code Manager): For spawning and managing multiple Claude instances
- Playwright MCP: For browser automation (optional)
In Claude Code:
/mcp
You should see chat, ccm, and playwright listed.
For bug fixing:
@guide/multi-agent-bug-fix-workflow.md Please fix [bug description]
For investigation:
@guide/multi-agent-investigation-workflow.md Please investigate [topic]
Specialized agents working together:
- Investigation Agent (Opus): Analyzes bug and proposes solutions
- Implementation Agent (Sonnet): Implements the fix
- Review Agent (Opus): Reviews code changes
- Debug Agent (Sonnet): Troubleshoots when errors occur
The agents automatically cycle through review-fix iterations until code quality standards are met.
For complex system analysis:
- Divides investigation into 4-6 specialized areas
- Agents work in parallel on different aspects
- Dynamic agent addition based on discoveries
- Final integration by Opus model for high-quality reports
- Task: Fix file locking directory creation bug
- Time: 15 minutes (vs hours manually)
- Cost: 85% reduction through caching
- Quality: Automated review caught edge cases
- Task: Permission system analysis
- Time: 20 minutes with 7 agents
- Deliverables: 5 comprehensive reports totaling 45KB
- Coverage: Complete system understanding
The workflows use a "foundation session" strategy:
{
"cache_read_input_tokens": 390302, // Reused tokens (cheap!)
"input_tokens": 56 // New tokens (expensive)
}Result: 90%+ token cost savings
mcp_add.sh: Installation script for MCP componentsmulti-agent-bug-fix-workflow.md: Bug fixing workflow (English)multi-agent-bug-fix-workflow_jp.md: Bug fixing workflow (Japanese)multi-agent-investigation-workflow.md: Investigation workflow (English)multi-agent-investigation-workflow_jp.md: Investigation workflow (Japanese)multi-agent-feature-implementation-workflow.md: Feature implementation workflow
- Claude Code with MCP support
- Node.js (for npx commands)
- Active Claude API access
Feel free to submit issues and enhancement requests!
[Your License Here]
Built using: