1. Introduction
With the rapid growth of AI, multi-agent systems are attracting more attention due to their ability to coordinate, split tasks, and handle complex automation. An “agent” can be an independent AI responsible for a specific role or task.
In this article, I’ll show you how to combine tmux (a powerful terminal multiplexer) with Claude (Anthropic’s AI model) to build a virtual organization. Here, AI agents can communicate, collaborate, and work together automatically via the terminal.
2. What is tmux?
tmux lets you split your terminal into multiple windows or sessions, each running its own process independently. Even if you disconnect, these sessions stay alive. This is super useful when you want to run several agents in parallel, each in their own terminal, without interfering with each other.
3. What is Claude?
Claude is an advanced language AI model developed by Anthropic. It can understand and respond to text requests, and it’s easy to integrate into automated systems—acting as a “virtual employee” taking on part of your workflow.
4. Why combine tmux and Claude?
Parallel & Distributed: Each agent is an independent Claude instance running in its own tmux session.
Workflow Automation: Easily simulate complex workflows between virtual departments or roles.
Easy Debug & Management: You can observe each agent’s logs in separate panes or sessions.
5. System Architecture
Let’s imagine a simple company structure:
PRESIDENT: Project Director (sets direction, gives instructions)
boss1: Team Leader (splits up tasks)
worker1, worker2, worker3: Team members (do the work)
Each agent has its own instruction file so it knows its role when starting up.
Agents communicate using a script:
./agent-send.sh [recipient] “[message]”
Workflow:
PRESIDENT → boss1 → workers → boss1 → PRESIDENT
6. Installation
Since the code is a bit long, I’ll just share the GitHub link to keep things short.
tmux:
Install guide: tmux Installing Guide
Claude:
Install guide: Claude Setup Guide
Git:
Install guide: Git Download
Clone the project:
bash
git clone https://github.com/mhieupham1/claudecliagent
Inside, you’ll find the main folders and files:
CLAUDE.md: Describes the agent architecture, communication, and workflows.
instructions/: Contains guidance for each role.
.claude/: JSON files to manage permissions for bash scripts.
setup.sh: Launches tmux sessions for PRESIDENT, boss1, worker1, worker2, worker3 so agents can talk to each other.
agent-send.sh: Script for sending messages between agents.
7. Deployment
Run the setup script:
bash
./setup.sh
This will create tmux sessions for PRESIDENT and the agents (boss1, worker1, worker2, worker3) in the background.
To access the PRESIDENT session:
bash
tmux attach-session -t president
To access the multiagent session:
bash
tmux attach-session -t multiagent
In the PRESIDENT session, run the claude command to set up the Claude CLI.
Do the same for the other agents.
Now, in the PRESIDENT window, try entering a request like:
you are president. create a todo list website now
PRESIDENT will start the to-do list. PRESIDENT will send instructions to boss1, boss1 will assign tasks to worker1, worker2, and worker3.
You can watch boss1 and the workers do their jobs, approve commands to create code files, and wait for them to finish.
Result:
8. Conclusion
Combining tmux and Claude lets you create a multi-agent AI system that simulates a real company: communicating, collaborating, and automating complex workflows. Having each agent in its own session makes it easy to manage, track progress, and debug.
This system is great for AI research, testing, or even real-world workflow automation, virtual team assistants, or teamwork simulations.
If you’re interested in developing multi-agent AI systems, try deploying this model, customize roles and workflows to your needs, and feel free to contribute or suggest improvements to the original repo!