Skip to content

mhieupham1/claudecliagent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ€– Claude Code Agent Communication System

A collaborative development system where multiple AIs work togetherβ€”just like a real company!

πŸ“Œ What is this?

In 3 lines:

  1. Multiple AI agents (President, Manager, Workers) cooperate on development
  2. Each runs in its own terminal window and exchanges messages
  3. Tasks are divided up like a human organization for efficient development Actual Achievements:
  • Completed an β€œEmotiFlow” survey system in 3 hours
  • Generated 12 innovative ideas
  • Achieved 100% test coverage

🎬 Try it in 5 Minutes!

What you need

  • Mac or Linux
  • tmux (terminal multiplexer)
  • Claude Code CLI

Steps

1️⃣ Download (30 seconds)

git clone https://github.com/nishimoto265/Claude-Code-Communication.git
cd Claude-Code-Communication

2️⃣ Setup environment (1 minute)

./setup.sh

This prepares 5 terminal windows in the background!

3️⃣ Open President's window and start the AI (2 minutes)

Open President's window:

tmux attach-session -t president

Start Claude in the President's window::

# Browser authentication required
claude --dangerously-skip-permissions

4️⃣ Start all subordinates at once (1 minute)

Open a new terminal:

# Start all 4 subordinates at once
for i in {0..3}; do 
  tmux send-keys -t multiagent.$i 'claude --dangerously-skip-permissions' C-m
done

5️⃣ Check the workers' windows

・Each window may require browser-based Claude authentication

tmux attach-session -t multiagent

You’ll see a 4-way split screen:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ boss1  β”‚worker1 β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚worker2 β”‚worker3 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

6️⃣ Enter the magic words (30 seconds)

Enter:

You are president. Please create a stylish and rich IT company homepage.

And then, automatically:

  1. The President instructs the Manager
  2. The Manager assigns tasks to three Workers
  3. They collaborate to develop
  4. Once finished, they report back to the President

🏒 Characters (Agents)

πŸ‘‘ President (PRESIDENT)

  • Role: Sets the overall direction
  • Trait: Genius at understanding real user needs
  • Catchphrase: γ€ŒPlease realize this vision.」

🎯 Manager (boss1)

  • Role: Middle manager who leads the team
  • Trait: Master at drawing out members’ creativity
  • Catchphrase: γ€ŒPlease give me three or more innovative ideas.」

πŸ‘· Workers (worker1, 2, 3)

  • worker1: Design (UI/UX)
  • worker2: Data processing
  • worker3: Testing

πŸ’¬ How do they communicate?

How to send messages

./agent-send.sh [recipient name] "[message]"

# Example: Send to manager
./agent-send.sh boss1 "This is a new project"

# Example: Send to worker1
./agent-send.sh worker1 "Please create the UI"

Example exchanges

President β†’ Manager:

You are boss1.

[Project Name] Survey System Development

[Vision]
A system that anyone can easily use and see results immediately

[Success Criteria]
- Complete answers in 3 clicks
- Real-time result display

Please realize this with innovative ideas.

Manager β†’ Worker:

You are worker1.

[Project] Survey System

[Challenge]
Please propose three or more innovative UI design ideas.

[Format]
1. Idea Name: [catchy name]
   Overview: [description]
   Innovation: [what's new]

πŸ“ Explanation of Important Files

Instructions (instructions/)

Each agent's operation manual

president.md - President’s manual

# Your Role
As the top manager, understand user needs and present a vision.


# 5 Layers of Needs Analysis
1. Surface: What to create
2. Function: What it can do
3. Benefit: What is improved
4. Emotion: How users should feel
5. Value: Why it’s important

boss.md - Manager’s manual

# Your Role
As a genius facilitator, maximize the team's creativity.

# 10-Minute Rule
Check progress every 10 minutes and support members who are struggling.

worker.md - Worker’s manual

# Your Role
Leverage your expertise for innovative implementation.

# Task Management
1. Make a to-do list
2. Work through the list step-by-step
3. Report when finished

CLAUDE.md

System-wide configuration file

# Agent Communication System

## Agent Structure
- PRESIDENT: Overall leader
- boss1: Team leader  
- worker1,2,3: Implementers

## Send Messages
./agent-send.sh [recipient] "[message]"

🎨 Example Project: EmotiFlow

What was created?

  • 😊 Survey that lets you express emotions with emoji
  • πŸ“Š View results in real time
  • πŸ“± Works on smartphones

Try it out

cd emotiflow-mvp
python -m http.server 8000
# Open http://localhost:8000 in your browser

File structure

emotiflow-mvp/
β”œβ”€β”€ index.html    # Main screen
β”œβ”€β”€ styles.css    # Design
β”œβ”€β”€ script.js     # Logic
└── tests/        # Tests

πŸ”§ If you run into trouble

Q: Agents don’t respond

# Check status
tmux ls

# Restart
./setup.sh

Q: Message not delivered

# View logs
cat logs/send_log.txt

# Test manually
./agent-send.sh boss1 "γƒ†γ‚Ήγƒˆ"

Q: Want to start over

# Full reset
tmux kill-server
rm -rf ./tmp/*
./setup.sh

πŸš€ Create Your Own Project

Simple Example: Make a TODO app

Type in the President window:

You are president.
Please create a TODO app.
It should be simple, easy to use, and allow adding, deleting, and completing tasks.

Then, automatically:

  1. Manager breaks down the tasks
  2. worker1 creates the UI
  3. worker2 manages the data
  4. worker3 writes tests
  5. Done!

πŸ“Š System Diagram

Screen layout

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   PRESIDENT     β”‚ ← President's window (purple)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ boss1  β”‚worker1 β”‚ ← Manager (red) and Worker 1 (blue)
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚worker2 β”‚worker3 β”‚ ← Workers 2 and 3 (blue)
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Communication flow

President
 ↓ γ€ŒRealize the vision」
Manager
 ↓ γ€ŒEveryone, come up with ideas」
Workers
 ↓ γ€ŒFinished!」
Manager
 ↓ γ€ŒEveryone finished」
President

Progress management

./tmp/
β”œβ”€β”€ worker1_done.txt     # File created when worker1 finishes
β”œβ”€β”€ worker2_done.txt     # File created when worker2 finishes
β”œβ”€β”€ worker3_done.txt     # File created when worker3 finishes
└── worker*_progress.log # Progress log

πŸ’‘ Why is this amazing?

Conventional Development

Human β†’ AI β†’ Result

This System

Human β†’ AI President β†’ AI Manager β†’ 3x AI Workers β†’ Integration β†’ Result

Benefits:

  • 3x faster with parallel processing
  • Makes use of specialization
  • Lots of ideas
  • High quality

πŸŽ“ Want to know more?

How to write prompts

Good example:

You are boss1.

[Project Name] Clear name
[Vision] Specific ideal
[Success Criteria] Measurable indicators

Bad example:

Make something

How to customize

To add a new worker:

  1. Create instructions/worker4.md
  2. Edit setup.sh to add the pane
  3. Add mapping to agent-send.sh

To change the timer:

# In instructions/boss.md
sleep 600  # To change from 10 minutes to 5 minutes
sleep 300

🌟 Summary

By having multiple AIs collaborate, this system:

  • Can complete a full-featured web app in 3 hours
  • Generates 12 innovative ideas
  • Achieves 100% test coverage

Give it a try and experience the power of an AI team!


Author: GitHub License: MIT
Questions: Please use Issues!

About

No description, website, or topics provided.

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages