Skip to main content
Tutorial·13 min read

How to Build a Multi-Agent AI Team with Claude Code

Set up Claude Code, install Skills, wire in a Telegram interface, and orchestrate multiple specialized agents that collaborate on real tasks — in about 90 minutes.

TL;DR — Key Takeaways

  • • Claude Code runs agents locally from your terminal; Skills files define what each agent knows how to do
  • • Multi-agent setups use an orchestrator agent that delegates to specialized sub-agents (coder, researcher, writer)
  • • Persistent memory is handled via a MEMORY.md file the agent reads and updates each session
  • • Telegram integration lets you control your agent team from a phone without opening a terminal
  • • Token consumption is significant — Claude Pro or a cheaper group plan is recommended before scaling up

1. Why multi-agent?

A single Claude agent is powerful, but it has limits. Context windows fill up. Long projects lose earlier decisions. Parallel tasks block on each other. The multi-agent pattern solves this by splitting work across specialized agents: one orchestrates, others execute narrowly defined roles.

In practice this looks like: an orchestrator agent that plans and delegates, a coder agent that writes and runs code, a researcher agent that searches the web, and a writer agent that produces documents. Each agent has a focused context and can work in parallel.

Claude Code's subagent architecture — where the main agent spawns child tasks via the Task tool — makes this pattern native. You do not need to build a custom orchestration framework.

2. Install Claude Code

Claude Code requires Node.js 18+. On macOS:

# Install Homebrew if needed
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

# Install Node.js
brew install nodejs

# Install Claude Code
npm install -g @anthropic-ai/claude-code

# Verify
claude --version

On Linux (including WSL on Windows), replace the Homebrew steps with your package manager. Claude Code itself is cross-platform once Node.js is in place.

Authentication is handled via claude auth on first run, which opens a browser to complete OAuth with your Anthropic account. If you do not have a Claude subscription yet, you will need one — we cover the cost angle in section 9.

3. Create a Telegram Bot (optional interface)

Running agents from a terminal is fine for development, but inconvenient on mobile or when you want to hand tasks off mid-day. Wiring Claude Code to a Telegram Bot gives you a conversational interface accessible from anywhere.

To create a bot: open Telegram, search for @BotFather, send /newbot, give it a display name and a username ending in _bot. BotFather returns a token — save it.

The bridge between Claude Code and Telegram is handled during the onboarding wizard (next section), which accepts your bot token and sets up a persistent gateway process. After that, messages you send to the bot are routed to your local Claude Code instance, and responses come back through the same channel.

This pattern also works with Slack and Discord via community MCP servers, though Telegram is the easiest starting point — no workspace permissions or OAuth app setup required.

4. Run the onboarding wizard

Claude Code ships with an interactive setup wizard that configures your model provider, communication channel, and initial Skills in one pass:

claude onboard --install-daemon

The wizard asks you to choose a model (Claude, GPT-4o, Gemini), a communication channel (Telegram, CLI, or web UI), and whether to install default Skills. Choose QuickStart for the fastest path.

For the model step: Claude Sonnet 4.5 is the default and a strong choice — it balances speed and quality well for orchestration tasks. If you want maximum capability for the orchestrator role and are willing to pay more per token, Claude Opus 4.5 is the alternative.

When prompted for a communication channel, paste the Telegram bot token from the previous step. The wizard spins up a gateway process and confirms the connection. After setup, send any message to your bot — you should see Claude respond within a few seconds.

5. Add persistent memory

By default, Claude Code has no memory between sessions — every conversation starts fresh. For agent teams handling ongoing projects, this is a hard limitation. The standard fix is a MEMORY.md file.

Create it in your project directory:

# MEMORY.md — Agent persistent state

## Current project
- Goal: Build a SaaS backlink audit tool
- Stack: Next.js 15, Supabase, Cloudflare Workers

## Decisions made
- Using Ahrefs API (not Moz) — rate limits are better
- Authentication: NextAuth with Google OAuth

## Tasks completed
- [x] Database schema designed
- [x] Auth flow implemented

## In progress
- [ ] Ahrefs API integration (assigned to coder-agent)

## Notes
- Ahrefs API key stored in .env.local (never commit)
- Staging URL: https://staging.myapp.com

Tell your orchestrator agent to read MEMORY.md at session start and append any decisions or progress at session end. You can encode this as a Skill (see next section) so it happens automatically.

For more structured memory, the mem0 MCP server provides semantic search over past interactions. Browse the available memory Skills on our SkillsMap directory — filter by the "Memory" category.

6. Install Skills

Skills are markdown files stored in ~/.claude/skills/ that give agents specific instructions. Think of them as reusable system prompts for recurring task types.

Installing a Skill from GitHub:

# Install the sequential-thinking Skill
claude skills install https://github.com/anthropics/claude-code-skills

# Or copy manually
curl -o ~/.claude/skills/sequential-thinking.md   https://raw.githubusercontent.com/.../sequential-thinking.md

For a multi-agent setup, a useful starter set of Skills includes:

SkillRoleWhat it does
sequential-thinkingOrchestratorForces structured reasoning before taking action
web-searchResearcherBrave/Tavily search with result summarization
code-reviewCoderStructured review across security, performance, readability
memory-managerAll agentsRead/write MEMORY.md at session boundaries
tdd-guideCoderRed-green-refactor loop enforcement

You can browse 349+ ranked Skills across 12 categories on our SkillsMap directory, sorted by GitHub stars so the most-adopted ones surface first.

7. Spawn sub-agents

Once your orchestrator is running, you trigger sub-agents using the Task tool natively built into Claude Code. From the orchestrator's perspective:

# In CLAUDE.md (orchestrator instructions):
When working on a feature, always:
1. Use /sequential-thinking to plan
2. Spawn a sub-agent via Task tool for implementation
3. Spawn a second sub-agent for code review
4. Only merge when both sub-agents complete

# The Task tool usage in practice:
# "Implement the Ahrefs API integration described in MEMORY.md.
#  Use the tdd-guide Skill. Write tests first."
# Claude spawns a child agent, runs it, returns results.

Sub-agents inherit the parent's working directory but not its conversation history. They receive a specific prompt, execute, return output, and terminate. This keeps each agent's context clean and allows genuinely parallel execution when tasks are independent.

A practical pattern for the orchestrator's CLAUDE.md:

# CLAUDE.md — Orchestrator

## Team structure
- Orchestrator (me): planning, delegation, memory management
- Coder sub-agent: implementation, tests (uses: tdd-guide, code-review)
- Researcher sub-agent: web search, summarization (uses: web-search)
- Writer sub-agent: documentation, blog posts (uses: content-writer)

## Rules
- Read MEMORY.md at start of every session
- Update MEMORY.md before ending every session
- Never implement directly — always delegate to Coder sub-agent
- Parallelise independent tasks with simultaneous Task calls

8. Safety guardrails

Multi-agent setups amplify both capability and risk. A misconfigured agent with filesystem access can delete files or expose credentials. A few rules that save pain:

  • 1.
    Never store API keys in MEMORY.md or CLAUDE.md. Reference environment variables only. CLAUDE.md is checked into git by default — treat it as public.
  • 2.
    Use allowlists for filesystem access. Claude Code's permission model lets you restrict which directories agents can modify. Set the working directory to your project root, not ~.
  • 3.
    Require explicit confirmation for destructive operations. Add a rule to your orchestrator: "Before running any rm, DROP TABLE, or force-push, pause and confirm with the user."
  • 4.
    Cap token budgets per sub-agent. Without limits, a looping agent can exhaust your monthly Pro quota in an afternoon. Use --max-tokens per Task invocation.
  • 5.
    Log all agent actions. Claude Code writes a session log by default. Point a monitoring Skill at it to alert you if an agent takes unexpected actions.

9. Managing token costs

This is where multi-agent setups can get expensive fast. Every sub-agent call consumes tokens — the orchestrator's context, the sub-agent prompt, and the sub-agent response all count. A moderately complex coding task that spawns 3 sub-agents might use 50K–150K tokens per session.

Claude Pro at $20/month includes roughly 5× the rate limits of the free tier, which is enough for light multi-agent experimentation. Claude Max at $100/month is where heavy orchestration becomes practical — it raises limits to 5× again and includes early access to longer context features.

If you want to experiment with Claude Pro without the full monthly commitment, GamsGo offers group subscription plans that bring Claude Pro, ChatGPT Plus, and other AI tool costs down by 30–70%. It is worth checking before committing to a solo plan — particularly useful when you are testing multi-agent setups and not yet sure what your actual monthly token usage will be.

Practical cost reduction tips:

  • Use Claude Haiku 4.5 for researcher sub-agents (web search, summarization) — it is ~10× cheaper and fast enough for retrieval tasks
  • Use Claude Sonnet 4.5 for the orchestrator and writer roles
  • Reserve Opus 4.5 for architecture decisions and one-off complex reasoning tasks
  • Set explicit context limits in each sub-agent's prompt to avoid runaway consumption
  • Cache repeated context (project stack, coding conventions) in CLAUDE.md rather than re-explaining in each prompt

FAQ

What is a Claude Code multi-agent setup?

A multi-agent setup runs several Claude instances simultaneously, each with a specific role — one orchestrates tasks, others specialize in coding, search, or memory. They communicate via the Task tool and hand off work between them, letting you tackle complex projects that would overwhelm a single agent's context window.

Do I need Claude Pro for multi-agent workflows?

Yes, at minimum. The free tier's rate limits are too low for parallel agent calls. Claude Pro ($20/month) is sufficient for experimentation; Claude Max ($100/month) is better for production-level orchestration. See section 9 for ways to reduce that cost.

How do I give agents memory between sessions?

The simplest pattern is a MEMORY.md file that the orchestrator reads at session start and appends to at session end. For semantic retrieval over longer histories, the mem0 MCP server adds vector search on top of plain-text notes.

What are Claude Code Skills?

Skills are reusable markdown instruction files stored in ~/.claude/skills/. They act as focused system prompts for specific task types — code review, writing, research, memory management. You can install community Skills from GitHub or write custom ones. Browse ranked Skills on our SkillsMap directory.

Can I use GPT-4o instead of Claude for the agents?

Claude Code natively supports multiple model providers. You can point sub-agents at GPT-4o or Gemini Pro via the model configuration, which is useful for cost optimization — cheaper models for retrieval tasks, stronger ones for synthesis and planning. The orchestration layer stays the same regardless of which underlying model each agent uses.